\PayPalPayment
Implementation of Payment that supports PayPal Website Payment Standard (https://www.paypal.com/IntegrationCenter/ic_standard_home.html) as its payment processor
Configure using PayPalPayment::setMyVariable(value);
in www.mysite.com/ecommerce/_config.php file
Must configure:
$setPayPalRealAccount;
$setPayPalTestAccount;
$setPayPalUseTestAccount;
Optionally configure:
$setPayPalImageLocation;
$setPayPalContinueNextButton;
$setPayPalPurchaseName;
$setPayPalCppHeaderImage;
$setPayPalCppHeaderBackcolor;
$setPayPalCppHeaderBordercolor;
$setPayPalCppPayflowColor;
$setPayPalCs;
REQUIREMENTS:
Need to add: "PayPalInstructions" field to CheckoutPage.php
static $db = array(
"PayPalInstructions" => "HTMLText"
);
Have a PayPalPaymentPage.ss template or replace some code below
(search for renderWith). On the PayPalPaymentPage you can use
$PayPalInstructions (see above)
Synopsis
class PayPalPayment
extends Payment
{
- // members
- public static array $db = ;
- protected static string $privacy_link = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=p/gen/ua/policy_privacy-outside';
- protected static string $logo = 'payment/images/payments/paypal.jpg';
- protected static string $url = 'https://www.paypal.com/cgi-bin/webscr';
- protected static string $test_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
- protected static boolean $test_mode = false;
- protected static $test_account_email;
- protected static $account_email;
- protected static $continue_button_text;
- protected static $header_image_url;
- protected static $header_back_color;
- protected static $header_border_color;
- protected static $payflow_color;
- protected static $back_color;
- protected static $image_url;
- protected static $page_style;
- // Inherited members from Payment
- 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;
- // methods
- public static void set_test_mode()
- public static void set_account_email()
- public static void set_continue_button_text()
- public static void set_header_image_url()
- public static void set_header_back_color()
- public static void set_header_border_color()
- public static void set_payflow_color()
- public static void set_back_color_black()
- public static void set_image_url()
- public static void set_page_style()
- public void getPaymentFormFields()
- public void getPaymentFormRequirements()
- public void processPayment()
- public void PayPalForm()
- public void populateDefaults()
- // Inherited methods from Payment
- 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
Members
protected
- $account_email
- $back_color
- $header_back_color
- $header_border_color
- $header_image_url
- $image_url
- $logo
- $page_style
- $payflow_color
- $privacy_link
- $site_currency
—
string
The currency code used for payments. - $supported_methods
—
array
Instances of Payment supported (usable) on this site. - $test_account_email
- $test_mode
- $test_url
- $url
public
-
$create_table_options
Make payment table transactional. - $db
-
$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
- PayPalForm()
- getPaymentFormFields()
- getPaymentFormRequirements()
- populateDefaults()
- processPayment()
- set_account_email()
- set_back_color_black()
- set_header_back_color()
- set_header_border_color()
- set_header_image_url()
- set_image_url()
- set_page_style()
- set_payflow_color()
- set_test_mode()
Inherited from Payment
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.