Generate a Maya QRPh

Overview

Use the Pay with Maya to generate and present QRPh for a more efficient payment experience.

Leverage Pay with Maya to implement either of the following:

  • Use Maya’s QRPh Payment Page to reduce your expenses in developing and maintaining your web pages.
  • Embed the Maya QRPh into your self-hosted webpage without the hassle of generating your own QRPh code, all while ensuring compliance with QRPh Code standards.


API Sequence



Learn the API sequence and transaction flow to Generate and present a Maya QRPh.

  1. The customer chooses to pay using Maya in the API Consumer’s application.
  2. The API Consumer calls Create Dynamic QR endpoint of Pay with Maya API.
  3. Upon generating a QRPh, Maya initiates the creation of a 'payment' record with Maya reference ID to uniquely identify the generated QRPh.
  4. Pay with Maya API responds with a paymentId, redirectUrl and qrCodeBody to the API Consumer.
  5. API Consumer saves the paymentId and proceed in presenting QRPh based on their preferred implementation:
    • If using the Maya-hosted page, the API Consumer directs the customer to the redirectUrl.
    • If presenting the generated QRPh Code to the self-hosted pages, the API Consumer uses the qrCodeBody and incorporates it into their hosted pages.
  6. When a user uses a Maya wallet or another wallet of the QRPh-participating financial institution, the issuer should read and process the QRPh code, send a request to BancNet, including the corresponding Maya reference ID and the issuer-generated reference number (invoice/receipt)
  7. BancNet, in turn, transmits the transaction details to Maya.
  8. Maya processes the transaction associated with the original Maya reference ID.
  9. If using the Maya-hosted page, Maya will direct the customer to the API Consumer's result pages.
  10. Subsequently, Maya notifies the API Consumer of the completed transaction using a webhook.
  11. API Consumer acknowledges the receipt of webhook by returning 200 OK.
  12. API Consumer processes webhook.
  13. Maya communicates the transaction status to BancNet.
  14. BancNet then relays the response to the financial institution for reconciliation.
  15. The financial institution then notifies the customer that the payment request has been processed.

Build your Integration

This solution uses Basic Authentication, which requires API keys to authenticate incoming requests. To obtain your API key, please refer to the Generate API Keys for Online Payments guide.

Build the required pages

Add a button to your application. Design and host your response web pages.


1. Add a 'Pay with Maya' button to your application

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


2. Create your Response pages

Every payment state should show an appropriate web page for the customer to know the status of their transaction. You need to host these pages on your website.

Created URLs will be used in the redirectUrl object on the Create Dynamic QR transaction request defining where the customer will be redirected when processing the transaction.


If the customer closes the browser, Maya cannot redirect them to your success or failure pages. To ensure a complete and seamless system experience, implement webhooks .


Create a dynamic QRPh

Handle the ‘Pay with Maya’ button event to trigger the generation of QRPh Code.


Handle the button event by calling the Create Dynamic QR endpoint. This endpoint will return a paymentId, redirectUrl, and the qrCodeBody.


Maya Dynamic QRPh codes are designed for one-time use and remain valid for 1 hour from their creation time.

Once the QR code has been scanned or has expired, any subsequent payment attempts using the same QR code will be unsuccessful. This ensures the security and integrity of the payment process.



Present the generated QRPh

Present the generated QRPh according to your preferred implementation.

Redirect to Maya-hosted page

Get the redirectUrl from the response of Create Dynamic QR and use it to redirect the customer to Maya's page. This page will showcase the dynamic QRPh code generated.

Embed QRPh to your page

Use the qrCodeBody from the response of Create Dynamic QR to incorporate the generated Maya QRPh code into your self-hosted page. Additionally, the response still includes the redirect URL to Maya's page if you opt to use it.

Monitor Real-time Transaction Events

Monitor and receive transaction updates.


Maya uses webhooks to inform your application about specific events related to payment requests. These notifications include the payment status and response codes.

Refer to the following resources to understand Webhooks and how to handle errors and declined payments:

  1. How to create and configure your webhook
  2. Online payment errors

If your application doesn't receive webhook notifications, use the following retrieve endpoints as an alternative:




Endpoints

The following are the endpoints needed for implementing Maya’s QRPh.

NameHTTP MethodKey TypeEndpointDescription
Create Dynamic QRPOSTPUBLIC/payments/v1/qr/paymentsCreates a dynamic QR payment transaction.

Managing Payment Transactions

NameHTTP MethodKey TypeEndpointDescription
Retrieve Payment via IDGETSECRET/payments/v1/payments/{paymentId}Retrieve the transaction information by providing the paymentId. The resulting response will be an array of the payment information.`.
Retrieve Payment via RRNGETSECRET/payments/v1/payment-rrns/{rrn}Retrieve the transaction information by providing the merchant’s request reference number. Functionality is similar to Retrieve Payment via ID, but instead of the paymentID, rrn is used.
Retrieve Payment StatusGETPUBLIC/payments/v1/payments/{paymentId}/statusBy providing the paymentId, use this API to get the payment status.
Cancel Payment via IDPOSTSECRET/payments/v1/payments/{paymentId}/cancelThis API is used to cancel a payment transaction by providing the paymentId; before it can be authenticated and card payment is made.

Business Rules to Code

To supplement your knowledge of the integration, it is essential to familiarize the Business Rules to Code for Online Payments . This ensures that technology requirements and other development considerations are met.


At this point, you have understood the following:

  • The necessary APIs and their endpoints
  • The sequence and purpose of each API
  • The prerequisites for building your integration


Pay with Maya’s QR Codes

QRPh payment codes generated by Maya comply with ISO 18004:2015 and follow the Philippine QR Code standards for P2M (Person-to-Merchant) issued by Philippine Payments Management, Inc (PPMI).

Some of the details and information required by PPMI that you can find in the QRPh payment codes are:

  • Merchant ID: The unique identifier assigned to the merchant.
  • Merchant Category Code (MCC): Classifies merchants and businesses based on the type of goods or services they provide.
  • Transaction Currency Code: Identifies the currency used for the transaction.
  • Transaction Amount: Specifies the monetary value of the transaction.
  • Country Code: Denotes the country associated with the merchant's location or the transaction.
  • Merchant Name: Indicates the name of the merchant conducting the transaction.
  • Merchant City: Specifies the city where the merchant is located.
  • Reference Label / Maya Reference ID: Provides a unique label or reference ID associated with the transaction, facilitating easy identification and tracking within the Maya system.