Tamara Payment Gateway
The TamaraPaymentGateway component enables seamless integration of the Tamara payment method into your e-commerce checkout experience. Designed for the Akinon ProjectZero ecosystem, this extension provides a secure, localized, and fully customizable payment flow for merchants using Tamara as a payment provider.
With support for custom rendering via the renderer prop, you can tailor the user interface to match your brand's requirements, while still benefiting from Tamara’s robust backend logic, including availability checks, secure hash validation, and auto-submitting forms.
This guide will walk you through installation, implementation, prop configuration, UI customization, and API integration to help you get up and running quickly with Tamara in your checkout process.
Installation Method
You can use the following command to install the extension with the latest plugins:
npx @akinon/projectzero@latest --pluginsUsage
Navigate to your payment gateway route:
src/app/[commerce]/[locale]/[currency]/payment-gateway/tamara/page.tsxCreate page.tsx:
import { TamaraPaymentGateway } from '@akinon/pz-tamara-extension';
const TamaraGateway = async ({
searchParams: { sessionId },
params: { currency, locale }
}: {
searchParams: Record<string, string>;
params: { currency: string; locale: string };
}) => {
return (
<TamaraPaymentGateway
sessionId={sessionId}
currency={currency}
locale={locale}
extensionUrl={process.env.TAMARA_EXTENSION_URL}
hashKey={process.env.TAMARA_HASH_KEY}
/>
);
};
export default TamaraGateway;Props
sessionId
string
Yes
Session ID of the current checkout/payment flow.
currency
string
Yes
Active currency (e.g., "AED").
locale
string
Yes
Active locale (e.g., "en", "ar").
extensionUrl
string
Yes
URL of the Tamara extension endpoint.
hashKey
string
Yes
Secret hash key for request/response validation.
renderer
TamaraRendererProps
Optional
Object with custom render methods for UI customization.
Customizing the Tamara Component
Example usage of renderer prop:
Renderer API
API Routes
Check Availability API
Create the following file:
This route handles Tamara availability checks for:
Country
Phone number
Order amount
Currency
The logic is secured with hash verification.
Availability Check (Redux Hook)
Use the following mutation to check Tamara availability:
Response Fields
has_availability:booleansalt:stringhash:string
Configuration
Add the following environment variables to your .env file:
Last updated
Was this helpful?

