Generate PaymentUIRequest
Usage#
Using PaymentUIRequestBuilder to create a request for opening payment page.
- iOS
- Android
- Flutter
Client can be open the activity from activity or fragment by providing request data and using the provided method which will look something like this
At first, we need prepare payload, Let's using PaymentUIRequestBuilder as below to make request.
Open available methods screen#
In general, Main app couldn't/unknown define what methods will pay for the order. So The SDK will show available methods as default to make user able to choose any method will pay after call start transaction
Payment directly (without available methods screen)#
There are some cases the main app has defined what exactly methods will pay for the order, that mean main app want to ignore available methods screen. So We has already provided the solution to solved that problem. Let's see below.
Refer to PaymentMainMethodRequest class to get all available methods.
Payment methods metadata config(Optional)#
There are some methods must add more config to payment, For example VNPayEWallet.
So you must be passing metadata into paymentRequestBuilder before call startUI.
Notes: refer to PaymentV2Request.Metadata.MethodConfig to see all metadata
Firstly, we need create PaymentUIRequestBuilder instance by pass PaymentOrder param and PaymentClient param.
Then, we set main payment methods
After that, we set loyalty info methods if needed
Finally, we using build() function of this builder to get a payment request for next step.
Generate payment request#
Open available methods screen
Payment directly (without available methods screen)
Supported payment method:
MainMethodAll(int amount)MainMethodVNPayGatewayQr(int amount)MainMethodVNPayGatewayAtm(int amount)MainMethodVNPayGatewayInternationalCard(int amount)MainMethodVNPayGatewayMobileBanking(int amount)MainMethodVNPayQrMms(int amount)MainMethodVNPayEWallet(int amount)MainMethodVNPayCustomer(int amount)MainMethodVNPaySposCard(int amount)MainMethodMomoGateway(int amount)MainMethodCod(int amount)MainMethodCash(int amount)MainMethodRefInput(int amount, string methodCode)MainMethodBankTransfer(int amount)MainMethodInstallment(int amount)
Payment methods metadata config(Optional)
There are some methods must add more config to payment, For example VNPayEWallet. So you must be passing metadata into paymentRequestBuilder before call startUI.
Currently MinervaUI only supports following online payment methods:
- all(amount: Double, metadata: [MethodMetadata]) // Using it if we wanna using built-in UI with full of allowed payment methods interface
- vnPayQRMMS(amount: Double)
- vnPayQRGateway(amount: Double)
- vnPayATMGateway(amount: Double, route: BankRoute)
- vnPayInternationalCardGateway(amount: Double)
- vnPayQRReversal(amount: Double)
- vnPayEWallet(amount: Double, customer: VNPayEWalletCustomer)
- mobileBanking(amount: Double)
- momoGateway(amount: Double)
- sposApp(amount: Double)
- cod(amount: Double)
- cash(amount: Double)
- refInput(amount: Double, subMethodCode: String)
- pos(amount: Double)
- bankTransfer(amount: Double)
- installment(amount: Double)