\DPSHostedPayment
Step-by-Step: 1. Send XML transaction request (GenerateRequest) to PaymentExpress => DPSHostedPaymentForm->doPay() => DPSHostedPayment->prepareRequest() => DPSHostedPayment->processPayment() 2. Receive XML response (Request) with the URI element (encrypted URL), which you use to redirect the user to PaymentExpress so they can enter their card details 3. Cardholder enters their details and transaction is sent to your bank for authorisation. The response is given and they are redirected back to your site with the response 4. You take the "Request" parameter (encrypted URL response) in the URL string and use this in the "Response" element, to send the response request (ProcessResponse) to PaymentExpress to decrypt and receive the XML response back.
5. Receive XML response (Response) with the authorised result of the transaction.
=> DPSHostedPayment_Controller->processResponse()
Synopsis
class DPSHostedPayment
extends DataObject
{
- // members
- public static string $payment_form_class = 'DPSHostedPaymentForm';
- public static string $pxAccess_Url = "https://www.paymentexpress.com/pxpay/pxpay.aspx";
- private static $pxAccess_Userid;
- private static $pxAccess_Key;
- private static $mac_Key;
- public static string $pxPay_Url = "https://www.paymentexpress.com/pxpay/pxaccess.aspx";
- private static $pxPay_Userid;
- private static $pxPay_Key;
- public static string $px_currency = 'NZD';
- public static $px_merchantreference = NULL;
- public static array $db = ;
- public static array $has_one = ;
- // methods
- public static void set_px_access_userid()
- public static void get_px_access_userid()
- public static void set_px_access_key()
- public static void get_px_access_key()
- public static void set_mac_key()
- public static void get_mac_key()
- public static void set_px_pay_userid()
- public static void get_px_pay_userid()
- public static void set_px_pay_key()
- public static void get_px_pay_key()
- public static void generate_txn_id()
- public void processPayment()
- protected PxPayRequest prepareRequest()
- public void setClientIP()
Hierarchy
Extends
- DataObject
Members
private
- $mac_Key
- $pxAccess_Key
- $pxAccess_Userid
- $pxPay_Key
- $pxPay_Userid
public
- $db
- $has_one
- $payment_form_class
- $pxAccess_Url
- $pxPay_Url
- $px_currency
- $px_merchantreference — string
Methods
protected
- prepareRequest() — Generate a {@link PxPayRequest} object and populate it with the submitted data from a {@link DPSHostedPaymentForm} instance. You'll likely need to subclass this method to add custom data.
public
- generate_txn_id()
- get_mac_key()
- get_px_access_key()
- get_px_access_userid()
- get_px_pay_key()
- get_px_pay_userid()
- processPayment() — Executed in form submission *before* anything goes out to DPS.
- setClientIP() — Set the IP address and Proxy IP (if available) from the site visitor.
- set_mac_key()
- set_px_access_key()
- set_px_access_userid()
- set_px_pay_key()
- set_px_pay_userid()