add_usergroup_subscription (line 572)
Add a usergroup subscription.
AUTO_LINK
add_usergroup_subscription
(SHORT_TEXT $title, LONG_TEXT $description, SHORT_TEXT $cost, integer $length, SHORT_TEXT $length_units, ?GROUP $group_id, BINARY $uses_primary, BINARY $enabled, ?LONG_TEXT $mail_start, ?LONG_TEXT $mail_end, ?LONG_TEXT $mail_uhoh)
-
SHORT_TEXT
$title: The title
-
LONG_TEXT
$description: The description
-
SHORT_TEXT
$cost: The cost
-
integer
$length: The length
-
SHORT_TEXT
$length_units: The units for the length
-
?GROUP
$group_id: The usergroup that purchasing gains membership to (NULL: super members)
-
BINARY
$uses_primary: Whether this is applied to primary usergroup membership
-
BINARY
$enabled: Whether this is currently enabled
-
?LONG_TEXT
$mail_start: The text of the e-mail to send out when a subscription is start (NULL: default)
-
?LONG_TEXT
$mail_end: The text of the e-mail to send out when a subscription is ended (NULL: default)
-
?LONG_TEXT
$mail_uhoh: The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (NULL: default)
delete_usergroup_subscription (line 677)
Delete a usergroup subscription.
void
delete_usergroup_subscription
(AUTO_LINK $id, LONG_TEXT $uhoh_mail)
-
AUTO_LINK
$id: The ID
-
LONG_TEXT
$uhoh_mail: The cancellation mail to send out
ecommerce_get_currency_symbol (line 52)
Get the symbol of the currency we're trading in.
ID_TEXT
ecommerce_get_currency_symbol
()
ecommerce_test_mode (line 42)
Check whether the system is in test mode (normally, not).
boolean
ecommerce_test_mode
()
edit_usergroup_subscription (line 615)
Edit a usergroup subscription.
void
edit_usergroup_subscription
(AUTO_LINK $id, SHORT_TEXT $title, LONG_TEXT $description, SHORT_TEXT $cost, integer $length, SHORT_TEXT $length_units, ?GROUP $group_id, BINARY $uses_primary, BINARY $enabled, ?LONG_TEXT $mail_start, ?LONG_TEXT $mail_end, ?LONG_TEXT $mail_uhoh)
-
AUTO_LINK
$id: The ID
-
SHORT_TEXT
$title: The title
-
LONG_TEXT
$description: The description
-
SHORT_TEXT
$cost: The cost
-
integer
$length: The length
-
SHORT_TEXT
$length_units: The units for the length
-
?GROUP
$group_id: The usergroup that purchasing gains membership to (NULL: super members)
-
BINARY
$uses_primary: Whether this is applied to primary usergroup membership
-
BINARY
$enabled: Whether this is currently enabled
-
?LONG_TEXT
$mail_start: The text of the e-mail to send out when a subscription is start (NULL: default)
-
?LONG_TEXT
$mail_end: The text of the e-mail to send out when a subscription is ended (NULL: default)
-
?LONG_TEXT
$mail_uhoh: The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (NULL: default)
find_all_products (line 234)
Find all products, except ones from hooks that might have too many to list (so don't rely on this for important backend tasks).
array
find_all_products
([boolean $site_lang = false])
-
boolean
$site_lang: 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).
find_product (line 265)
Find product.
?object
find_product
(ID_TEXT $search, [boolean $site_lang = false], [boolean $search_titles_not_ids = false])
-
ID_TEXT
$search: The product name/product_id
-
boolean
$site_lang: 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
$search_titles_not_ids: Whether $search refers to the product name rather than the product_id
find_product_row (line 301)
Find product info row.
?array
find_product_row
(ID_TEXT $search, [boolean $site_lang = false], [boolean $search_titles_not_ids = false])
-
ID_TEXT
$search: The product name/product_id
-
boolean
$site_lang: 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
$search_titles_not_ids: Whether $search refers to the product name rather than the product_id
get_transaction_fee (line 140)
Find a transaction fee from a transaction amount. Regular fees aren't taken into account.
float
get_transaction_fee
(float $amount, ID_TEXT $via)
-
float
$amount: A transaction amount.
-
ID_TEXT
$via: The service the payment went via.
get_transaction_form_fields (line 83)
Find a transaction fee from a transaction amount. Regular fees aren't taken into account.
tempcode
get_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
$trans_id: The transaction ID (NULL: auto-generate)
-
ID_TEXT
$purchase_id: The purchase ID
-
SHORT_TEXT
$item_name: The item name
-
SHORT_TEXT
$amount: The amount
-
?integer
$length: The length (NULL: not a subscription)
-
ID_TEXT
$length_units: The length units
handle_confirmed_transaction (line 397)
Handle IPN's that have been confirmed as backed up by real money.
void
handle_confirmed_transaction
(ID_TEXT $purchase_id, SHORT_TEXT $item_name, SHORT_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, [ID_TEXT $source = ''], [string $period = ''])
-
ID_TEXT
$purchase_id: The ID of the purchase-type (meaning depends on item_name)
-
SHORT_TEXT
$item_name: The item being purchased (aka the product) (blank: subscription, so we need to look it up)
-
SHORT_TEXT
$payment_status: The status this transaction is telling of
-
SHORT_TEXT
$reason_code: The code that gives reason to the status
-
SHORT_TEXT
$pending_reason: The reason it is in pending status (if it is)
-
SHORT_TEXT
$memo: A note attached to the transaction
-
SHORT_TEXT
$mc_gross: The amount of money
-
SHORT_TEXT
$mc_currency: The currency the amount is in
-
SHORT_TEXT
$txn_id: The transaction ID
-
SHORT_TEXT
$parent_txn_id: The ID of the parent transaction
-
ID_TEXT
$source: The ID of a special source for the transaction
-
string
$period: The subscription period (blank: N/A)
handle_transaction_script (line 348)
Handle IPN's.
void
handle_transaction_script
()
init__ecommerce (line 24)
Standard code module initialisation function.
void
init__ecommerce
()
make_cancel_button (line 203)
Make a subscription cancellation button.
?tempcode
make_cancel_button
(AUTO_LINK $purchase_id, ID_TEXT $via)
-
AUTO_LINK
$purchase_id: The purchase ID.
-
ID_TEXT
$via: The service the payment will go via via.
make_cart_payment_button (line 737)
Make a shopping cart payment button.
tempcode
make_cart_payment_button
(AUTO_LINK $order_id, ID_TEXT $currency)
-
AUTO_LINK
$order_id: Order Id
-
ID_TEXT
$currency: The currency to use.
make_subscription_button (line 188)
Make a subscription (payment) button.
tempcode
make_subscription_button
(ID_TEXT $product, SHORT_TEXT $item_name, ID_TEXT $purchase_id, float $amount, integer $length, ID_TEXT $length_units, ID_TEXT $currency, [?ID_TEXT $via = NULL])
-
ID_TEXT
$product: The product codename.
-
SHORT_TEXT
$item_name: The human-readable product title.
-
ID_TEXT
$purchase_id: The purchase ID.
-
float
$amount: A transaction amount.
-
integer
$length: The subscription length in the units.
-
ID_TEXT
$length_units: The length units.
-
ID_TEXT
$currency: The currency to use.
-
?ID_TEXT
$via: The service the payment will go via via (NULL: autodetect).
make_transaction_button (line 166)
Make a transaction (payment) button.
tempcode
make_transaction_button
(ID_TEXT $product, SHORT_TEXT $item_name, ID_TEXT $purchase_id, float $amount, ID_TEXT $currency, [?ID_TEXT $via = NULL])
-
ID_TEXT
$product: The product codename.
-
SHORT_TEXT
$item_name: The human-readable product title.
-
ID_TEXT
$purchase_id: The purchase ID.
-
float
$amount: A transaction amount.
-
ID_TEXT
$currency: The currency to use.
-
?ID_TEXT
$via: The service the payment will go via via (NULL: autodetect).
my_exit (line 548)
Exit ocPortal and write to the error log file.
void
my_exit
(string $error, [boolean $dont_trigger = false])
-
string
$error: The message.
-
boolean
$dont_trigger: Dont trigger an error
notify_service_paid_for (line 531)
Notify the user that a service has been paid for (invoice-linked).
void
notify_service_paid_for
(ID_TEXT $id, array $details, ID_TEXT $product, [boolean $termination = false])
-
ID_TEXT
$id: The ID of the invoice.
-
array
$details: The details of the service (well, proper terminology is 'product').
-
ID_TEXT
$product: The product.
-
boolean
$termination: Whether this is a subscription being cancelled.
perform_local_payment (line 337)
Find whether local payment will be performed.
boolean
perform_local_payment
()
send_invoice_mail (line 218)
Send an invoice notification to a member.
void
send_invoice_mail
(MEMBER $member_id)
-
MEMBER
$member_id: The member to send to.