One-time Wallet Payments

Simplify the payment experience by allowing your customers to use their Maya account to pay for the products and services.

Implementing One-time Wallet Payments

Step 1: Setup your Maya Business Manager Account

Before you could implement the Pay with Maya to your websites, you must register and setup your Maya Business Manager Account.

Step 2: Build your pages

A. Create a 'Pay with Maya' button

Create a Pay with Maya button on your website that will allow customers to trigger the payment.

Sample code for Creating a button:
<html>
  <head>
    <title>Wear Vamos</title>
    </head>
  <body>
    <form action="/pay-with-maya" method="POST">
        <button type="submit">Pay with Maya</button>
    </form>
  </body>
</html>  

B. Create your Status Page

Host pages on your website that will reflect the payment status to customers.

⚠️ If customers closes the browser, Maya will not be able to redirect the user to your success/fail pages. To ensure a complete system experience, implement webhooks.

Sample code for Success Page:
<html>
  <head><title>Payment is successful</title></head>
  <body>
    <h1>Thank your for your order!</h1>
    <p>
      <a link="/track-order">Tracker your order here</a>.
    </p>
  </body>
</html>
Step 3: Complete the payment

Handle the ‘Pay with Maya’ button event by calling the POST /payby/v2/paymaya/payments endpoint to get a redirect URL for user to get their authorization.


When calling this endpoint, your system must define the redirectUrl – URL of the page where your customer will be redirected based on the payment status.

The redirectUrl Object

Attributes
success (url) REQUIRED
URL of the page where your customers will be redirected after a successful payment.
failure (url) REQUIRED
URL of the page where your customers will be redirected to when the payment fails.
cancel (url) REQUIRED
URL of the page where your customer will be redirected when they cancel a payment.

ℹ️ When initiating payment as a Payment Facilitator, you need to provide the pf details. For more details see Payment Facilitator.

🧪 Quick Test

At this point you should be able to redirect session to Maya’s login page by clicking the button.

  1. Click "Pay with Maya" button
  2. You get redirected to Maya’s Login page.
  3. You will have to use a test Maya account Sandbox Credentials and Cards.
  4. On successful payment, Pay with Maya will redirect to your success page.
Step 4: Handle post-payment events

The redirection after a successful payment does not guarantee that the payment information will be updated. Your application should manage payment information updates by implementing webhooks.

Deep Link

Pay with Maya also supports deep linking that is, by default, enabled to every merchants onboarded. This feature will link your checkout page to Maya mobile app for in-app payment processing via a direct redirection. It will also reduce friction by removing OTP confirmation via SMS.

This feature is only applicable when your page is accessed via mobile device where Maya application is installed. Pay with Maya will automatically resolve if deep link is applicable to your transaction as long as your webview or application allows Android / iOS deep link resolution.





What will happen when deep linking fails or is not applicable? Pay with Maya will go to the auth flow route in which users will be redirected to Maya's login page.

ℹ️ To disable this feature, contact your Maya Relation Manager or send your request to [email protected].

Useful Links