### Install KKiaPay PHP SDK Source: https://docs.kkiapay.me/v1/en-1.0.0/plugin-et-sdk/admin-sdks-server-side/php-admin-sdk Use this composer command to install the PHP Admin SDK. ```bash composer require kkiapay/kkiapay-php:dev-master ``` -------------------------------- ### Install Node.js Admin SDK Source: https://docs.kkiapay.me/v1/plugin-et-sdk/admin-sdks-server-side/node.js-admin-sdk Install the Node.js Admin SDK using npm. ```bash $ npm i @kkiapay-org/nodejs-sdk ``` -------------------------------- ### Payment Request Example Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-android Example of how to initiate a payment request using the KKiapay SDK. ```APIDOC ## Example ```gradle import android.content.Intent import android.os.Bundle import android.widget.Button import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import co.opensi.kkiapay.uikit.Kkiapay ``` ```gradle class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } override fun onStart() { super.onStart() // Configure the listener for payment status Kkiapay.get().setListener { status, transactionId -> // This code will execute at the end of the payment Toast.makeText( this@MainActivity, "Transaction: ${status.name} -> $transactionId", Toast.LENGTH_LONG ).show() } } override fun onResume() { super.onResume() val testButtonWithKkiapay = findViewById ``` -------------------------------- ### Add Web Script Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-flutter Include the KKiaPay script in your index.html file for web support. ```html ajouter ce script dans le fichier index.html ``` -------------------------------- ### KKiaPay WebComponent Integration Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-javascript Use this WebComponent in your HTML to create a payment button. Replace placeholder values with your actual amount, API key, and callback URL. The 'sandbox' attribute enables test mode. ```html ``` -------------------------------- ### Include KKiaPay SDK Script Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-javascript Add this script tag before the closing tag in your HTML to include the KKiaPay Javascript SDK. ```html ``` -------------------------------- ### Import KKiaPay Functions Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-javascript/integration-de-kkiapay-dans-une-application-svelte Import the required functions from the KKiaPay library into your Svelte component for payment integration. ```javascript import { openKkiapayWidget, addKkiapayListener, removeKkiapayListener, } from "kkiapay"; ``` -------------------------------- ### Open KKiaPay Widget via Javascript Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-javascript Call the 'openKkiapayWidget' function in your Javascript code to programmatically open the payment widget. Ensure all required parameters like amount, key, and callback are provided. ```javascript openKkiapayWidget({"amount":"1","position":"right","callback":"", "data":"" "theme":"green", "key":""}) ``` -------------------------------- ### Add SDK Dependency to build.gradle Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-android Include the KKiapay SDK as a dependency in your application's `build.gradle` file. ```gradle implementation 'com.github.kkiapay:android-sdk:' ``` -------------------------------- ### Handle Payment Success Event Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-javascript/integration-de-kkiapay-dans-une-application-svelte Subscribe to the 'success' event using addKkiapayListener within the onMount hook to be notified when a payment is successfully completed. This ensures the listener is active when the component is mounted. ```javascript ``` -------------------------------- ### Trigger Payment Flow Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-flutter Initiate the payment process using the configured instance for mobile or web. ```dart Navigator.push( context, MaterialPageRoute(builder: (context) => kkiapay), ); ``` ```dart KkiapayFlutterSdkPlatform.instance.pay( kkiapay, context, callback ); ``` -------------------------------- ### Souscrire aux événements de paiement Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-swift-pour-ios Utilisation de la fonction onReceive pour écouter le statut de la transaction et gérer les résultats. ```swift kkiaPay.onReceive(self.viewModel.paymentData.receive(on: RunLoop.main)){paymentData in if(paymentData.isSuccessful){ print("The amount of the transaction is " + paymentData.amount+" with id "+paymentData.transactionId) showWebView = false }else{ print("The payment was not successful") } } ``` -------------------------------- ### Use KKiaPay Hook for Payment Source: https://docs.kkiapay.me/v1/plugin-et-sdk/sdk-react-native Utilize the useKkiapay hook to access payment functions like openKkiapayWidget, addSuccessListener, and addFailedListener. Set up listeners in a useEffect hook. ```javascript // Dans le composant -- TestComponent import { useKkiapay } from '@kkiapay-org/react-native-sdk'; import { useEffect } from 'react'; import { Button, View } from 'react-native'; export default function TestComponent() { const { openKkiapayWidget, addSuccessListener, addFailedListener } = useKkiapay(); useEffect(() => { addSuccessListener(data => { console.log('data ', data); }); addFailedListener(data => { console.log('data ', data); }); }, []); const openWidget = () => { openKkiapayWidget({ amount: 4000, api_key: "xxxxxxxxxxxxxxxxxx", sandbox: true, email: "randomgail@gmail.com", phone: "97000000", }); }; return (