Search Overlay

Exceptions

Les API Paysafe permettent de demander certaines exceptions, p. ex. des identifiants non valides, garantissant ainsi la fiabilité du traitement des paiements.

Cliquez sur les liens ci-dessous pour voir nos exemples de code.

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

$client->cardPaymentService()->authorize(new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 4, //The bank has requested that you process the transaction manually by calling the card holder's credit card company.
'settleWithAuth' => false,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'billingDetails' => array(
'zip' => "M5H 2N2"
)
)));

$invalidClient = new OptimalApiClient(1234, 5678, Environment::TEST, 12345);
$invalidclient->cardPaymentService()->getAuth(new Authorization(array(
'id' => 1234567890
)));

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

$auth = new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 10,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
));

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

$client->cardPaymentService()->authorize(new Authorization(array(
'merchantRefNum' => "0f8fad5bd9cb469fa16570867728950e",
'amount' => 6, //Clearing house timeout (although the simulator returns immediately; if delay is desired, see amount 96).
'settleWithAuth' => false,
'card' => array(
'cardNum' => "4111111111111111",
'cvv' => '123',
'cardExpiry' => array(
'month' => "06",
'year' => "2020",
)
),
'billingDetails' => array(
'zip' => "M5H 2N2"
)
)));
Sur cette page