Search Overlay

Cards

You can integrate your e-commerce application directly to our platform-agnostic Card Payments API and process all major credit cards through the Paysafe payment gateway.

Click the links below to view our code samples.

Verify That the Service Is Accessible

$isOnline = $client->cardPaymentService()->monitor();
                                

Authorize a Card Payment

$response = $client->cardPaymentService()->authorize(new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 555,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'billingDetails' => array(
'zip' => "M5H 2N2"
)
)));

$response = $client->cardPaymentService()->authorize(new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 6666,
'settleWithAuth' => false,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'authentication' => array(
'eci' => 5,
'cavv' => "AAABCIEjYgAAAAAAlCNiENiWiV+=",
'xid' => "OU9rcTRCY1VJTFlDWTFESXFtTHU=",
'threeDEnrollment' => "Y",
'threeDResult' => "Y",
'signatureStatus' => "Y"
),
'billingDetails' => array(
'street' => "100 Queen Street West",
'city' => "Toronto",
'state' => "ON",
'country' => "CA",
'zip' => "M5H 2N2"
),
'shippingDetails' => array(
'carrier' => "UPS",
'shipMethod' => "N",
'street' => "100 Queen Street West",
'city' => "Toronto",
'state' => "ON",
'country' => "CA",
'zip' => "M5H 2N2",
),
'customerIp' => "204.91.0.12",
'description' => "Got U a video"
)));

$response = $client->cardPaymentService()->getAuth(new Authorization(array(
'id' => $authorizationId
)));

$response = $client->cardPaymentService()->getAuths(new Authorization(array(
'merchantRefNum' => $authorizationMerchantRefNum
)));

Process a Card Purchase

$auth = new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 555,
'settleWithAuth' => true,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'billingDetails' => array(
'zip' => "M5H 2N2"
)
));

$response = $client->cardPaymentService()->authorize($auth);

$authReversal = new AuthorizationReversal(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 555,
'authorizationID' => $authorizationId
));

$response = $client->cardPaymentService()->reverseAuth($authReversal);

$authReversal = new AuthorizationReversal(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 222,
'authorizationID' => $authorizationId
));

$response = $client->cardPaymentService()->reverseAuth($authReversal);

$response = $client->cardPaymentService()->getAuthReversal(new AuthorizationReversal(array(
'id' => $authReversalId
)));

$response = $client->cardPaymentService()->getAuthReversals(new AuthorizationReversal(array(
'merchantRefNum' => $authReversalMerchantRefNum
)));

$client->cardPaymentService()->approveHeldAuth(new Authorization(array(
'id' => $authorizationId
)));

$client->cardPaymentService()->cancelHeldAuth(new Authorization(array(
'id' => $authorizationId
)));

Settle a Card Authorization

$response = $client->cardPaymentService()->settlement(new Settlement(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'authorizationID' => $authorizationId
)));

$response = $client->cardPaymentService()->cancelSettlement(new Settlement(array(
'id' => $settlement->id
)));

$response = $client->cardPaymentService()->getSettlement(new Settlement(array(
'id' => $settlement->id
)));

$settlements = $client->cardPaymentService()->getSettlements(new Settlement(array(
'merchantRefNum' => $settlementMerchantRefNum
)));

Process a Card Refund

$response = $client->cardPaymentService()->refund(new Refund(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'settlementID' => $settlement->id
)));

$response = $client->cardPaymentService()->getRefund(new Refund(array(
'id' => $refundId
)));

$refunds = $client->cardPaymentService()->getRefunds(new Refund(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e"
)));

Verify a Card Payment

$response = $client->cardPaymentService()->verify(new Verification(array(
"merchantRefNum" => "0f8fad5bd9cb469fa16570867728950e",
"card" => array(
"cardNum" => "4111111111111111",
"cardExpiry" => array(
"month" => "06",
"year" => "2020",
),
"cvv" => "123"
),
"profile" => array(
"firstName" => "Joe",
"lastName" => "Smith",
"email" => "Joe.Smith@example.com"
),
"billingDetails" => array(
"street" => "100 Queen Street West",
"city" => "Toronto",
"state" => "ON",
"country" => "CA",
"zip" => "M5H2N2"
),
"customerIp" => "204.91.0.12",
"description" => "This is a test transaction"
)));

$response = $client->cardPaymentService()->getVerification(new Verification(array(
'id' => $verificationId
)));

$response = $client->cardPaymentService()->getVerifications(new Verification(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e"
)));