{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"sdkResponse object","type":"basic","slug":"sdkresponse-object","excerpt":"","body":"The `sdkReponse` object will be passed to your callback function when the data submission to BlueSnap is completed ([Step 4](/v8976-Tools/docs/secured-payment-collector#section-4-initialize-the-secured-payment-collector) of the implementation process). The object contains the results of the data submission.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Property\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description\",\n \"0-0\": \"`status`\",\n \"0-1\": \"String\",\n \"0-2\": \"Status of the data submission. Possible values: \\n\\n* `Success` - The data submission was successful. Finish the form submission to your server and process the transaction. \\n\\n* `Invalid Data` - There was a problem with the data passed to BlueSnap. \\n\\n* `Inner Error` - There was a problem with Secured Payment Collector. \\n\\n* `Server Error` - The BlueSnap server encountered a problem.\",\n \"1-0\": \"`code`\",\n \"1-1\": \"Integer\",\n \"1-2\": \"The status [code](#section-sdkresponse-code) of the data submission.\",\n \"2-0\": \"`info`\",\n \"2-1\": \"Object\",\n \"2-2\": \"This is present if any errors or warnings occurred. Contains: \\n\\n* `errors` - An array of [errors](#section-sdkresponse-info-errors)\\n* `warnings` - An array of [warnings](#section-sdkresponse-info-warnings)\",\n \"3-0\": \"`cardData`\",\n \"3-1\": \"Object\",\n \"3-2\": \"This is only present for card payments and if the data submission was successful (when `sdkResponse.status` is `1`). Contains [these properties](#section-sdkresponse-carddata).\",\n \"4-0\": \"`threeDSecure`\",\n \"4-1\": \"Object\",\n \"4-2\": \"This is present only for card payments and if 3-D Secure was used. Contains [these properties](#section-sdkresponse-threedsecure).\"\n },\n \"cols\": 3,\n \"rows\": 5\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"status\\\": \\\"Status\\\",\\n \\\"code\\\": CODE,\\n \\\"info\\\": { // if an error or warning occurred\\n \\\"errors\\\": ['Some error'],\\n \\\"warnings\\\": ['Some warning']\\n },\\n \\\"cardData\\\": {\\n \\\"binCategory\\\": \\\"CONSUMER\\\",\\n \\\"ccBin\\\": \\\"411111\\\",\\n \\\"cardSubType\\\": \\\"CREDIT\\\",\\n \\\"ccType\\\": \\\"VISA\\\",\\n \\\"last4Digits\\\": \\\"0002\\\",\\n \\\"isRegulatedCard\\\": \\\"Y\\\",\\n \\\"issuingCountry\\\": \\\"us\\\"\\n },\\n \\\"threeDSecure\\\": {\\n \\\"authResult\\\": “AUTHENTICATION_SUCCEEDED”,\\n \\\"threeDSecureReferenceId\\\": \\\"12345\\\"\\n }\\n}\",\n \"language\": \"json\",\n \"name\": \"sdkResponse example\"\n }\n ]\n}\n[/block]\n## sdkResponse.code \nPossible values for `sdkResponse.code`:\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Value\",\n \"h-1\": \"Description\",\n \"0-0\": \"`1`\",\n \"0-1\": \"When `sdkResponse.status` is `Sucess`.\",\n \"1-0\": \"`10`\",\n \"1-1\": \"When `sdkResponse.status` is `Invalid Data` and an error prevents the data submission process from continuing (such as the currency provided is invalid). Check `sdkResponse.info.errors` for error details.\",\n \"2-0\": \"`15`\",\n \"2-1\": \"When `sdkResponse.status` is `Invalid Data` and the warning does not prevent the process from continuing (such as an invalid billing first name). Check `sdkResponse.info.warnings` for warning details.\",\n \"3-0\": \"`20`\",\n \"3-1\": \"When `sdkResponse.status` is `Inner Error`.\",\n \"4-0\": \"Other codes are the BlueSnap server HTTP errors or generic server errors (400, 500). For example:\",\n \"5-0\": \"`22013`\",\n \"5-1\": \"The credit card type is not supported for your configuration.\",\n \"6-0\": \"`14040`\",\n \"6-1\": \"The token is expired. Refresh the page.\",\n \"7-0\": \"`14042`\",\n \"7-1\": \"The token is not associated with a payment method.\",\n \"8-0\": \"`14104`\",\n \"8-1\": \"The shopper's credit card was not found.\",\n \"9-0\": \"3-D Secure error codes\",\n \"9-1\": \"Applicable if 3-D Secure was used. See the [3-D Secure for API guide](/docs/3-d-secure-for-api#section-error-codes) for a list of codes and descriptions.\"\n },\n \"cols\": 2,\n \"rows\": 10\n}\n[/block]\n## sdkResponse.info.errors \nWhen an error occurs, details about the error will be present in `sdkResponse.info.errors`. Errors prevent the data submission process from continuing. \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Error\",\n \"h-1\": \"Description\",\n \"0-0\": \"`Invalid amount: <given_amount>`\",\n \"0-1\": \"An invalid amount was provided.\",\n \"1-0\": \"`Amount is mandatory and must be of type number`\",\n \"1-1\": \"An amount wasn’t provided or provided not as a number.\",\n \"2-0\": \"`Currency <given_currency> is not supported`\",\n \"2-1\": \"The given currency is not supported.\",\n \"3-0\": \"`Currency is mandatory`\",\n \"3-1\": \"An amount wasn’t provided.\",\n \"4-0\": \"`Invalid ccNumber`\",\n \"4-1\": \"The credit card number is invalid.\",\n \"5-0\": \"`Invalid cvv`\",\n \"5-1\": \"The credit card CVV is invalid.\",\n \"6-0\": \"`Invalid expDate`\",\n \"6-1\": \"The credit card expiration date is invalid.\",\n \"7-0\": \"`Invalid ccType`\",\n \"7-1\": \"The credit card type is invalid.\",\n \"8-0\": \"`Invalid last4Digits`\",\n \"8-1\": \"The last 4 digits of the credit card number are invalid.\",\n \"9-0\": \"`Invalid ecpRoutingNumber`\",\n \"9-1\": \"The ECP routing number is invalid.\",\n \"10-0\": \"`Invalid ecpAccountType`\",\n \"10-1\": \"The ECP account type is invalid.\",\n \"11-0\": \"`Invalid ecpAccountNumber`\",\n \"11-1\": \"The ECP account number is invalid.\"\n },\n \"cols\": 2,\n \"rows\": 12\n}\n[/block]\n## sdkResponse.info.warnings\nWhen `sdkResponse.status` is `'Invalid Data'`, details about the warning will be present in `sdkResponse.info.warnings`. Warnings inform you of conditions you might want to address. Unlike errors, warnings do not prevent your data collection or submission process from continuing.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Warning\",\n \"h-1\": \"Description\",\n \"0-0\": \"`Parameter <given_key> with value of <given_value> is invalid`\",\n \"0-1\": \"A parameter value is invalid. Keys verified through this process are email, shipping and billing details.\"\n },\n \"cols\": 2,\n \"rows\": 1\n}\n[/block]\n## sdkResponse.cardData \nIf the card data submission was successful (when `sdkResponse.code` is `1`), non-sensitive payment details will be present in `sdkResponse.cardData`. \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Property\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description\",\n \"1-0\": \"`binCategory`\",\n \"1-1\": \"String\",\n \"1-2\": \"Values can be: BUSINESS, CLASSIC, COMPANY, CONSUMER, CORPORATE, EXECUTIVE, GOLD, PERSONAL, PLATINUM, PREPAID, WORLD, etc.\",\n \"0-0\": \"`ccBin`\",\n \"0-1\": \"String\",\n \"0-2\": \"The first 6 digits of the credit card.\",\n \"2-0\": \"`cardSubType`\",\n \"2-1\": \"String\",\n \"2-2\": \"Values: CREDIT or DEBIT\",\n \"3-0\": \"`ccType`\",\n \"3-1\": \"String\",\n \"3-2\": \"Values can be: VISA, MASTERCARD, AMERICAN EXPRESS, JCB, CHINA UNION PAY, etc.\",\n \"4-0\": \"`last4Digits`\",\n \"4-1\": \"String\",\n \"4-2\": \"The last 4 digits of the credit card.\",\n \"5-0\": \"`isRegulatedCard`\",\n \"5-1\": \"String\",\n \"5-2\": \"Values: Y or N\",\n \"6-0\": \"`issuingCountry`\",\n \"6-1\": \"String\",\n \"6-2\": \"ISO 3166-1 alpha-2 code of the country where the credit card was issued.\"\n },\n \"cols\": 3,\n \"rows\": 7\n}\n[/block]\n## sdkResponse.threeDSecure \nIf 3-D Secure was used, `sdkResponse.threeDSecure` will contain the authorization details. \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Property\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description\",\n \"0-0\": \"`authResult`\",\n \"0-1\": \"String\",\n \"0-2\": \"The 3-D Secure [authorization result](/docs/3-d-secure-for-api#section-authentication-results).\",\n \"1-0\": \"`threeDSecureReferenceId`\",\n \"1-1\": \"String\",\n \"1-2\": \"The 3-D Secure reference ID. To process the transaction with 3-D Secure, this value needs to be included in the API call.\"\n },\n \"cols\": 3,\n \"rows\": 2\n}\n[/block]","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"6019bc72944282005e966fb7","createdAt":"2020-07-27T18:18:51.027Z","user":"5ea72d649148ff00653f6bbc","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Secured Payment Collector","slug":"secured-payment-collector","order":14,"from_sync":false,"reference":false,"_id":"6019bc72944282005e966f71","createdAt":"2020-07-27T16:40:40.187Z","version":"6019bc72944282005e966fd4","project":"57336fd5a6a9c40e00e13a0b","__v":0},"version":{"version":"8976-Tools","version_clean":"8976.0.0-Tools","codename":"Test release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["6019bc72944282005e966f62","6019bc72944282005e966f63","6019bc72944282005e966f64","6019bc72944282005e966f65","6019bc72944282005e966f66","6019bc72944282005e966f67","6019bc72944282005e966f68","6019bc72944282005e966f69","6019bc72944282005e966f6a","6019bc72944282005e966f6b","6019bc72944282005e966f6c","6019bc72944282005e966f6d","5b34c737e0dca2000311de6a","6019bc72944282005e966f6e","6019bc72944282005e966f6f","6019bc72944282005e966f70","6019bc72944282005e966f71","6019bc72944282005e966f72","6019bc72944282005e966f73","6019bc72944282005e966f74"],"_id":"6019bc72944282005e966fd4","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5fa1893ed2a2370028d24282","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":0,"parentDoc":null}
sdkResponse object
The sdkReponse
object will be passed to your callback function when the data submission to BlueSnap is completed (Step 4 of the implementation process). The object contains the results of the data submission.
status
String
Status of the data submission. Possible values:
Success
- The data submission was successful. Finish the form submission to your server and process the transaction.Invalid Data
- There was a problem with the data passed to BlueSnap.Inner Error
- There was a problem with Secured Payment Collector.Server Error
- The BlueSnap server encountered a problem.
info
Object
cardData
Object
This is only present for card payments and if the data submission was successful (when sdkResponse.status
is 1
). Contains these properties.
threeDSecure
Object
This is present only for card payments and if 3-D Secure was used. Contains these properties.
{
"status": "Status",
"code": CODE,
"info": { // if an error or warning occurred
"errors": ['Some error'],
"warnings": ['Some warning']
},
"cardData": {
"binCategory": "CONSUMER",
"ccBin": "411111",
"cardSubType": "CREDIT",
"ccType": "VISA",
"last4Digits": "0002",
"isRegulatedCard": "Y",
"issuingCountry": "us"
},
"threeDSecure": {
"authResult": “AUTHENTICATION_SUCCEEDED”,
"threeDSecureReferenceId": "12345"
}
}
1
When sdkResponse.status
is Sucess
.
10
When sdkResponse.status
is Invalid Data
and an error prevents the data submission process from continuing (such as the currency provided is invalid). Check sdkResponse.info.errors
for error details.
15
When sdkResponse.status
is Invalid Data
and the warning does not prevent the process from continuing (such as an invalid billing first name). Check sdkResponse.info.warnings
for warning details.
20
When sdkResponse.status
is Inner Error
.
Other codes are the BlueSnap server HTTP errors or generic server errors (400, 500). For example:
22013
The credit card type is not supported for your configuration.
14040
The token is expired. Refresh the page.
14042
The token is not associated with a payment method.
14104
The shopper's credit card was not found.
3-D Secure error codes
Applicable if 3-D Secure was used. See the 3-D Secure for API guide for a list of codes and descriptions.
Invalid amount: <given_amount>
An invalid amount was provided.
Amount is mandatory and must be of type number
An amount wasn’t provided or provided not as a number.
Currency <given_currency> is not supported
The given currency is not supported.
Currency is mandatory
An amount wasn’t provided.
Invalid ccNumber
The credit card number is invalid.
Invalid cvv
The credit card CVV is invalid.
Invalid expDate
The credit card expiration date is invalid.
Invalid ccType
The credit card type is invalid.
Invalid last4Digits
The last 4 digits of the credit card number are invalid.
Invalid ecpRoutingNumber
The ECP routing number is invalid.
Invalid ecpAccountType
The ECP account type is invalid.
Invalid ecpAccountNumber
The ECP account number is invalid.
sdkResponse.info.warnings
When sdkResponse.status
is 'Invalid Data'
, details about the warning will be present in sdkResponse.info.warnings
. Warnings inform you of conditions you might want to address. Unlike errors, warnings do not prevent your data collection or submission process from continuing.
Parameter <given_key> with value of <given_value> is invalid
A parameter value is invalid. Keys verified through this process are email, shipping and billing details.
ccBin
String
The first 6 digits of the credit card.
binCategory
String
Values can be: BUSINESS, CLASSIC, COMPANY, CONSUMER, CORPORATE, EXECUTIVE, GOLD, PERSONAL, PLATINUM, PREPAID, WORLD, etc.
cardSubType
String
Values: CREDIT or DEBIT
ccType
String
Values can be: VISA, MASTERCARD, AMERICAN EXPRESS, JCB, CHINA UNION PAY, etc.
last4Digits
String
The last 4 digits of the credit card.
isRegulatedCard
String
Values: Y or N
issuingCountry
String
ISO 3166-1 alpha-2 code of the country where the credit card was issued.
threeDSecureReferenceId
String
The 3-D Secure reference ID. To process the transaction with 3-D Secure, this value needs to be included in the API call.