O21Pay for developers
  • Welcome to O21Pay
  • INTRODUCTION
    • Introducing O21Pay
    • What is O21Pay-components ?
  • Start integrating
    • Getting started
    • Display/Allow access to payments
    • Display QR-Code
    • Display payment's modal from URL
  • Widget
    • Page 2
  • API Reference
    • API Reference
  • Webhooks
    • Page 5
  • FAQ
    • Page 4
Powered by GitBook
On this page
  • Method
  • Attributes
  • Events
  • Example
  1. Start integrating

Display/Allow access to payments

Related components: O21Pay-payments

Method

init(amount, order_ref)

Attributes

Name
Description
Mandatory

merchant_id

Merchant ID

Y

secretkey

Secret key (only for Testing)

N

form

Form or Button

N

readonly

Readonly (only Form)

N

disabled

Disabled (only Form)

N

amount

Amount of payment

N

order_ref

Your Order Reference

N

hidden_order_ref

Hidden Order Reference

N

suggestion

List of amount: "10,50,100"

N

Events

Name
Description

o21pay_payment_request

Each time you receive a new url

o21pay_QRclick

You receive this event when you click on the qr-code

Example

<o21pay-payment merchant_id="xxxx" amount="20" order_ref="1234556789" form readonly></o21pay-payment>
ddEventListener('o21pay_payment_request', function (e) {
    //e.detail.url;
})

addEventListener('o21pay_QRclick', function (e) {
    //e.detail.url;
})
PreviousGetting startedNextDisplay QR-Code

Last updated 2 years ago