Skip to main content
SafetyPay

SafetyPay is an alternative payment method supported by EBANX, designed to offer secure, real-time transactions across Latin America. It allows customers to make online purchases using bank transfers or cash payments without the need for credit or debit cards. By selecting SafetyPay, customers are redirected to their bank’s platform or a nearby payment location to complete the transaction, making it ideal for users who prefer secure and accessible payment options. This method is particularly popular in countries where traditional banking access is limited, providing merchants with a powerful tool to reach a broader audience through EBANX’s integrated platform.

Requirements

  • API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
  • Familiarity with EBANX Direct - This setup follows the same general structure as other payment methods, with a few unique parameters.

How it works

  • Select SafetyPay at checkout - Your customer chooses SafetyPay as their payment method during checkout.
  • Generate payment code - EBANX creates a unique payment code or link associated with the transaction.
  • Redirect customer - Your customer is redirected to their bank’s online banking platform or given details for an offline payment location.
  • Complete payment - Your customer completes the payment via bank transfer or cash payment at an affiliated location.
  • Confirm transaction - Once the payment is made, SafetyPay notifies EBANX, updating the transaction status so that you can fulfill the order.

Instructions

Follow the steps below.

  1. Select your environment

    Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.

    https://sandbox.ebanx.com/ws/direct
  2. Define your parameters

    With SafetyPay, customers are redirected to a secure third-party website to complete the payment quickly and safely. To obtain this redirection link, call the ws/direct endpoint with the following fields:

    Basic parameters:

    ParameterDescription
    operationSet to request
    integration_keyYour EBANX integration key
    payment_type_codeSet to safetypay-cash or safetypay-online
    countrySet to pe for Peru
    info

    Both SafetyPay Cash and SafetyPay Online are redirect-based payment methods, and operate in the same way.

    Customer data:

    ParameterDescription
    nameCustomer name
    emailCustomer email

    Charge parameters:

    ParameterDescription
    merchant_payment_codeUnique merchant payment code
    currency_codeISO-4217 currency code
    Supported values: PEN and USD
    amount_totalTotal amount to be charged
  3. Sample request

    Use the following example to initiate a request.

    curl -X POST \
    --location 'https://sandbox.ebanx.com/ws/direct' \
    --header 'Content-Type: application/json' \
    --data '{
    "integration_key": "your_ebanx_integration_key",
    "operation": "request",
    "payment": {
    "name": "José Silva",
    "email": "joseperu@example.com",
    "country": "pe",
    "payment_type_code": "safetypay-cash",
    "merchant_payment_code": "0x0W28D03-T10",
    "currency_code": "PEN",
    "amount_total": "100"
    }
    }'
  4. Sample response

    A successful request returns a response like the example below, with the third-party website link provided in the payment.redirect_url parameter.

    {
    "payment": {
    "hash": "5efcc4d90dbee3a4e40b6f95a7c34ef2a3ed4e0aee0c2c1c",
    "country": "pe",
    "merchant_payment_code": "0x0W28D03-T10",
    "order_number": null,
    "status": "PE",
    "status_date": null,
    "open_date": "2020-07-01 17:16:09",
    "confirm_date": null,
    "transfer_date": null,
    "amount_br": "100.00",
    "amount_ext": "100.00",
    "amount_iof": "0.00",
    "amount_ext_requested": "100.00",
    "currency_rate": "1.0000",
    "currency_ext": "PEN",
    "due_date": "2020-07-04",
    "instalments": "1",
    "payment_type_code": "safetypay-cash",
    "redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=5efcc4d90dbee3a4e40b6f95a7c34ef2a3ed4e0aee0c2c1c",
    "pre_approved": false,
    "capture_available": null
    },
    "status": "SUCCESS",
    "redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=5efcc4d90dbee3a4e40b6f95a7c34ef2a3ed4e0aee0c2c1c"
    }

    At this stage, the payment will appear as pending (PE) in your
    EBANX Dashboardchevron_right
  5. Redirect customer to the returned URL

    Redirect your customer to the URL returned in the parameter redirect_url. After the redirection, your customer will be in a third-party website, with all the necessary purchase details to finalize their payment securely and easily.

    Testing SafetyPay in a sandbox environment

    In our Sandbox environment, we provide a SafetyPay simulation interface to test bank transfer payments. This mock interface allows you to simulate different payment outcomes:

    • Simulate Authorized = YES: Confirms the payment as successful.
    • Simulate Authorized = NO: Denies the payment.
    • Leave Pending: Leaves the payment in a pending state.

    This simulation mimics the real production flow, where users are redirected to their Internet Banking to complete transactions, enabling you to thoroughly test authorized and unauthorized payments.

    SafetyPay
  6. Monitor payment for status changes

    Notifications

    Status

    • After receiving a notification that status has changed, retrieve the payment status.

    • When a payment is confirmed, the status will change from pending (PE) to confirmed (CO). If the customer does not complete the payment, the status will eventually change to cancelled (CA).

  7. Congratulations!

    You have succesfully integrated SafetyPay.

    For more information, refer to the
    Direct API reference guidechevron_right

Resources

Use the following resources when testing in your sandbox environment.


Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: