Card bill payments

Overview

A card is a convenient and mainstream payment method for recurring subscription payments. Card subscription payments require customers to tokenise their card details as part of their first payment. After that, all subsequent card charges are completed using 2d secure transactions.

2d secure allows merchants to automatically charge customer cards without the customer needing to authenticate subsequent transactions


Tokenised card subscription payments

To sign-up a subscriber using a card as a recurring payment method requires three basic steps:

curl -X 'POST' \
  'https://gate.reviopay.com/api/v1/billing_templates/' \
  -H 'Authorization: Bearer H6gVKJr36N-To_1EZul4L4b5UDTCVMmGt3AB1sbnFKy6jHKq6uEVudowPY-6GS40Un2-wYigGFlWAZyN0RuaUg==' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "purchase": {
    "currency": "ZAR",
    "products": [
      {
        "name": "string",
        "quantity": "1",
        "price": 0,
        "discount": 0,
        "tax_percent": "0",
        "category": "string"
      }
    ],
    "language": "en",
    "notes": "string",
    "debt": 0,
    "subtotal_override": null,
    "total_tax_override": null,
    "total_discount_override": null,
    "total_override": null,
    "request_client_details": [],
    "timezone": "Europe/Oslo",
    "due_strict": false,
    "payment_method_details": {
      "direct_debit": {
        "profile_code": "string",
        "abbreviated_name": "string",
        "account_number": "string"
      }
    }
  },
  "brand_id": "f880ebd4-04fb-4b88-8531-7ca148c93f2e",
  "title": "string",
  "is_subscription": true,
  "invoice_issued": "2020-04-30",
  "invoice_due": 1619740800,
  "invoice_skip_capture": false,
  "invoice_send_receipt": false,
  "subscription_period": 1,
  "subscription_period_units": "months",
  "subscription_due_period": 7,
  "subscription_due_period_units": "days",
  "subscription_charge_period_end": false,
  "subscription_trial_periods": 0,
  "≈,
  "force_recurring": true
}'
curl -X 'POST' \
  'https://gate.reviopay.com/api/v1/billing_templates/b1e9d1b7-82bc-49dd-851e-3c7c40659451/add_subscriber/' \
  -H 'Authorization: Bearer H6gVKJr36N-To_1EZul4L4b5UDTCVMmGt3AB1sbnFKy6jHKq6uEVudowPY-6GS40Un2-wYigGFlWAZyN0RuaUg==' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "client_id": "e8afb061-9789-469f-aa9d-2ceef2b51626",
}'
<!DOCTYPE html>
<html>
<body>

<h2>Card Direct Post</h2>

<form action="https://gate.reviopay.com/api/v1/p/{{Insert direct_post_url}}/" method="POST">

  <label for="fname">Cardholder Name:</label><br>
  <input type="text" id="cardholder_name" name="cardholder_name" value="Input"><br><br>
  
  <label for="lname">Card number:</label><br>
  <input type="text" id="card_number" name="card_number" value="Input"><br><br>
  
  <label for="lname">Expires:</label><br>
  <input type="text" id="expires" name="expires" value="Input"><br><br>
  
  <label for="lname">CVC:</label><br>
  <input type="text" id="cvc" name="cvc" value="Input">
  
  <br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>

👍

Pro tips

  • Always set force_recurring = true to ensure that the customer's card is tokenised. Failing to do so will allow the customer to choose whether they want to use their card for upcoming purchases
  • Remember to set subscription_active = true