capacitor-square-inapp-payments
TypeScript icon, indicating that this package has built-in type declarations

0.9.2-beta.1 • Public • Published

@MeikoTech/capacitor-square-inapp-payments

Integrate with Square Payments SDK

Package Version Capacitor Version
5.X 5.X

Install

Version 5.X is compatible with Capacitor 5.X

npm install capacitor-square-inapp-payments
npx cap sync

IOS You'll need to add your Square Application ID to your AppDelegate Square Documentation.

ANDROID Open the plugins AndroidManifest.xml and update the Square Application ID

Usage

Card details response flow - React.js example

import { CapacitorSquareInappPayments } from '@MeikoTech/capacitor-square-inapp-payments';

const Home = () => {
  const startCardEntry = async () => {
    await CapacitorSquareInappPayments.startCardPayment();
  };

  const startGooglePay = async () => {
    await CapacitorSquareInappPayments.startGooglePay({
      chargeAmount: '5.12',
      currencyCode: 'CAD',
    });
  };

  const startApplePay = async () => {
    await CapacitorSquareInappPayments.startApplePay({
      chargeAmount: '5.12',
      countryCode: 'CA',
      currencyCode: 'CAD',
      merchantId: 'YOUR APPLE MERCHANT ID',
    });
  };
};

API

startCardEntry(...)

startCardEntry() => any

Returns: any


startGooglePay(...)

startGooglePay({ chargeAmount, currencyCode }) => any
Param Type
options { chargeAmount: string; currencyCode: string; }

Returns: any


startApplePay(...)

startApplePay({ chargeAmount, currencyCode, countryCode, merchantId }) => any
Param Type
options { chargeAmount: string; currencyCode: string; countryCode: string; merchantId: string; }

Returns: any


addListener(...)

addListener(eventName: 'cardDetailsSuccess', (cardDetails) => Promise
Param Type
eventName "cardDetailsSuccess"
listenerFunc ({ paymentMethod, cardNonce, cardBrand, cardLastFour }) => void

Returns: any


Interfaces

PluginListenerHandle

Prop Type
remove () => any

Readme

Keywords

Package Sidebar

Install

npm i capacitor-square-inapp-payments

Weekly Downloads

0

Version

0.9.2-beta.1

License

MIT

Unpacked Size

33.2 kB

Total Files

26

Last publish

Collaborators

  • meikotech