Checkout Denied
HTTP Method: POST
Endpoint: /api/checkout_denied
Alert that a checkout was denied authorization.
Refer to the Checkout section for details on building the model
and constructing individual fields.
In addition to all required Checkout fields, please make sure you fill out the Authorization Error object within the Payment Details section.
Parameters
checkout:
A checkout to alert as denied.
AuthorizationError authorizationError = new AuthorizationError(AuthorizationErrorType.expiredCard, new Date(114, 01, 10, 11, 00, 00));
authorizationError.setMessage("expired credit card.");
CreditCardPaymentDetails creditCardPaymentDetails = new CreditCardPaymentDetails("123456", "full", "m", "4242", "VISA");
creditCardPaymentDetails.setAuthorizationError(authorizationError);
CheckoutDeniedOrder checkoutDeniedOrder = new CheckoutDeniedOrder("cd12345");
checkoutDeniedOrder.setPaymentDetails(Array.asList(creditCardPaymentDetails));
RiskifiedClient client = new RiskifiedClient();
Response res = client.checkoutDeniedOrder(checkoutDeniedOrder);
var authorizationError = new AuthorizationError(
createdAt: new DateTime(2013, 12, 8, 14, 12, 12, DateTimeKind.Local),
errorCode: AuthorizationErrorCode.CardDeclined,
message: "Card was Declined.");
var payment = new CreditCardPaymentDetails(
avsResultCode: "Y",
cvvResultCode: "n",
creditCardBin: "123456",
creditCardCompany: "Visa",
creditCardNumber: "XXXX-XXXX-XXXX-4242",
creditCardToken: "2233445566778899");
payment.AuthorizationError = authorizationError;
var payments = new [] {
payment
}
var orderCheckoutDenied = new OrderCheckoutDenied(orderNum.ToString());
orderCheckoutDenied.PaymentDetails = payments;
OrdersGateway gateway = new OrdersGateway(RiskifiedEnvironment.Sandbox, "authToken", "domain");
OrderNotification notification = gateway.CheckoutDenied(orderCheckoutDenied);
$checkout = new Model\Checkout(...);
$checkout->payment_details = array(new Model\PaymentDetails(array(
'credit_card_bin' => '123456',
'credit_card_number' => 'xxxx-xxxx-xxxx-4242',
'credit_card_company' => 'VISA',
'credit_card_token' => '0022334466',
'authorization_error' => new Model\AuthorizationError(array(
'created_at' => '2008-01-10T11:00:00-05:00',
'error_code' => 'card_rejected'
))
)));
$transport = new Transport\CurlTransport(new Signature\HttpDataSignature());
$response = $transport->deniedCheckout($checkout);
{
"checkout": {
"id": "checkout_id",
"payment_details": [
{
"authorization_error": {
"created_at": "2008-01-10T11:00:00-05:00",
"error_code": "card_declined",
"message": "Card was denied."
},
"avs_result_code": "Y",
"credit_card_bin": "123456",
"credit_card_company": "Visa",
"credit_card_number": "XXXX-XXXX-XXXX-4242",
"cvv_result_code": "M"
}
],
"email": "bob.norman@hostmail.com",
"created_at": "2018-06-15T11:00:00-05:00",
"currency": "USD",
"updated_at": "2018-06-15T11:00:00-05:00",
"gateway": "authorize_net",
"browser_ip": "111.111.111.111",
"total_price": 319.00,
"total_discounts": 10.00,
"cart_token": "68778783ad298f1c80c3bafcddeea02f",
"referring_site": "google.com",
"line_items": [
{
"price": 329.00,
"quantity": 1,
"title": "Apple Watch Series 3 GPS, 38mm Silver Aluminum Case with Fog Sport Band",
"product_id": "632910392",
"category": "electronics",
"brand": "apple",
"product_type": "physical"
}
],
"discount_codes": [
{
"amount": 10.00,
"code": "TENOFF"
}
],
"shipping_lines": [
{
"price": 0.00,
"title": "Free Shipping"
}
],
"customer": {
"email": "bob.norman@hostmail.com",
"verified_email": true,
"first_name": "Bob",
"last_name": "Norman",
"id": "207119551",
"created_at": "2013-04-23T13:36:50-04:00"
},
"billing_address": {
"first_name": "Bob",
"last_name": "Norman",
"address1": "Chestnut Street 92",
"country": "United States",
"country_code": "US",
"phone": "555-625-1199",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"zip": "40202"
},
"shipping_address": {
"first_name": "Bob",
"last_name": "Norman",
"address1": "Chestnut Street 92",
"country": "United States",
"country_code": "US",
"phone": "555-625-1199",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"zip": "40202"
},
"source": "desktop_web",
"client_details": {
"accept_language": "en-CA",
"user_agent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
}
}
}