Hosted Checkout — Advanced Integration
Pre-Populating Customer Data
$post = array(
'security_key' => YOUR_PRIVATE_KEY,
'type' => 'sale',
'amount' => '49.99',
'firstname' => 'John',
'lastname' => 'Smith',
'email' => 'john@example.com',
'address1' => '123 Main St',
'city' => 'Miami',
'state' => 'FL',
'zip' => '33101',
'country' => 'US',
'order_id' => 'ORDER-789',
);
Recurring Billing via Hosted Checkout
$post = array(
'security_key' => YOUR_PRIVATE_KEY,
'type' => 'sale',
'amount' => '9.99',
'recurring' => 'add_subscription',
'plan_payments' => '0', // 0 = indefinite
'plan_amount' => '9.99',
'month_frequency' => '1',
'day_of_month' => '1',
'start_date' => date('Y-m-d', strtotime('+1 month')),
);
Storing to Customer Vault
$post['customer_vault'] = 'add_customer';
$post['customer_vault_id'] = 'CUST-' . $user_id; // Optional custom ID
Key Notification Response Fields
| Field | Description |
|---|---|
response | 1=Approved, 2=Declined, 3=Error |
transactionid | Unique gateway transaction ID |
authcode | Card network authorization code |
avsresponse | Address verification result |
cvvresponse | CVV verification result |
amount | Transaction amount charged |
order_id | Your order ID (echoed back) |
Always validate that
transactionid matches a pending order in your system and verify the amount before fulfilling any order.