0.9.2-beta.1 • Published 2 years ago
capacitor-square-inapp-payments v0.9.2-beta.1
@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 syncIOS 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() => anyReturns: 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 |
0.9.2-beta.2
2 years ago
0.9.2-beta.1
2 years ago
0.1.9-beta.2
2 years ago
0.1.9-beta.1
2 years ago
0.1.8-beta.1
2 years ago