Tamara
Follow this guide to add Tamara to your checkout.
- TAMARA - Tamara
Payment method availability:
- Tamara since mSDK version 7.0.0
iOS
There is no special handling is needed. Please follow the asynchronous payment brands integration page.
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.