# Benefit Payment Gateway for Unified Payments API Benefit Payment Gateway (PG) is a solution that enables merchants to process transactions through debit cards. Payments can be processed via websites or mobile applications. To use Benefit PG, merchants must register via one of Benefit’s supported acquirers. --- ## Request a payment Use the following details to set up your request. To get a detailed view of all required and optional fields, see our [API reference](https://api-reference.checkout.com/). > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "benefit" }, "reference": 368, "currency": "BHD", "amount": 1000, "processing_channel_id": "pc_ekaubqrravqupfxde7kxvd2t3i", "success_url": "https://example.com/payments/success", "failure_url": "https://example.com/payments/failure" } ``` #### Response example If you receive a `202` response with status `Pending`, Benefit PG has accepted your transaction request. ```json { "id": "pay_qexughhq5l2unjpevzxovl5ksu", "status": "Pending", "reference": "368", "_links": { "self": { "href": "https://{prefix}.api.checkout.com/payments/pay_qexughhq5l2unjpevzxovl5ksu" }, "redirect": { "href": "https://www.test.benefit-gateway.bh/payment/paymentpage.htm?PaymentID=145202215328911475" } } } ``` --- ## Get details about a payment You can use the `id` found in the payment response to retrieve details about an existing Benefit PG payment. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `GET` `https://{prefix}.api.checkout.com/payments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/payments/{id}` ### Response example ```json { "id": "pay_qexughhq5l2unjpevzxovl5ksu", "requested_on": "2022-06-02T08:17:02.0430752Z", "source": { "type": "benefit" }, "amount": 1000, "currency": "BHD", "payment_type": "Regular", "reference": "368", "status": "Pending", "_links": { "redirect": { "href": "https://www.test.benefit-gateway.bh/payment/paymentpage.htm?PaymentID=145202215328911475" }, "self": { "href": "https://{prefix}.api.checkout.com/payments/pay_qexughhq5l2unjpevzxovl5ksu" }, "actions": { "href": "https://{prefix}.api.checkout.com/payments/pay_qexughhq5l2unjpevzxovl5ksu/actions" } } } ``` --- ## Refunds and chargebacks Benefit PG supports full, partial and multiple partial refunds. Note that you need to request partial refund enablement from Benefit when you sign up with them. You can process a refund through the [Dashboard](https://dashboard.checkout.com) or using the [Refund API](https://www.checkout.com/docs/payments/manage-payments/refund-a-payment.md). Disputes and chargebacks can be raised through the buyer's bank or through your acquiring company. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments/{id}/refunds` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments/{id}/refunds` ### Response example ```json { "action_id": "act_mg6cqtudpuzund46uee3yrkvrm", "_links": { "payment": { "href": "https://{prefix}.api.checkout.com/payments/pay_soaizebivsxubh2pvdpsiaop6q" } } } ``` --- ## Testing Benefit PG To start testing, you'll need to: 1. Register via Benefit’s supported acquirer. 2. Contact your account manager to activate Benefit PG payments in the sandbox environment. 3. [Create a Benefit PG payment transaction](#Request_a_payment). 4. Check the transaction response in the sandbox environment. 5. Complete the payment transaction and check the result status. You can use the following Benefit test cards to test a transaction | Card number | Response code | Status | | --- | --- | --- | | `4600410123456789` | 00 | Approved | | `4895550123456789` | 05 | Contact the issuer | | `4415550123456789` | 51 | Insufficient funds | | `4550120123456789` | 54 | Expired card | | `4845550123456789` | 55 | Invalid pin | | `4889780123456789` | 61 | Limit exceeded | | `4575550123456789` | 78 | Refer to issuer |