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"
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];
[self.provider submitTransaction:transaction completionHandler:^(OPPTransaction * _Nonnull transaction, NSError * _Nullable error) {
if (error) {
// Handle the error.
} else {
// Get the Payment Status
}
}];
let transaction = OPPTransaction(paymentParams: paymentParams)
provider.submitTransaction(transaction) { (transaction, error) in
if (error != nil) {
// Handle the error.
} else {
// Get the Payment Status
}
}
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.
Android
Ready-to-Use UI
Create the CheckoutSettings with TAMARA payment brand.
Set<String> paymentBrands = new HashSet<>();
paymentBrands.add("TAMARA");
CheckoutSettings checkoutSettings = new CheckoutSettings(
checkoutId,
paymentBrands,
providerMode
);
val paymentBrands = hashSetOf("TAMARA")
val checkoutSettings = CheckoutSettings(
checkoutId,
paymentBrands,
providerMode
)
SDK & Your Own UI
1. Send transaction with payment parameters
First of all, create PaymentParams object and submit a transaction and Server will return:
- redirect url to redirect transaction to the Tamara.
// use the following param to complete the transaction via Tamara
PaymentParams paymentParams = new PaymentParams(checkoutId, "TAMARA");
// set shopper result URL
paymentParams.setShopperResultUrl("companyname://result");
Transaction transaction = new Transaction(paymentParams);
paymentProvider.submitTransaction(transaction);
// use the following param to complete the transaction via tamara
val paymentParams = PaymentParams(checkoutId, "TAMARA")
// set shopper result URL
paymentParams.shopperResultUrl = "companyname://result"
val transaction = Transaction(paymentParams)
paymentProvider.submitTransaction(transaction)
NOTE: To learn more about shopper result url refer to Asynchronous Payments guide.
2. Implement ITransactionListener
Now, let the class implement the ITransactionListener interface. Implement the following ITransactionListener methods:
Open redirect url and handle the final redirect
You can open this redirect url in your webView present in fragment/activity.
@Override
public void transactionCompleted(Transaction transaction) {
if ("TAMARA".equals(transaction.getPaymentParams().getPaymentBrand())){
// open this redirectUrl in webview , which should be present in fragment/activity of in app
String redirectUrl = transaction.getRedirectUrl();
} else {
// code for other brands
}
}
@Override
public void transactionFailed(@NonNull Transaction transaction, @NonNull PaymentError error) {
// show error message
}
override fun transactionCompleted(transaction: Transaction) {
if ("TAMARA" == transaction.paymentParams.paymentBrand) {
// open this redirectUrl in webview , which should be present in fragment/activity of in app
val redirectUrl = transaction.getRedirectUrl
} else {
// code for other brands
}
}
override fun transactionFailed(transaction: Transaction, error: PaymentError) {
// show error message
}
NOTE: Please avoid using Chrome Custom Tabs to open the Tamara payment page. The redirection to the app after a successful payment from Tamara doesn't work seamlessly in Chrome Custom Tab.
To ensure a smooth user experience, you must load the Tamara URL within a WebView that is embedded in your app. This WebView should be implemented within a Fragment or Activity of your application.
3. Request payment status
Once shopper complete/verify the payment. After this the shopper is redirected back to the app and the status of the payment can be queried.