Skip to content

Maybank QRPay

Maybank QRPay component

Example

html
<div id="checkoutMaybankQRPayField"></div>
javascript
import { MayBankQRPay } from '@paykka/card-checkout-ui'

const checkoutMaybankQRPay = paykkaCheckout.create(MayBankQRPay, {
  onSubmit: formValidateError => {
    console.log('Maybank QRPay payment submitted:', formValidateError)
  },
  onSuccess: data => {
    console.log('Maybank QRPay payment successful:', data)
  },
  onError: error => {
    console.log('Maybank QRPay payment failed:', error)
  }
})

checkoutMaybankQRPay.mount('#checkoutMaybankQRPayField')

Attributes

MayBankQRPayProps

Passed when calling the create method to create Maybank QRPay.

Name Description TypeDefault
showEmailWhether to display email.
  • If set to true and email is already passed when creating the checkout, it will be displayed as disabled.
  • If set to false and email is not passed when creating the checkout, it will be displayed normally.
booleanfalse
showAddressWhether to display address.
  • If set to true and address is already passed when creating the checkout, it will be displayed normally.
  • If set to false and address is not passed when creating the checkout, it will be displayed normally.
booleanfalse
hidePaymentButtonWhether to hide the payment button. After hiding it, you can trigger payment manually through the component ref's payment() method.booleanfalse
onSubmitPayment submission callback, triggered after clicking the payment button.
  • formValidateError is the error information when form validation fails.
  • Return false to stop the payment submission.
(formValidateError?: Record<string, FormValidateError[]>) => void | boolean | Promise<void | boolean>undefined
onSuccessCallback after successful payment.
  • PaymentSuccessData contains the information returned after successful payment, please refer to.
  • This callback is also triggered when risk control is pending.
(data: PaymentSuccessData) => voidundefined
onErrorCallback after payment failure, can resubmit for payment.
  • error is a PayKKaError instance, typically containing the following properties:
    • type: Error type.
    • message: Error message.
    • code: Error code, when an API error occurs, it will return a specific error code.
(error: PayKKaError) => voidundefined
onTimeoutCallback when payment times out, can resubmit for payment.() => voidundefined
onExpiredCallback when the checkout counter has expired during payment, cannot pay again.() => voidundefined

MayBankQRPayRef

Methods and properties exposed by Maybank QRPay, can be called by the Maybank QRPay instance created via the create method, e.g.: checkoutMaybankQRPay.ref.payment().

Name DescriptionType
paymentMake a payment, enabled when the payment button is not visible.() => void

Below is an explanation of some data types:

PaymentSuccessData

Payment success information.

interface PaymentSuccessData {
  /** URL that can be redirected to after successful payment */
  returnUrl?: string
}