add_usergroup_subscription
country_to_currency
currency_convert
delete_usergroup_subscription
dev__ipn_debug
ecommerce_get_currency_symbol
ecommerce_test_mode
edit_usergroup_subscription
fatal_ipn_exit
find_all_products
find_member_subscriptions
find_product
find_product_row
get_currency_map
get_currency_symbol
get_transaction_fee
get_transaction_form_fields
handle_confirmed_transaction
handle_transaction_script
ip_to_currency
make_cancel_button
make_cart_payment_button
make_subscription_button
make_transaction_button
perform_local_payment
prepare_templated_subscription
send_invoice_notification
ECOMMERCE_PRODUCT_ALREADY_HAS
ECOMMERCE_PRODUCT_AVAILABLE
ECOMMERCE_PRODUCT_DISABLED
ECOMMERCE_PRODUCT_INTERNAL_ERROR
ECOMMERCE_PRODUCT_MISSING
ECOMMERCE_PRODUCT_NO_GUESTS
ECOMMERCE_PRODUCT_OUT_OF_STOCK
ECOMMERCE_PRODUCT_PROHIBITED
PRODUCT_CATALOGUE
PRODUCT_INVOICE
PRODUCT_ORDERS
PRODUCT_OTHER
PRODUCT_PURCHASE_WIZARD
PRODUCT_SUBSCRIPTION
add_usergroup_subscription(\SHORT_TEXT $title, \LONG_TEXT $description, \SHORT_TEXT $cost, integer $length, \SHORT_TEXT $length_units, \BINARY $auto_recur, \?GROUP $group_id, \BINARY $uses_primary, \BINARY $enabled, \?LONG_TEXT $mail_start, \?LONG_TEXT $mail_end, \?LONG_TEXT $mail_uhoh, array $mails) : \AUTO_LINK
| package | ecommerce |
|---|---|
| set | y m d w |
\SHORT_TEXTThe title
\LONG_TEXTThe description
\SHORT_TEXTThe cost
integerThe length
\SHORT_TEXTThe units for the length
\BINARYAuto-recur
\?GROUPThe usergroup that purchasing gains membership to (null: super members)
\BINARYWhether this is applied to primary usergroup membership
\BINARYWhether this is currently enabled
\?LONG_TEXTThe text of the e-mail to send out when a subscription is start (null: default)
\?LONG_TEXTThe text of the e-mail to send out when a subscription is ended (null: default)
\?LONG_TEXTThe text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
arrayOther e-mails to send
\AUTO_LINKThe IDcountry_to_currency(\ID_TEXT $country) : \ID_TEXT
currency_convert(mixed $amount, \ID_TEXT $from_currency, \?ID_TEXT $to_currency= null, boolean $string= false) : \?mixed
| package | ecommerce |
|---|
mixedThe starting amount (integer or float).
\ID_TEXTThe start currency code.
\?ID_TEXTThe end currency code (null: unknown, guess it).
booleanWhether to get as a string.
\?mixedThe new amount as float, or if $string then as a string (null: failed to do it).delete_usergroup_subscription(\AUTO_LINK $id, \LONG_TEXT $uhoh_mail = '')
| package | ecommerce |
|---|
\AUTO_LINKThe ID
\LONG_TEXTThe cancellation mail to send out (blank: none)
dev__ipn_debug(\URLPATH $ipn_target, string $ipn_message) : string
Useful for making one Composr site (caller site) pretend to be PayPal, when talking to another (target site). Make sure the target site has the caller site listed as the backdoor_ip in the base config, or the verification will happen and fail.
| package | ecommerce |
|---|
\URLPATHURL to send IPN to
stringPost parameters to send, in query string format
stringOutputecommerce_get_currency_symbol(\?ID_TEXT $currency = null) : \ID_TEXT
| package | ecommerce |
|---|
\?ID_TEXTThe currency (null: configured).
\ID_TEXTThe currency symbol.ecommerce_test_mode() : boolean
edit_usergroup_subscription(\AUTO_LINK $id, \SHORT_TEXT $title, \LONG_TEXT $description, \SHORT_TEXT $cost, integer $length, \SHORT_TEXT $length_units, \BINARY $auto_recur, \?GROUP $group_id, \BINARY $uses_primary, \BINARY $enabled, \?LONG_TEXT $mail_start, \?LONG_TEXT $mail_end, \?LONG_TEXT $mail_uhoh, \?array $mails = null)
| package | ecommerce |
|---|---|
| set | y m d w |
\AUTO_LINKThe ID
\SHORT_TEXTThe title
\LONG_TEXTThe description
\SHORT_TEXTThe cost
integerThe length
\SHORT_TEXTThe units for the length
\BINARYAuto-recur
\?GROUPThe usergroup that purchasing gains membership to (null: super members)
\BINARYWhether this is applied to primary usergroup membership
\BINARYWhether this is currently enabled
\?LONG_TEXTThe text of the e-mail to send out when a subscription is start (null: default)
\?LONG_TEXTThe text of the e-mail to send out when a subscription is ended (null: default)
\?LONG_TEXTThe text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
\?arrayOther e-mails to send (null: do not change)
fatal_ipn_exit(string $error, boolean $dont_trigger = false) : mixed
| package | ecommerce |
|---|
stringThe message.
booleanDont trigger an error
mixedNever returns (i.e. exits)find_all_products(boolean $site_lang = false) : array
| package | ecommerce |
|---|
booleanWhether to make sure the language for item_name is the site default language (crucial for when we read/go to third-party sales systems and use the item_name as a key).
arrayA list of maps of product details.find_member_subscriptions(\MEMBER $member_id, boolean $usergroup_subscriptions_only = false) : array
| package | ecommerce |
|---|
\MEMBERThe member.
booleanWhether to limit us to usergroup subscriptions.
arrayA list of subscriptions and subscription lifetime positions.find_product(\ID_TEXT $search, boolean $site_lang= false, boolean $search_item_names= false) : \?object
| package | ecommerce |
|---|
\ID_TEXTThe item name/product_id
booleanWhether to make sure the language for item_name is the site default language (crucial for when we read/go to third-party sales systems and use the item_name as a key).
booleanWhether $search refers to the item name rather than the product codename
\?objectThe product-class object (null: not found).find_product_row(\ID_TEXT $search, boolean $site_lang= false, boolean $search_item_names= false) : array
| package | ecommerce |
|---|
\ID_TEXTThe product codename/item name
booleanWhether to make sure the language for item_name is the site default language (crucial for when we read/go to third-party sales systems and use the item_name as a key).
booleanWhether $search refers to the item name rather than the product codename
arrayA pair: The product-class map, and the formal product name (both will be NULL if not found).get_currency_map() : array
get_currency_symbol(\ID_TEXT $currency) : array
| package | ecommerce |
|---|
\ID_TEXTThe currency.
arrayA pair: The symbol, and whether the symbol is okay to use on it's own (as it is the accepted default for the symbol).get_transaction_fee(float $amount, \ID_TEXT $via) : float
| package | ecommerce |
|---|
floatA transaction amount.
\ID_TEXTThe service the payment went via.
floatThe feeget_transaction_form_fields(\?ID_TEXT $trans_id, \ID_TEXT $purchase_id, \SHORT_TEXT $item_name, \SHORT_TEXT $amount, \?integer $length, \ID_TEXT $length_units, \?ID_TEXT $via = null) : array
| package | ecommerce |
|---|
\?ID_TEXTThe transaction ID (null: auto-generate)
\ID_TEXTThe purchase ID
\SHORT_TEXTThe item name
\SHORT_TEXTThe amount
\?integerThe length (null: not a subscription)
\ID_TEXTThe length units
\?ID_TEXTThe service the payment will go via via (null: autodetect).
arrayA pair: The form fields, Hidden fieldshandle_confirmed_transaction(\ID_TEXT $purchase_id, \SHORT_TEXT $item_name, \ID_TEXT $payment_status, \SHORT_TEXT $reason_code, \SHORT_TEXT $pending_reason, \SHORT_TEXT $memo, \SHORT_TEXT $mc_gross, \SHORT_TEXT $mc_currency, \SHORT_TEXT $txn_id, \SHORT_TEXT $parent_txn_id, string $period, \ID_TEXT $via) : \ID_TEXT
| package | ecommerce |
|---|---|
| set | Pending Completed SModified SCancelled |
\ID_TEXTThe ID of the purchase-type (meaning depends on item_name)
\SHORT_TEXTThe item being purchased (aka the product) (blank: subscription, so we need to look it up). One might wonder why we use $item_name instead of $type_code. This is because we pass human-readable-names (hopefully unique!!!) through payment gateways because they are visually shown to the user. (blank: it's a subscription, so look up via a key map across the subscriptions table)
\ID_TEXTThe status this transaction is telling of
\SHORT_TEXTThe code that gives reason to the status
\SHORT_TEXTThe reason it is in pending status (if it is)
\SHORT_TEXTA note attached to the transaction
\SHORT_TEXTThe amount of money
\SHORT_TEXTThe currency the amount is in
\SHORT_TEXTThe transaction ID
\SHORT_TEXTThe ID of the parent transaction
stringThe subscription period (blank: N/A / unknown: trust is correct on the gateway)
\ID_TEXTThe payment gateway
\ID_TEXTThe product purchasedhandle_transaction_script() : \ID_TEXT
ip_to_currency(\?IP $ip = null) : \ID_TEXT
| package | ecommerce |
|---|
\?IPIP address (null: that of current member).
\ID_TEXTThe currency code.perform_local_payment() : boolean
prepare_templated_subscription(array $subscription) : array
| package | ecommerce |
|---|
arraySubscription details.
arrayTemplate-ready parameters.send_invoice_notification(\MEMBER $member_id, \AUTO_LINK $id)