Checkout Redirect

The integration in an online store using the Redirect checkout option requires the creation of a Payment Request (Creating a payment request ) and the redirection to the URL obtained in the response of this method, in the parameter checkout_url.

When redirecting to the SimpleFi checkout, it is necessary to include the redirection parameters to the merchant's website once the operation in the checkout is completed. These parameters are:

  • redirect_url: The URL of the merchant's platform where the user is to be redirected once the payment is successful.

  • error_url: The URL of the merchant's platform where the user is to be redirected once the payment is not successful.

Example:

curl -X POST https://api.simplefi.tech/payment_request \
-H "Content-Type: application/json" \
-d '{
  "ars_amount": 1000,
  "amount": 0.002,
  "currency": "ARS",
  "card_payment": false,
  "reference": {
    "order_id": "123456789"
  },
  "memo": "Compra en Café Cuyo",
  "coins": [
    {
      "ticker": "BCH",
      "chain_id": 1
    }
  ],
  "notification_url": "https://tuweb.com/notificacion",
  "merchant_id": "cafecuyo123"
}'

The response could be:

{
  "id": "671cf4fe9a8949e0d537802f",
  "order_id": 123456789,
  "ars_amount": 1000,
  "ars_paid": 0,
  "amount": 0.002,
  "amount_paid": 0,
  "currency": "ARS",
  "usd_amount": 2.5,
  "reference": {
    "order_id": "123456789"
  },
  "memo": "Compra en Café Cuyo",
  "notification_url": "https://tuweb.com/notificacion",
  "status": "pending",
  "status_detail": "not_paid",
  "expiration_time": "2024-10-26T14:55:16.576Z",
  "delivered": true,
  "transactions": [
    {
      "id": "tx12345",
      "price_details": {
        "currency": "ARS",
        "currency_amount": 1000,
        "currency_final_amount": 1000,
        "base_amount": 0.002,
        "final_amount": 0.002,
        "paid_amount": 0,
        "discount_rate": 0,
        "rate": 500000
      },
      "coin": "BCH",
      "chain_id": 1,
      "address": "qz7ff5d9k2...",
      "status": "not_paid",
      "payment_request_id": "671cf4fe9a8949e0d537802f",
      "memo": "Compra en Café Cuyo",
      "additional_info": {},
      "payments": [],
      "date_created": "2024-10-26T14:55:16.576Z",
      "last_modified": "2024-10-26T14:55:16.576Z"
    }
  ],
  "payments": [],
  "merchant_id": "cafecuyo123",
  "checkout_url": "https://pagar.simplefi.tech/cafe-cuyo/payment/671cf4fe9a8949e0d537802f",
  "date_created": "2024-10-26T14:55:16.576Z",
  "last_modified": "2024-10-26T14:55:16.576Z"
}

You must take the checkout_url, add the redirection parameters, and redirect the user

Example redirect URL

https://pagar.simplefi.tech/cafe-cuyo/payment/671cf4fe9a8949e0d537802f?redirect_url=https://tuweb.com/notificacion/pago_exitoso/123456&error_url=https://tuweb.com/notificacion/pago_fallido/123456

Last updated