expo-tappay-line-pay
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Expo Tappay - Line Pay

Installation

npx expo install expo-tappay-line-pay

Prerequisites

  • Please install expo-tappay-direct in your project, becasue it is a dependency of this package
npx expo install expo-tappay-direct
  • Please add the following config in your app.json
{
  "expo": {
    "plugins": [
      [
        "expo-tappay-line-pay"
      ]
    ]
  }
}

Usage

Check if Line Pay is available

import * as ExpoTappayLinePay from "expo-tappay-line-pay";

const isAvailable = ExpoTappayLinePay.isLinePayAvailable();
console.log(isAvailable);

Setup Tappay (You can get credentials from Tappay)

import * as ExpoTappayLinePay from "expo-tappay-line-pay";

const appId = 11340; // Replace with your own appId
const appKey = "app_whdEWBH8e8Lzy4N6BysVRRMILYORF6UxXbiOFsICkz0J9j1C0JUlCHv1tVJC"; // Replace with your own appKey
const serverType = "sandbox"; // Replace with your own serverType (sandbox or production)
ExpoTappayLinePay.setupTappay({ appId, appKey, serverType });

Setup Line Pay

import * as ExpoTappayLinePay from "expo-tappay-line-pay";

const callbackUrl = "expotappaylinepayexample://linepay"; // Replace with your own callbackUrl (e.g. expotappaylinepayexample://linepay)
ExpoTappayLinePay.setupLine(callbackUrl);

Get Prime

import * as ExpoTappayLinePay from "expo-tappay-line-pay";

const prime = await ExpoTappayLinePay.getPrime();
console.log(prime);

Redirect to Payment

import * as ExpoTappayLinePay from "expo-tappay-line-pay";
const payment = await ExpoTappayLinePay.redirect(paymentUrl); // You will get payment result from this function

Dependents (0)

Package Sidebar

Install

npm i expo-tappay-line-pay

Weekly Downloads

5

Version

0.1.4

License

MIT

Unpacked Size

504 kB

Total Files

47

Last publish

Collaborators

  • stanma0716