Card Payments API

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

Process an authorization
$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"
     )
)));
Process a complex authorization
$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"
)));
Look up an authorization using an authorization ID
$response = $client->cardPaymentService()->getAuth(new Authorization(array(
     'id' => $authorizationId
)));
Look up an authorization using a merchant reference number
$response = $client->cardPaymentService()->getAuths(new Authorization(array(
     'merchantRefNum' => $authorizationMerchantRefNum
)));

Process a Card Purchase

Process a 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);
Void (reverse) an authorization
$authReversal = new AuthorizationReversal(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
     'amount' => 555,
     'authorizationID' => $authorizationId
));

$response = $client->cardPaymentService()->reverseAuth($authReversal);
Process a partial void (partial reversal)
$authReversal = new AuthorizationReversal(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
     'amount' => 222,
     'authorizationID' => $authorizationId
));

$response = $client->cardPaymentService()->reverseAuth($authReversal);
Look up a void (reversal) using an void ID (authorization reversal ID)
$response = $client->cardPaymentService()->getAuthReversal(new AuthorizationReversal(array(
     'id' => $authReversalId
)));
Look up a void (reversal) using a merchant reference number
$response = $client->cardPaymentService()->getAuthReversals(new AuthorizationReversal(array(
     'merchantRefNum' => $authReversalMerchantRefNum
)));
Approve a held authorization
$client->cardPaymentService()->approveHeldAuth(new Authorization(array(
     'id' => $authorizationId
)));
Cancel a held authorization
$client->cardPaymentService()->cancelHeldAuth(new Authorization(array(
     'id' => $authorizationId
)));

Settle a Card Authorization

Settle an authorization
$response = $client->cardPaymentService()->settlement(new Settlement(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
     'authorizationID' => $authorizationId
)));
Cancel a settlement
$response = $client->cardPaymentService()->cancelSettlement(new Settlement(array(
     'id' => $settlement->id
)));
Look up a settlement using a settlement ID
$response = $client->cardPaymentService()->getSettlement(new Settlement(array(
     'id' => $settlement->id
)));
Look up a settlement using a merchant reference number
$settlements = $client->cardPaymentService()->getSettlements(new Settlement(array(
     'merchantRefNum' => $settlementMerchantRefNum
)));

Process a Card Refund

Process a refund
$response = $client->cardPaymentService()->refund(new Refund(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
     'settlementID' => $settlement->id
)));
Look up a refund using a refund ID
$response = $client->cardPaymentService()->getRefund(new Refund(array(
     'id' => $refundId
)));
Look up a refund using a merchant reference number
$refunds = $client->cardPaymentService()->getRefunds(new Refund(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e"
)));

Verify a Card Payment

Verify card and billing details
$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"
)));
Look up a verification using a verification ID
$response = $client->cardPaymentService()->getVerification(new Verification(array(
     'id' => $verificationId
)));
Look up a verification using a merchant reference number
$response = $client->cardPaymentService()->getVerifications(new Verification(array(
     'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e"
)));
Did you find this page useful?