Using KKiaPay with Nuxt.js
Installation
Please run the following command :
npm install kkiapay@latestAdd kkiapay plugin
// plugins/kkiapay.client.ts
import { defineNuxtPlugin } from "#app";
import * as kkiapayModule from "kkiapay";
export default defineNuxtPlugin(() => {
return {
provide: {
kkiapay: kkiapayModule,
},
};
});Usage
Define a function that will display the KKiaPay Widget :
You can now use this function within your view template to display the payment interface :
Important !
To avoid fraud, perform the server-side verification of the transaction operation. Learn more about the Admin SDKs (Server-Side).
You can subscribe to payment transaction events with the addKkiapayListener function and proceed as follows :
In order to avoid memory leaks, we will need to delete the callback when the component is destroyed :
Last updated
Was this helpful?