\EcommercePayment_Stripe
"Abstract" class for a number of different payment types allowing a user to pay for something on a site.
This can't be an abstract class because sapphire doesn't
support abstract DataObject classes.
Synopsis
class EcommercePayment_Stripe
extends EcommercePayment
{
- // members
- private static string $api_key_public = "";
- private static string $api_key_private = "";
- private static String $stripe_logo_and_link = ' <div>Stripe Logos go here...</div> ';
- private static String $is_test = "yes";
- private static string $is_live = "no";
- private static array $db = ;
- private static array $casting = ;
- private static array $indexes = ;
- protected Order $_processing_order = NULL;
- protected integer $_processing_amount = 0;
- protected integer $_processing_currency = 0;
- protected integer $_processing_year = 0;
- protected integer $_processing_month = 0;
- protected string $_processing_statement_description = "";
- protected array $_processing_metadata = ;
- // methods
- public void getCMSFields()
- public FieldList getPaymentFormFields()
- public array getPaymentFormRequirements()
- public Boolean validatePayment()
- public EcommercePaymentResult processPayment()
- public string getRequestDetails()
- public string myResponseDetails()
- protected void retrieveVariables()
- protected void instantiateAPI()
- protected void removeCardDetails()
- protected boolean hasFullCardNumber()
- protected void recordTransaction()
Hierarchy
Extends
- EcommercePayment
Members
private
- $api_key_private — string
- $api_key_public — string
- $casting
-
$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 - $indexes
- $is_live
—
boolean
we use yes / no as this is more reliable than a boolean value for configs - $is_test
—
String
we use yes / no as this is more reliable than a boolean value for configs - $stripe_logo_and_link
—
String
set the required privacy link as you see fit...
protected
- $_processing_amount — float
- $_processing_currency — string
- $_processing_metadata — array
- $_processing_month — int
- $_processing_order — Order
- $_processing_statement_description — string
- $_processing_year — int
Methods
protected
- hasFullCardNumber() — is the full credit card recorded?
- instantiateAPI()
- recordTransaction()
- removeCardDetails() — remove the card details for securityu reasons
- retrieveVariables()
public
- getCMSFields()
- 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.
- getRequestDetails()
- myResponseDetails()
- 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.
- validatePayment() — returns true if all the data is correct.