Charge request
Acquirers might apply various scenarios and transaction flows to process card payments for your billing scheme. This would make you implement different request types if you work with several acquirers or change your acquiring partner.
Demo PSP suggests using a single charge request which unifies the process of handling payments by saved card details.
When the Demo PSP system receives the charge request, it automatically modifies this request either to a payment or to an authorization operation. It depends on what transaction flow is supported by your acquirer which will process a payment. Moreover, if the charge request is modified to the authorization request, Demo PSP automatically sends the capture request.
In the back office the charge request is reported according to the type of the processed transaction, i.e. either as a payment or as an authorization and a capture.
Request
Send the POST request to https://demo-gateway.begateway.com/services/credit_cards/charges with the following parameters:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example of the request
{
"request": {
"amount": 100,
"currency": "USD",
"description": "Test transaction",
"tracking_id": "tracking_id_000",
"credit_card": {
"number": "5204240000015003",
"verification_value": "123",
"holder": "John Doe",
"exp_month": "10",
"exp_year": 2028
},
"additional_data": {
"browser": {
"screen_width": 1920,
"screen_height": 1080,
"screen_color_depth": 24,
"language": "en",
"java_enabled": false,
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36",
"time_zone": -180,
"time_zone_name": "Europe/Helskinki",
"accept_header": "*/*",
"window_height": 667,
"window_width": 600
},
"referer": "https://example.com/server/cs_post/post.php?order_id=5304380&security=949247¤cy=USD"
},
"three_d_secure": {
"advanced": false
},
"test": true
}
}
Response
The parameters of the response correspond to the parameters of the charge request and additionally specify the following:
|
|||||||||||||
Info
At the moment, if you accept payments on the Demo PSP widget and indicate charge as the transaction_type parameter value, you might not receive values for the rrn or bank_code parameters.
Example of the response to the charge request
{
"uid": "c74e1b00-9b94-4682-82c3-60167ce64841",
"parent_uid": "c74e1b00-9b94-4682-82c3-60167ce64841",
"status": "successful",
"amount": 100,
"currency": "USD",
"description": "Test transaction ütf",
"type": "charge",
"payment_method_type": "credit_card",
"tracking_id": "tracking_id_000",
"message": "Successfully processed",
"test": true,
"created_at": "2024-06-19T08:53:41.211Z",
"updated_at": "2024-06-19T08:53:46.217Z",
"paid_at": "2024-06-19T08:53:46.149Z",
"expired_at": null,
"closed_at": null,
"settled_at": null,
"manually_corrected_at": null,
"language": "en",
"redirect_url": "https://demo-gateway.begateway.com/process/c74e1b00-9b94-4682-82c3-60167ce64841",
"credit_card": {
"holder": "John Doe",
"stamp": "a282993adc1299dacc79248e77e04c2995f79fcc9f82f408bec59ba20ff55739",
"brand": "master",
"last_4": "5003",
"first_1": "5",
"bin": "520424",
"bin_8": "52042400",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 10,
"exp_year": 2028,
"token_provider": null,
"token": null
},
"status_code": null,
"gateway": {
"iframe": true
},
"mute_notifications": null,
"id": "c74e1b00-9b94-4682-82c3-60167ce64841",
"additional_data": {
"referer": "https://example.com/server/cs_post/post.php?order_id=5304380&security=949247¤cy=USD"
},
"links": {
"receipt_url": "https://demo-backoffice.begateway.com/customer/transactions/c74e1b00-9b94-4682-82c3-60167ce64841/33724a6fe94fe937575c6ed18d2ab8abdc34732df17e51be6da88e9b37356101?language=en"
},
"code": "S.0000",
"friendly_message": "The operation is successful.",
"smart_routing_verification": {
"status": "successful"
},
"charge": {
"auth_code": "654321",
"bank_code": "05",
"rrn": "999",
"ref_id": "777888",
"message": "Payment was approved",
"amount": 100,
"currency": "USD",
"billing_descriptor": "test descriptor",
"gateway_id": 3483,
"status": "successful"
},
"avs_cvc_verification": {
"avs_verification": {
"result_code": "1"
},
"cvc_verification": {
"result_code": "1"
}
},
"customer": {
"ip": null,
"email": null,
"device_id": null,
"birth_date": null,
"taxpayer_id": null,
"external_id": null,
"first_name": null,
"last_name": null,
"address": null,
"country": null,
"city": null,
"zip": null,
"state": null,
"phone": null
},
"billing_address": {
"first_name": null,
"last_name": null,
"address": null,
"country": null,
"city": null,
"zip": null,
"state": null,
"phone": null
}
}