Paze
Follow this guide to add Paze to your checkout.
- PAZE - Paze
Payment method availability:
- Paze since mSDK version 7.7.0
iOS
Ready-to-Use UI
When you use our ready-to-use UI, everything works out-of-box. Just set PAZE payment brand and shopper result url in the Checkout Settings class and you are done. Proceed with the presenting checkout as for standard transaction.
OPPCheckoutSettings *checkoutSettings = [[OPPCheckoutSettings alloc] init];
// Set Paze payment method
checkoutSettings.paymentBrands = [@"PAZE"];
checkoutSettings.shopperResultURL = @"com.companyname.appname.payments://result";
let checkoutSettings = OPPCheckoutSettings()
// Set Paze payment method
checkoutSettings.paymentBrands = ["PAZE"]
checkoutSettings.shopperResultURL = "com.companyname.appname.payments://result"
Android
Ready-to-Use UI
When you use our ready-to-use UI, everything works out-of-box. Just set PAZE payment brand in the Checkout Settings class and you are done. Proceed with the presenting checkout as for standard transaction.
Set paymentBrands = new HashSet<>();
paymentBrands.add("PAZE");
CheckoutSettings checkoutSettings = new CheckoutSettings(
checkoutId,
paymentBrands,
providerMode
);
val paymentBrands = hashSetOf("PAZE")
val checkoutSettings = CheckoutSettings(
checkoutId,
paymentBrands,
providerMode
)
SDK & Your Own UI
In this guide we assume that you have already implemented all steps for performing standard mSDK transaction. There are several steps that you have to perform to integrate Paze, which are as follows:
1. Create payment parameters for PAZE using OPPPaymentParams.
NSError *error = nil;
OPPPaymentParams *paymentParams = [[OPPPaymentParams alloc] initWithCheckoutID:chekoutID paymentBrand:@"PAZE" error:&error];
paymentParams.shopperResultURL = @"com.companyname.appname.payments://result";
let paymentParams = try? OPPPaymentParams(checkoutID: chekoutID, paymentBrand: "PAZE")
paymentParams?.shopperResultURL = "com.companyname.appname.payments://result"
2. Create transaction object and submit transaction.
OPPTransaction *transaction = [OPPTransaction transactionWithPaymentParams:paymentParams];
OPPPaymentProvider *provider = [OPPPaymentProvider paymentProviderWithMode:providerMode];
[provider submitTransaction:transaction completionHandler:^(OPPTransaction * _Nonnull transaction, NSError * _Nullable error) {
if (error) {
// Handle the error.
} else {
// Process transaction here using Paze processor
}
}];
let transaction = OPPTransaction(paymentParams: paymentParams)
let provider = OPPPaymentProvider(mode: providerMode)
provider.submitTransaction(transaction) { (transaction, error) in
if (error != nil) {
// Handle the error.
} else {
// Process transaction here using Paze processor
}
}
3. Create Paze processor to process transaction.
OPPPazeProcessor *processor = [[OPPPazeProcessor alloc] initWithTransaction:transaction provider:provider];
[processor startPaze:^(OPPTransaction * _Nullable transaction, NSError * _Nullable error) {
if (error) {
// Handle error
} else {
// Get the payment status
}
}];
let pazeProcessor = OPPPazeProcessor(transaction: transaction, provider: provider)
pazeProcessor.startPaze { transaction, error in
if let error = error {
// Handle error
} else {
// Get the payment status
}
}
4. Get the payment status
Finally your app should request the payment status from your server.
For more details you can refer to this document.
SDK & Your Own UI
In this guide we assume that you have already implemented all steps for performing standard mSDK transaction. There are several steps that you have to perform to integrate Paze, which are as follows:
1. Create payment parameters for PAZE using PaymentParams and submit the transaction.
// use the following param to complete the transaction via Paze
PaymentParams paymentParams = new PaymentParams(checkoutId, "PAZE");
// set shopper result URL
paymentParams.setShopperResultUrl("companyname://result");
Transaction transaction = new Transaction(paymentParams);
OppPaymentProvider paymentProvider = new OppPaymentProvider(this, Connect.ProviderMode.TEST);
paymentProvider.submitTransaction(transaction);
// use the following param to complete the transaction via Paze
val paymentParams = PaymentParams(checkoutId, "PAZE")
// set shopper result URL
paymentParams.shopperResultUrl = "companyname://result"
val transaction = Transaction(paymentParams)
val paymentProvider = OppPaymentProvider(this, Connect.ProviderMode.TEST)
paymentProvider.submitTransaction(transaction)
2. Register ActivityResultLauncher object to launch PAZE Processor to process the transaction
To complete PAZE transaction after you receive a transaction object in the callback of step 1, you have to create ActivityResultLaucher object of PazeProcessorActivityResultContract and launch with that transaction.
private final ActivityResultLauncher pazeLauncher = registerForActivityResult(
new PazeProcessorActivityResultContract(), processorActivityResult -> {
// get the payment status
}
);
pazeLauncher.launch(transaction);
private val pazeLauncher: ActivityResultLauncher = registerForActivityResult(
PazeProcessorActivityResultContract()) {
processorActivityResult ->
// get the payment status
}
pazeLauncher.launch(transaction)
3. Get the payment status
Finally your app should request the payment status from your server.
For more details you can refer to this document.