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_TEXT
The title
\LONG_TEXT
The description
\SHORT_TEXT
The cost
integer
The length
\SHORT_TEXT
The units for the length
\BINARY
Auto-recur
\?GROUP
The usergroup that purchasing gains membership to (null: super members)
\BINARY
Whether this is applied to primary usergroup membership
\BINARY
Whether this is currently enabled
\?LONG_TEXT
The text of the e-mail to send out when a subscription is start (null: default)
\?LONG_TEXT
The text of the e-mail to send out when a subscription is ended (null: default)
\?LONG_TEXT
The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
array
Other e-mails to send
\AUTO_LINK
The 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 |
---|
mixed
The starting amount (integer or float).
\ID_TEXT
The start currency code.
\?ID_TEXT
The end currency code (null: unknown, guess it).
boolean
Whether to get as a string.
\?mixed
The 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_LINK
The ID
\LONG_TEXT
The 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 |
---|
\URLPATH
URL to send IPN to
string
Post parameters to send, in query string format
string
Outputecommerce_get_currency_symbol(\?ID_TEXT $currency = null
) : \ID_TEXT
package | ecommerce |
---|
\?ID_TEXT
The currency (null: configured).
\ID_TEXT
The 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_LINK
The ID
\SHORT_TEXT
The title
\LONG_TEXT
The description
\SHORT_TEXT
The cost
integer
The length
\SHORT_TEXT
The units for the length
\BINARY
Auto-recur
\?GROUP
The usergroup that purchasing gains membership to (null: super members)
\BINARY
Whether this is applied to primary usergroup membership
\BINARY
Whether this is currently enabled
\?LONG_TEXT
The text of the e-mail to send out when a subscription is start (null: default)
\?LONG_TEXT
The text of the e-mail to send out when a subscription is ended (null: default)
\?LONG_TEXT
The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
\?array
Other e-mails to send (null: do not change)
fatal_ipn_exit(string $error, boolean $dont_trigger = false
) : mixed
package | ecommerce |
---|
string
The message.
boolean
Dont trigger an error
mixed
Never returns (i.e. exits)find_all_products(boolean $site_lang = false
) : array
package | ecommerce |
---|
boolean
Whether 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).
array
A list of maps of product details.find_member_subscriptions(\MEMBER $member_id, boolean $usergroup_subscriptions_only = false
) : array
package | ecommerce |
---|
\MEMBER
The member.
boolean
Whether to limit us to usergroup subscriptions.
array
A 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_TEXT
The item name/product_id
boolean
Whether 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).
boolean
Whether $search refers to the item name rather than the product codename
\?object
The 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_TEXT
The product codename/item name
boolean
Whether 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).
boolean
Whether $search refers to the item name rather than the product codename
array
A 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_TEXT
The currency.
array
A 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 |
---|
float
A transaction amount.
\ID_TEXT
The service the payment went via.
float
The 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_TEXT
The transaction ID (null: auto-generate)
\ID_TEXT
The purchase ID
\SHORT_TEXT
The item name
\SHORT_TEXT
The amount
\?integer
The length (null: not a subscription)
\ID_TEXT
The length units
\?ID_TEXT
The service the payment will go via via (null: autodetect).
array
A 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_TEXT
The ID of the purchase-type (meaning depends on item_name)
\SHORT_TEXT
The 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_TEXT
The status this transaction is telling of
\SHORT_TEXT
The code that gives reason to the status
\SHORT_TEXT
The reason it is in pending status (if it is)
\SHORT_TEXT
A note attached to the transaction
\SHORT_TEXT
The amount of money
\SHORT_TEXT
The currency the amount is in
\SHORT_TEXT
The transaction ID
\SHORT_TEXT
The ID of the parent transaction
string
The subscription period (blank: N/A / unknown: trust is correct on the gateway)
\ID_TEXT
The payment gateway
\ID_TEXT
The product purchasedhandle_transaction_script() : \ID_TEXT
ip_to_currency(\?IP $ip = null
) : \ID_TEXT
package | ecommerce |
---|
\?IP
IP address (null: that of current member).
\ID_TEXT
The currency code.perform_local_payment() : boolean
prepare_templated_subscription(array $subscription) : array
package | ecommerce |
---|
array
Subscription details.
array
Template-ready parameters.send_invoice_notification(\MEMBER $member_id, \AUTO_LINK $id)