Adding Digital Wallet Data to the Customer Vault

Adding Digital Wallet Data to the Customer Vault

When a customer pays with Apple Pay or Google Pay, you can store the resulting token in the Customer Vault for future use — enabling one-click checkout and recurring billing.

Frontend Setup

CollectJS.configure({
  googlePay: true, applePay: true,
  paymentRequest: {
    total: { label: 'Your Order', amount: { currency: 'USD', value: '29.99' } },
  },
  callback: function(token) {
    submitWithVaultStorage(token.token, token.wallet);
  },
});

Backend — Process and Store

$post = array(
    'security_key'      => YOUR_PRIVATE_KEY,
    'type'              => 'sale',
    'amount'            => '29.99',
    'payment_token'     => $payment_token,
    'customer_vault'    => 'add_customer',
    'customer_vault_id' => 'CUST-' . $user_id,
    'email'             => $email,
);
$result = gateway_post($post);
$vault_id = $result['customer_vault_id'];

Future Charges

$post = array(
    'security_key'      => YOUR_PRIVATE_KEY,
    'type'              => 'sale',
    'amount'            => '29.99',
    'customer_vault_id' => 'CUST-' . $user_id,
);

Take Your Business to the Next Level

Find out how our innovative payment solutions can benefit your business. Reach out to us for more information or to get started!

Let's Get Started