Our iOS Drop-in renders DuitNow in your payment form, and generates a QR code that the shopper uses to pay with their choice of app from DuitNow participating banks.
Requirements
Select the server-side flow that your integration uses:
Show DuitNow in your payment form
Drop-in uses the countryCode
and the amount.currency
from your /paymentMethods request to show the available payment methods to your shopper.
To show DuitNow in your payment form, you need to specify in your /paymentMethods request:
- countryCode: MY
- amount.currency: MYR
- amount.value: The value of the payment.
After the shopper selects a payment method and provides payment details, Drop-in invokes the didSubmit
method which contains data.paymentMethod
. Pass data.paymentMethod
to your server and make a payment request.
Make a payment
When the shopper proceeds to pay, Drop-in invokes the didSubmit
method which contains data.paymentMethod
.
- Pass
data.paymentMethod
to your server. -
From your server, make a /payments request, specifying:
paymentMethod
: Thedata.paymentMethod
from thedidSubmit
event from your client app.
Drop-in generates the QR code that the shopper uses to pay.
Check the payment result
To check the payment result, use the state.data
object from the corresponding event handler:
onAdditionalDetails
for successful payments.onError
for unsuccessful or timed out payments.
From your server, make a POST /payments/details request with:
details
: thestate.data.details
from theonAdditionalDetails
oronError
event.paymentData
: thestate.data.paymentData
from theonAdditionalDetails
oronError
event.
You receive a response containing:
additionalData
: Object containing the value and currency for the payment.pspReference
: Our unique identifier for the transaction.resultCode
: Authorised for successful payments or Refused for unsuccessful or timed-out payments. Use this to present the payment result to your shopper.