Function __global->get_transaction_form_fields
Definitions
sources/ecommerce.php
- Get a form for transacting local payments.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
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 item name |
| $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 (excluding tax and shipping) |
| $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 (including shipping tax) |
| $tax_tracking | array | No | No | required parameter | N/A | N/A | Transaction tax tracking ID |
| $shipping_cost | REAL | No | No | required parameter | N/A | N/A | Transaction shipping cost in money |
| $shipping_tax | REAL | No | No | required parameter | N/A | N/A | Transaction shipping tax in money |
| $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 length (null: not a subscription) |
| $length_units | ID_TEXT | No | No | required parameter | N/A | 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) |
| $needs_shipping_address | boolean | No | No | False | N/A | N/A | Whether a shipping address is needed |
Returns
- A tuple: The form fields, Hidden fields, Confidence logos, Payment processor links
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get a form for transacting local payments.
*
* @param ID_TEXT $type_code The product codename
* @param SHORT_TEXT $item_name The item name
* @param ID_TEXT $purchase_id The purchase ID
* @param REAL $price Transaction price in money (excluding tax and shipping)
* @param array $tax_derivation Transaction tax derivation
* @param REAL $tax Transaction tax in money (including shipping tax)
* @param array $tax_tracking Transaction tax tracking ID
* @param REAL $shipping_cost Transaction shipping cost in money
* @param REAL $shipping_tax Transaction shipping tax in money
* @param ID_TEXT $currency The currency to use
* @param integer $price_points Transaction price in points (only for first transaction)
* @param ?integer $length The length (null: not a subscription)
* @param ID_TEXT $length_units The length units
* @param ?ID_TEXT $payment_gateway The payment gateway the payment will go via (null: autodetect)
* @param boolean $needs_shipping_address Whether a shipping address is needed
* @return array A tuple: The form fields, Hidden fields, Confidence logos, Payment processor links
*/
function get_transaction_form_fields(string $type_code, string $item_name, string $purchase_id, float $price, array $tax_derivation, float $tax, array $tax_tracking, float $shipping_cost, float $shipping_tax, string $currency, int $price_points, ?int $length, string $length_units, ?string $payment_gateway = null, bool $needs_shipping_address = false) : array
* Get a form for transacting local payments.
*
* @param ID_TEXT $type_code The product codename
* @param SHORT_TEXT $item_name The item name
* @param ID_TEXT $purchase_id The purchase ID
* @param REAL $price Transaction price in money (excluding tax and shipping)
* @param array $tax_derivation Transaction tax derivation
* @param REAL $tax Transaction tax in money (including shipping tax)
* @param array $tax_tracking Transaction tax tracking ID
* @param REAL $shipping_cost Transaction shipping cost in money
* @param REAL $shipping_tax Transaction shipping tax in money
* @param ID_TEXT $currency The currency to use
* @param integer $price_points Transaction price in points (only for first transaction)
* @param ?integer $length The length (null: not a subscription)
* @param ID_TEXT $length_units The length units
* @param ?ID_TEXT $payment_gateway The payment gateway the payment will go via (null: autodetect)
* @param boolean $needs_shipping_address Whether a shipping address is needed
* @return array A tuple: The form fields, Hidden fields, Confidence logos, Payment processor links
*/
function get_transaction_form_fields(string $type_code, string $item_name, string $purchase_id, float $price, array $tax_derivation, float $tax, array $tax_tracking, float $shipping_cost, float $shipping_tax, string $currency, int $price_points, ?int $length, string $length_units, ?string $payment_gateway = null, bool $needs_shipping_address = false) : array
