Pay with EFT

Overview

Pay with EFT (Electronic Funds Transfer) allows customers to make payments directly from their bank accounts through secure banking interfaces. This payment method is particularly popular in South Africa and other regions where EFT is widely adopted.

Base URL

https://mainapi.cashonrails.com/api/v1/s2s

Integration Steps

1. Initialize Payment

Make a POST request to initialize the EFT payment:

curl --location '{{baseurl}}/paywitheft/initialize' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--data-raw '{
    "email": "customer@email.com",
    "amount": "10000",
    "currency": "ZAR",
    "reference": "{{reference}}"
}'
Request Parameters
ParameterTypeRequiredDescription
emailstringYesCustomer’s email address
amountstringYesAmount to charge (in cents)
currencystringYesCurrency code (e.g., ZAR)
referencestringYesUnique transaction reference
Sample Response
{
    "success": true,
    "message": "Kindly complete payment",
    "data": {
        "_links": {
            "url": "https://mainapi.cashonrails.com/api/v1/s2s/transaction/verify/s2sref_008513679020729636",
            "method": "GET"
        },
        "redirect_url": "https://payments.pay-label.com/pay/hosted?payment_key=18848909ac3e6e323f090ec615b5082b&payment_type=eft"
    }
}

2. Redirect Customer

Redirect the customer to the URL provided in redirect_url to complete their EFT payment. The customer will be taken to a secure banking interface where they can select their bank and authorize the transfer.

The redirect URL will take the customer through the following process:

  1. Bank Selection: Customer chooses their bank from available EFT providers
  2. Banking Interface: Customer is redirected to their bank’s secure interface
  3. Authentication: Customer logs in using their banking credentials
  4. Authorization: Customer reviews and authorizes the payment
  5. Completion: Customer is redirected back after payment completion

3. Verify Transaction

After the customer completes the EFT payment process, verify the transaction status using either the verification URL from the response or the standard endpoint:

curl -X GET '{{baseurl}}/transaction/verify/{reference}' \
-H "Authorization: Bearer YOUR_SECRET_KEY"

You can also use the direct verification link from the response:

curl -X GET 'https://mainapi.cashonrails.com/api/v1/s2s/transaction/verify/{reference}' \
-H "Authorization: Bearer YOUR_SECRET_KEY"
Sample Success Response
{
    "status": true,
    "message": "Transaction verified successfully",
    "data": {
        "reference": "s2sref_008513679020729636",
        "amount": "10000",
        "currency": "ZAR",
        "status": "success",
        "payment_method": "eft",
        "transaction_date": "2024-02-21T12:34:56Z"
    }
}
Sample Pending Response
{
    "status": true,
    "message": "Transaction is being processed",
    "data": {
        "reference": "s2sref_008513679020729636",
        "status": "pending",
        "payment_method": "eft"
    }
}
Sample Failed Response
{
    "status": false,
    "message": "Transaction failed",
    "data": {
        "reference": "s2sref_008513679020729636",
        "status": "failed",
        "reason": "Payment was declined or cancelled by customer"
    }
}
⚠️

EFT payments may take several minutes to process as they involve real-time communication with banking systems. Always verify the transaction status before confirming payment to the customer.

4. Cancel Transaction

You can cancel a transaction that is still pending:

curl -X GET {{baseurl}}/transaction/cancel/{reference} \
-H "Authorization: Bearer YOUR_SECRET_KEY"

Replace {reference} with your transaction reference.

Cancel Transaction Response

Success Response:

{
    "success": true,
    "message": "Transaction cancelled successfully",
    "data": {
        "reference": "s2sref_008513679020729636",
        "status": "cancelled",
        "amount": "10000",
        "currency": "ZAR",
        "cancelledAt": "2024-02-21T12:34:56Z"
    }
}
Cancellation Rules
⚠️
  • Only pending transactions can be cancelled
  • Once the customer has authorized the EFT transfer, it cannot be cancelled
  • Completed transactions cannot be cancelled (contact support for refunds)
  • Failed transactions are already inactive and don’t need cancellation

Supported Currencies

CurrencyCountry/RegionDescription
ZARSouth AfricaSouth African Rand

Best Practices

  1. Amount Format: EFT amounts are typically specified in cents (e.g., 10000 = R100.00)
  2. Timeout Handling: EFT transactions may take 5-15 minutes to complete
  3. Status Polling: Check transaction status periodically for pending payments
  4. Error Handling: Implement proper handling for cancelled or failed EFT transfers
  5. User Experience: Inform customers that they will be redirected to their bank’s secure interface

Important Notes

  • EFT payments require customers to have online banking access
  • Customers must authorize payments through their bank’s secure interface
  • Processing times depend on the customer’s bank and network conditions
  • Always use the verification endpoint to confirm final payment status
  • EFT transfers are processed in real-time but may show as pending initially

Security Considerations

  • All EFT transactions are processed through secure banking channels
  • Customer banking credentials are never shared with your application
  • The redirect URL uses secure HTTPS connections
  • Banks implement their own fraud detection and security measures