Secure Remote Commerce
Server-Side Implementation
Vaulting SRC
Your customer's SRC card selection can be saved to your Vault and reused for future transactions, just like a credit card.
Collect device data from the client and include the deviceDataFromTheClient
in the transaction.
- PHP
$result = $gateway->paymentMethod()->create([
'customerId' => '12345',
'paymentMethodNonce' => nonceFromTheClient
]);
You can also save the customer's SRC card to your Vault at the same time as your transaction by using Transaction: Sale
with Options.StoreInVault
or Options.StoreInVaultOnSuccess
.
Creating transactions
Creating a SRC transaction is the same as creating any other transaction with a nonce:
- PHP
$result = $gateway->transaction()->sale([
'amount' => '10.00',
'paymentMethodNonce' => $nonceFromTheClient,
'deviceData' => $deviceDataFromTheClient,
'options' => [
'submitForSettlement' => True
]
]);
if ($result->success) {
// See $result->transaction for details
} else {
// Handle errors
}
Next Page: Testing and Go Live →