There are two ways to install the Tabby Payment Gateway extension:
For the latest version, you can install the package using Yarn:
yarn add @akinon/pz-tabby-extension
You can also use the following command to install the extension with the latest plugins:
npx @akinon/projectzero@latest --plugins
Once the extension is installed, you can easily integrate the Tabby payment gateway into your application. Here's an example of how to use it.
-
Navigate to the
src/app/[commerce]/[locale]/[currency]/payment-gateway/tabby/
directory. -
Create a file named
page.tsx
and include the following code:
import { TabbyPaymentGateway } from '@akinon/pz-tabby-extension';
const TabbyGateway = async ({
searchParams: { sessionId },
params: { currency, locale }
}: {
searchParams: Record<string, string>;
params: { currency: string; locale: string };
}) => {
return (
<TabbyPaymentGateway
sessionId={sessionId}
currency={currency}
locale={locale}
extensionUrl={process.env.TABBY_EXTENSION_URL}
hashKey={process.env.TABBY_HASH_KEY}
/>
);
};
export default TabbyGateway;
Add these variables to your .env
file
TABBY_EXTENSION_URL=<your_extension_url>
TABBY_HASH_KEY=<your_hash_key>