\Payment
"Abstract" class for a number of different payment types allowing a user to pay for something on a site.
Synopsis
class Payment
extends DataObject
{
- // members
- public static array $db = ;
- public static array $has_one = ;
- protected static array $supported_methods = ;
- public static array $create_table_options = ;
- protected static string $site_currency = 'USD';
- // methods
- public static void set_site_currency()
- public static string site_currency()
- public static void set_supported_methods()
- public static array get_supported_methods()
- public void populateDefaults()
- public void setClientIP()
- public string PaymentMethod()
- public static FieldSet combined_form_fields()
- public static An combined_form_requirements()
- public FieldSet getPaymentFormFields()
- public array getPaymentFormRequirements()
- public void processPayment()
- public void getForm()
- public void payAsRecurring()
- public void handleError()
- public void PaidObject()
Hierarchy
Extends
- DataObject
Members
protected
- $site_currency
—
string
The currency code used for payments. - $supported_methods
—
array
Instances of Payment supported (usable) on this site.
public
-
$create_table_options
Make payment table transactional. -
$db
Incomplete (default): Payment created but nothing confirmed as successful Success: Payment successful Failure: Payment failed during process Pending: Payment awaiting receipt/bank transfer etc - $has_one
Methods
public
- PaidObject()
- PaymentMethod() — Returns the Payment type currently in use.
- combined_form_fields() — Return a set of payment fields from all enabled payment methods for this site, given the . {@link Payment::set_supported_methods()} is used to define which methods are available.
- combined_form_requirements() — Return the form requirements for all the payment methods.
- getForm()
- getPaymentFormFields() — Return the payment form fields that should be shown on the checkout order form for the payment type. Example: for {@link DPSPayment}, this would be a set of fields to enter your credit card details.
- getPaymentFormRequirements() — Define what fields defined in {@link Order->getPaymentFormFields()} should be required.
- get_supported_methods()
- handleError()
- payAsRecurring()
- populateDefaults()
- processPayment() — Perform payment processing for the type of payment. For example, if this was a credit card payment type, you would perform the data send off to the payment gateway on this function for your payment subclass.
- setClientIP() — Set the IP address of the user to this payment record.
- set_site_currency() — Set the currency code that this site uses.
- set_supported_methods() — Set the payment types that this site supports.
- site_currency() — Return the site currency in use.