To get started with Modem Pay, follow these simple steps to set up and start collecting payments:

1. Create an Account

  • API Keys: Once registered, get your API keys from the dashboard for integrating and authenticating requests.

2. Configure Integrations

  • HTML Checkout: Embed Modem Pay’s HTML Checkout into your site for a quick, low-code payment solution.

Here’s an example of how you’d implement HTML checkout:

Walkthrough

  1. Setting Up the Form

    When the user clicks Pay Now, the form submits the order details to Modem Pay’s endpoint (/api/pay), passing essential information like amount, customer details, and URLs for redirecting.

  2. Payload Format After Submission

    Once the form is submitted, the server receives the payment information in JSON format as shown below. Modem Pay processes this payload to initialize the payment.

    {
      "public_key": "pk_test_971deb266f73e90c1083983e684a765dabe163c59b94c0d22dfdb8172f1915a0",
      "amount": "450",
      "customer_name": "Caleb Okpara",
      "customer_email": "usr@example.com",
      "customer_phone": "7000001",
      "cancel_url": "https://modempay.gomindz.gm",
      "return_url": "https://academy.gomindz.gm",
      "currency": "GMD",
      "metadata": { "source": "modem-html-test" }
    }
    
  3. After Payment – Redirect and Webhooks

    • Redirect URL: Once the payment completes, the user is redirected to the return_url specified in the form, or if canceled, to the cancel_url.
    • Webhooks: For real-time updates on the payment status, configure webhooks in Modem Pay’s dashboard. This allows your server to receive notifications for events like charge.succeeded or charge.cancelled so you can handle them as needed, such as updating the order status on your end.
  • SDK Payment Intent: For more control, use Modem Pay’s SDK to create and confirm payment intents programmatically.
import ModemPay from "modem-pay";

const modempay = new ModemPay('YOUR_MODEM_PAY_API_KEY');

const intent = await modempay.paymentIntents.create({ amount: 450 });

console.log(intent.data.payment_link);

3. Complete KYC

  • Identity Verification: Before going live, complete Modem Pay’s KYC requirements from the dashboard to enable secure, compliant transactions.

4. Start Collecting Live Payments

  • Go Live: Once KYC is approved, switch from test to live mode on your dashboard to start processing real transactions and collecting payments from your customers.

This setup provides both a quick and customizable payment solution for your business, with HTML Checkout for a rapid start and SDK Payment Intent for detailed control.