0.9.2-beta.1 • Published 10 months ago

capacitor-square-inapp-payments v0.9.2-beta.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@MeikoTech/capacitor-square-inapp-payments

Integrate with Square Payments SDK

Package VersionCapacitor Version
5.X5.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
ParamType
options{ chargeAmount: string; currencyCode: string; }

Returns: any


startApplePay(...)

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

Returns: any


addListener(...)

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

Returns: any


Interfaces

PluginListenerHandle

PropType
remove() => any
0.9.2-beta.2

10 months ago

0.9.2-beta.1

10 months ago

0.1.9-beta.2

10 months ago

0.1.9-beta.1

10 months ago

0.1.8-beta.1

10 months ago