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

Please be advised that the PWM deeplink feature to the Maya Consumer app is temporarily disabled. Customers are now redirected to the web-based payment page of Maya for a seamless completion of their payment transactions. Stay tuned as we relaunch an enhanced version of this feature!

Useful Links