Function __global->make_subscription_button

Definitions

sources/ecommerce.php

  • Make a subscription (payment) button.This is for IPN-style transactions (as opposed to local transactions).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$type_code ID_TEXT No No required parameter N/A N/A The product codename
$item_name SHORT_TEXT No No required parameter N/A N/A The human-readable product title
$purchase_id ID_TEXT No No required parameter N/A N/A The purchase ID
$price REAL No No required parameter N/A N/A Transaction price in money
$tax_derivation array No No required parameter N/A N/A Transaction tax derivation
$tax REAL No No required parameter N/A N/A Transaction tax in money
$tax_tracking array No No required parameter N/A N/A Transaction tax tracking ID
$currency ID_TEXT No No required parameter N/A N/A The currency to use
$price_points integer No No required parameter N/A N/A Transaction price in points (only for first transaction)
$length integer No No required parameter N/A N/A The subscription length in the units
$length_units ID_TEXT No No required parameter d w m y N/A The length units
$payment_gateway ?ID_TEXT No No Null N/A N/A The payment gateway the payment will go via (null: autodetect)

Returns

  • The button
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Make a subscription (payment) button.This is for IPN-style transactions (as opposed to local transactions).
 *
 * @param  ID_TEXT $type_code The product codename
 * @param  SHORT_TEXT $item_name The human-readable product title
 * @param  ID_TEXT $purchase_id The purchase ID
 * @param  REAL $price Transaction price in money
 * @param  array $tax_derivation Transaction tax derivation
 * @param  REAL $tax Transaction tax in money
 * @param  array $tax_tracking Transaction tax tracking ID
 * @param  ID_TEXT $currency The currency to use
 * @param  integer $price_points Transaction price in points (only for first transaction)
 * @param  integer $length The subscription length in the units
 * @param  ID_TEXT $length_units The length units
 * @set d w m y
 * @param  ?ID_TEXT $payment_gateway The payment gateway the payment will go via (null: autodetect)
 * @return Tempcode The button
 */

function make_subscription_button(string $type_code, string $item_name, string $purchase_id, float $price, array $tax_derivation, float $tax, array $tax_tracking, string $currency, int $price_points, int $length, string $length_units, ?string $payment_gateway = null) : object