KKIAPAY
DashboardSupport
EN 1.0.0
EN 1.0.0
  • Introduction
  • Home
    • KKiaPay
  • Account
    • Create an account
    • Account activation
    • KKiaPay Sandbox : Test Guide
    • Using KKiaPay
  • Payements
    • Supported Currencies
    • Payment Methods
    • Fees
    • Payouts
    • Transactions
  • Plugin and SDK
    • Prestashop
    • WooCommerce
    • Wordpress Give
    • Wordpress Jobster
    • Javascript SDK
      • Using KKiaPay with Vue.js
      • Using KKiaPay with React.js
      • Using KKiaPay with Angular
      • Using KKiaPay with Svelte
    • Android SDK
    • SDK Flutter
    • SDK React-Native
    • SDK Swift for iOS
    • Admin SDKs (Server-side)
      • PHP Admin SDK
      • Python Admin SDK
      • Node.js Admin SDK
  • KKIAPAY SERVICES
    • KKiaPay Direct
    • KKiaPay POS
  • Dashboard
    • General Presentation
    • Menu
      • Transactions
      • Customers
      • Payouts
      • Developers
      • Settings
    • Webhook
  • Security
    • Security provisions
    • Suspicious email and website
    • Untitled
Powered by GitBook
On this page
  • Installation
  • Usage

Was this helpful?

  1. Plugin and SDK

SDK React-Native

Installation

npx expo install react-native-webview
npm install @kkiapay-org/react-native-sdk

Usage

  1. Import KKiaPay provider to access all context's features

// In your app file -- App
import { KkiapayProvider } from '@kkiapay-org/react-native-sdk';

import TestComponent from './TestComponent';

export default function App() {
  return (
    <KkiapayProvider>
      <TestComponent />
    </KkiapayProvider>
  );
}
  1. Use the useKkiapay hook and get all available functions

// In your component -- 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 (
    <View>
      <Button title="Pay now" onPress={openWidget} />
    </View>
  );
}

PreviousSDK FlutterNextSDK Swift for iOS

Last updated 8 months ago

Was this helpful?