@capgo/capacitor-pay 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,183 @@
1
+ export declare type PayPlatform = 'ios' | 'android' | 'web';
2
+ export declare type ApplePayNetwork = 'amex' | 'chinaUnionPay' | 'discover' | 'eftpos' | 'electron' | 'girocard' | 'interac' | 'jcb' | 'mada' | 'maestro' | 'masterCard' | 'privateLabel' | 'quicPay' | 'suica' | 'visa' | 'vPay' | 'id' | 'cartesBancaires';
3
+ export declare type ApplePayMerchantCapability = '3DS' | 'credit' | 'debit' | 'emv';
4
+ export declare type ApplePaySummaryItemType = 'final' | 'pending';
5
+ export declare type ApplePayContactField = 'emailAddress' | 'name' | 'phoneNumber' | 'postalAddress';
6
+ export declare type ApplePayShippingType = 'shipping' | 'delivery' | 'servicePickup' | 'storePickup';
7
+ export interface ApplePaySummaryItem {
8
+ label: string;
9
+ amount: string;
10
+ type?: ApplePaySummaryItemType;
11
+ }
12
+ export interface ApplePayAvailabilityOptions {
13
+ /**
14
+ * Optional list of payment networks you intend to use.
15
+ * Passing networks determines the return value of `canMakePaymentsUsingNetworks`.
16
+ */
17
+ supportedNetworks?: ApplePayNetwork[];
18
+ }
19
+ export interface ApplePayAvailabilityResult {
20
+ /**
21
+ * Indicates whether the device can make Apple Pay payments in general.
22
+ */
23
+ canMakePayments: boolean;
24
+ /**
25
+ * Indicates whether the device can make Apple Pay payments with the supplied networks.
26
+ */
27
+ canMakePaymentsUsingNetworks: boolean;
28
+ }
29
+ export interface ApplePayPaymentOptions {
30
+ /**
31
+ * Merchant identifier created in the Apple Developer portal.
32
+ */
33
+ merchantIdentifier: string;
34
+ /**
35
+ * Two-letter ISO 3166 country code.
36
+ */
37
+ countryCode: string;
38
+ /**
39
+ * Three-letter ISO 4217 currency code.
40
+ */
41
+ currencyCode: string;
42
+ /**
43
+ * Payment summary items displayed in the Apple Pay sheet.
44
+ */
45
+ paymentSummaryItems: ApplePaySummaryItem[];
46
+ /**
47
+ * Card networks to support.
48
+ */
49
+ supportedNetworks: ApplePayNetwork[];
50
+ /**
51
+ * Merchant payment capabilities. Defaults to ['3DS'] when omitted.
52
+ */
53
+ merchantCapabilities?: ApplePayMerchantCapability[];
54
+ /**
55
+ * Contact fields that must be supplied for shipping.
56
+ */
57
+ requiredShippingContactFields?: ApplePayContactField[];
58
+ /**
59
+ * Contact fields that must be supplied for billing.
60
+ */
61
+ requiredBillingContactFields?: ApplePayContactField[];
62
+ /**
63
+ * Controls the shipping flow presented to the user.
64
+ */
65
+ shippingType?: ApplePayShippingType;
66
+ /**
67
+ * Optional ISO 3166 country codes where the merchant is supported.
68
+ */
69
+ supportedCountries?: string[];
70
+ /**
71
+ * Optional opaque application data passed back in the payment token.
72
+ */
73
+ applicationData?: string;
74
+ }
75
+ export interface ApplePayContact {
76
+ name?: {
77
+ givenName?: string;
78
+ familyName?: string;
79
+ middleName?: string;
80
+ namePrefix?: string;
81
+ nameSuffix?: string;
82
+ nickname?: string;
83
+ };
84
+ emailAddress?: string;
85
+ phoneNumber?: string;
86
+ postalAddress?: {
87
+ street?: string;
88
+ city?: string;
89
+ state?: string;
90
+ postalCode?: string;
91
+ country?: string;
92
+ isoCountryCode?: string;
93
+ subAdministrativeArea?: string;
94
+ subLocality?: string;
95
+ };
96
+ }
97
+ export interface ApplePayPaymentResult {
98
+ /**
99
+ * Raw payment token encoded as base64 string.
100
+ */
101
+ paymentData: string;
102
+ /**
103
+ * Raw payment token JSON string, useful for debugging.
104
+ */
105
+ paymentString: string;
106
+ /**
107
+ * Payment transaction identifier.
108
+ */
109
+ transactionIdentifier: string;
110
+ paymentMethod: {
111
+ displayName?: string;
112
+ network?: ApplePayNetwork;
113
+ type: 'debit' | 'credit' | 'prepaid' | 'store';
114
+ };
115
+ shippingContact?: ApplePayContact;
116
+ billingContact?: ApplePayContact;
117
+ }
118
+ export declare type GooglePayEnvironment = 'test' | 'production';
119
+ export interface GooglePayAvailabilityOptions {
120
+ /**
121
+ * Environment used to construct the Google Payments client. Defaults to `'test'`.
122
+ */
123
+ environment?: GooglePayEnvironment;
124
+ /**
125
+ * Raw `IsReadyToPayRequest` JSON as defined by the Google Pay API.
126
+ * Supply the card networks and auth methods you intend to support at runtime.
127
+ */
128
+ isReadyToPayRequest?: Record<string, unknown>;
129
+ }
130
+ export interface GooglePayAvailabilityResult {
131
+ /**
132
+ * Indicates whether the Google Pay API is available for the supplied parameters.
133
+ */
134
+ isReady: boolean;
135
+ }
136
+ export interface GooglePayPaymentOptions {
137
+ /**
138
+ * Environment used to construct the Google Payments client. Defaults to `'test'`.
139
+ */
140
+ environment?: GooglePayEnvironment;
141
+ /**
142
+ * Raw `PaymentDataRequest` JSON as defined by the Google Pay API.
143
+ * Provide transaction details, merchant info, and tokenization parameters.
144
+ */
145
+ paymentDataRequest: Record<string, unknown>;
146
+ }
147
+ export interface GooglePayPaymentResult {
148
+ /**
149
+ * Payment data returned by Google Pay.
150
+ */
151
+ paymentData: Record<string, unknown>;
152
+ }
153
+ export interface PayAvailabilityOptions {
154
+ apple?: ApplePayAvailabilityOptions;
155
+ google?: GooglePayAvailabilityOptions;
156
+ }
157
+ export interface PayAvailabilityResult {
158
+ available: boolean;
159
+ platform: PayPlatform;
160
+ apple?: ApplePayAvailabilityResult;
161
+ google?: GooglePayAvailabilityResult;
162
+ }
163
+ export interface PayPaymentOptions {
164
+ apple?: ApplePayPaymentOptions;
165
+ google?: GooglePayPaymentOptions;
166
+ }
167
+ export interface PayPaymentResult {
168
+ platform: Exclude<PayPlatform, 'web'>;
169
+ apple?: ApplePayPaymentResult;
170
+ google?: GooglePayPaymentResult;
171
+ }
172
+ export interface PayPlugin {
173
+ /**
174
+ * Checks whether native pay is available on the current platform.
175
+ * On iOS this evaluates Apple Pay, on Android it evaluates Google Pay.
176
+ */
177
+ isPayAvailable(options?: PayAvailabilityOptions): Promise<PayAvailabilityResult>;
178
+ /**
179
+ * Presents the native pay sheet for the current platform.
180
+ * Provide the Apple Pay configuration on iOS and the Google Pay configuration on Android.
181
+ */
182
+ requestPayment(options: PayPaymentOptions): Promise<PayPaymentResult>;
183
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export type PayPlatform = 'ios' | 'android' | 'web';\n\nexport type ApplePayNetwork =\n | 'amex'\n | 'chinaUnionPay'\n | 'discover'\n | 'eftpos'\n | 'electron'\n | 'girocard'\n | 'interac'\n | 'jcb'\n | 'mada'\n | 'maestro'\n | 'masterCard'\n | 'privateLabel'\n | 'quicPay'\n | 'suica'\n | 'visa'\n | 'vPay'\n | 'id'\n | 'cartesBancaires';\n\nexport type ApplePayMerchantCapability = '3DS' | 'credit' | 'debit' | 'emv';\n\nexport type ApplePaySummaryItemType = 'final' | 'pending';\n\nexport type ApplePayContactField =\n | 'emailAddress'\n | 'name'\n | 'phoneNumber'\n | 'postalAddress';\n\nexport type ApplePayShippingType =\n | 'shipping'\n | 'delivery'\n | 'servicePickup'\n | 'storePickup';\n\nexport interface ApplePaySummaryItem {\n label: string;\n amount: string;\n type?: ApplePaySummaryItemType;\n}\n\nexport interface ApplePayAvailabilityOptions {\n /**\n * Optional list of payment networks you intend to use.\n * Passing networks determines the return value of `canMakePaymentsUsingNetworks`.\n */\n supportedNetworks?: ApplePayNetwork[];\n}\n\nexport interface ApplePayAvailabilityResult {\n /**\n * Indicates whether the device can make Apple Pay payments in general.\n */\n canMakePayments: boolean;\n /**\n * Indicates whether the device can make Apple Pay payments with the supplied networks.\n */\n canMakePaymentsUsingNetworks: boolean;\n}\n\nexport interface ApplePayPaymentOptions {\n /**\n * Merchant identifier created in the Apple Developer portal.\n */\n merchantIdentifier: string;\n /**\n * Two-letter ISO 3166 country code.\n */\n countryCode: string;\n /**\n * Three-letter ISO 4217 currency code.\n */\n currencyCode: string;\n /**\n * Payment summary items displayed in the Apple Pay sheet.\n */\n paymentSummaryItems: ApplePaySummaryItem[];\n /**\n * Card networks to support.\n */\n supportedNetworks: ApplePayNetwork[];\n /**\n * Merchant payment capabilities. Defaults to ['3DS'] when omitted.\n */\n merchantCapabilities?: ApplePayMerchantCapability[];\n /**\n * Contact fields that must be supplied for shipping.\n */\n requiredShippingContactFields?: ApplePayContactField[];\n /**\n * Contact fields that must be supplied for billing.\n */\n requiredBillingContactFields?: ApplePayContactField[];\n /**\n * Controls the shipping flow presented to the user.\n */\n shippingType?: ApplePayShippingType;\n /**\n * Optional ISO 3166 country codes where the merchant is supported.\n */\n supportedCountries?: string[];\n /**\n * Optional opaque application data passed back in the payment token.\n */\n applicationData?: string;\n}\n\nexport interface ApplePayContact {\n name?: {\n givenName?: string;\n familyName?: string;\n middleName?: string;\n namePrefix?: string;\n nameSuffix?: string;\n nickname?: string;\n };\n emailAddress?: string;\n phoneNumber?: string;\n postalAddress?: {\n street?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n isoCountryCode?: string;\n subAdministrativeArea?: string;\n subLocality?: string;\n };\n}\n\nexport interface ApplePayPaymentResult {\n /**\n * Raw payment token encoded as base64 string.\n */\n paymentData: string;\n /**\n * Raw payment token JSON string, useful for debugging.\n */\n paymentString: string;\n /**\n * Payment transaction identifier.\n */\n transactionIdentifier: string;\n paymentMethod: {\n displayName?: string;\n network?: ApplePayNetwork;\n type: 'debit' | 'credit' | 'prepaid' | 'store';\n };\n shippingContact?: ApplePayContact;\n billingContact?: ApplePayContact;\n}\n\nexport type GooglePayEnvironment = 'test' | 'production';\n\nexport interface GooglePayAvailabilityOptions {\n /**\n * Environment used to construct the Google Payments client. Defaults to `'test'`.\n */\n environment?: GooglePayEnvironment;\n /**\n * Raw `IsReadyToPayRequest` JSON as defined by the Google Pay API.\n * Supply the card networks and auth methods you intend to support at runtime.\n */\n isReadyToPayRequest?: Record<string, unknown>;\n}\n\nexport interface GooglePayAvailabilityResult {\n /**\n * Indicates whether the Google Pay API is available for the supplied parameters.\n */\n isReady: boolean;\n}\n\nexport interface GooglePayPaymentOptions {\n /**\n * Environment used to construct the Google Payments client. Defaults to `'test'`.\n */\n environment?: GooglePayEnvironment;\n /**\n * Raw `PaymentDataRequest` JSON as defined by the Google Pay API.\n * Provide transaction details, merchant info, and tokenization parameters.\n */\n paymentDataRequest: Record<string, unknown>;\n}\n\nexport interface GooglePayPaymentResult {\n /**\n * Payment data returned by Google Pay.\n */\n paymentData: Record<string, unknown>;\n}\n\nexport interface PayAvailabilityOptions {\n apple?: ApplePayAvailabilityOptions;\n google?: GooglePayAvailabilityOptions;\n}\n\nexport interface PayAvailabilityResult {\n available: boolean;\n platform: PayPlatform;\n apple?: ApplePayAvailabilityResult;\n google?: GooglePayAvailabilityResult;\n}\n\nexport interface PayPaymentOptions {\n apple?: ApplePayPaymentOptions;\n google?: GooglePayPaymentOptions;\n}\n\nexport interface PayPaymentResult {\n platform: Exclude<PayPlatform, 'web'>;\n apple?: ApplePayPaymentResult;\n google?: GooglePayPaymentResult;\n}\n\nexport interface PayPlugin {\n /**\n * Checks whether native pay is available on the current platform.\n * On iOS this evaluates Apple Pay, on Android it evaluates Google Pay.\n */\n isPayAvailable(options?: PayAvailabilityOptions): Promise<PayAvailabilityResult>;\n /**\n * Presents the native pay sheet for the current platform.\n * Provide the Apple Pay configuration on iOS and the Google Pay configuration on Android.\n */\n requestPayment(options: PayPaymentOptions): Promise<PayPaymentResult>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { PayPlugin } from './definitions';
2
+ declare const Pay: PayPlugin;
3
+ export * from './definitions';
4
+ export { Pay };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const Pay = registerPlugin('Pay', {
3
+ web: () => import('./web').then((m) => new m.PayWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { Pay };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,GAAG,GAAG,cAAc,CAAY,KAAK,EAAE;IAC3C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { PayPlugin } from './definitions';\n\nconst Pay = registerPlugin<PayPlugin>('Pay', {\n web: () => import('./web').then((m) => new m.PayWeb()),\n});\n\nexport * from './definitions';\nexport { Pay };\n"]}
@@ -0,0 +1,6 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { PayAvailabilityOptions, PayAvailabilityResult, PayPaymentOptions, PayPaymentResult, PayPlugin } from './definitions';
3
+ export declare class PayWeb extends WebPlugin implements PayPlugin {
4
+ isPayAvailable(_options?: PayAvailabilityOptions): Promise<PayAvailabilityResult>;
5
+ requestPayment(_options: PayPaymentOptions): Promise<PayPaymentResult>;
6
+ }
@@ -0,0 +1,20 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class PayWeb extends WebPlugin {
3
+ async isPayAvailable(_options) {
4
+ return {
5
+ available: false,
6
+ platform: 'web',
7
+ apple: {
8
+ canMakePayments: false,
9
+ canMakePaymentsUsingNetworks: false,
10
+ },
11
+ google: {
12
+ isReady: false,
13
+ },
14
+ };
15
+ }
16
+ async requestPayment(_options) {
17
+ throw this.unimplemented('Native payments are not implemented on the web. Use a native platform.');
18
+ }
19
+ }
20
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,KAAK,CAAC,cAAc,CAClB,QAAiC;QAEjC,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE;gBACL,eAAe,EAAE,KAAK;gBACtB,4BAA4B,EAAE,KAAK;aACpC;YACD,MAAM,EAAE;gBACN,OAAO,EAAE,KAAK;aACf;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,QAA2B;QAC9C,MAAM,IAAI,CAAC,aAAa,CACtB,wEAAwE,CACzE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n PayAvailabilityOptions,\n PayAvailabilityResult,\n PayPaymentOptions,\n PayPaymentResult,\n PayPlugin,\n} from './definitions';\n\nexport class PayWeb extends WebPlugin implements PayPlugin {\n async isPayAvailable(\n _options?: PayAvailabilityOptions,\n ): Promise<PayAvailabilityResult> {\n return {\n available: false,\n platform: 'web',\n apple: {\n canMakePayments: false,\n canMakePaymentsUsingNetworks: false,\n },\n google: {\n isReady: false,\n },\n };\n }\n\n async requestPayment(_options: PayPaymentOptions): Promise<PayPaymentResult> {\n throw this.unimplemented(\n 'Native payments are not implemented on the web. Use a native platform.',\n );\n }\n}\n"]}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ const Pay = core.registerPlugin('Pay', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.PayWeb()),
7
+ });
8
+
9
+ class PayWeb extends core.WebPlugin {
10
+ async isPayAvailable(_options) {
11
+ return {
12
+ available: false,
13
+ platform: 'web',
14
+ apple: {
15
+ canMakePayments: false,
16
+ canMakePaymentsUsingNetworks: false,
17
+ },
18
+ google: {
19
+ isReady: false,
20
+ },
21
+ };
22
+ }
23
+ async requestPayment(_options) {
24
+ throw this.unimplemented('Native payments are not implemented on the web. Use a native platform.');
25
+ }
26
+ }
27
+
28
+ var web = /*#__PURE__*/Object.freeze({
29
+ __proto__: null,
30
+ PayWeb: PayWeb
31
+ });
32
+
33
+ exports.Pay = Pay;
34
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Pay = registerPlugin('Pay', {\n web: () => import('./web').then((m) => new m.PayWeb()),\n});\nexport * from './definitions';\nexport { Pay };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PayWeb extends WebPlugin {\n async isPayAvailable(_options) {\n return {\n available: false,\n platform: 'web',\n apple: {\n canMakePayments: false,\n canMakePaymentsUsingNetworks: false,\n },\n google: {\n isReady: false,\n },\n };\n }\n async requestPayment(_options) {\n throw this.unimplemented('Native payments are not implemented on the web. Use a native platform.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;AAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC1D,CAAC;;ACFM,MAAM,MAAM,SAASC,cAAS,CAAC;AACtC,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,OAAO;AACf,YAAY,SAAS,EAAE,KAAK;AAC5B,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,KAAK,EAAE;AACnB,gBAAgB,eAAe,EAAE,KAAK;AACtC,gBAAgB,4BAA4B,EAAE,KAAK;AACnD,aAAa;AACb,YAAY,MAAM,EAAE;AACpB,gBAAgB,OAAO,EAAE,KAAK;AAC9B,aAAa;AACb,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,wEAAwE,CAAC;AAC1G,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,37 @@
1
+ var capacitorPay = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const Pay = core.registerPlugin('Pay', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.PayWeb()),
6
+ });
7
+
8
+ class PayWeb extends core.WebPlugin {
9
+ async isPayAvailable(_options) {
10
+ return {
11
+ available: false,
12
+ platform: 'web',
13
+ apple: {
14
+ canMakePayments: false,
15
+ canMakePaymentsUsingNetworks: false,
16
+ },
17
+ google: {
18
+ isReady: false,
19
+ },
20
+ };
21
+ }
22
+ async requestPayment(_options) {
23
+ throw this.unimplemented('Native payments are not implemented on the web. Use a native platform.');
24
+ }
25
+ }
26
+
27
+ var web = /*#__PURE__*/Object.freeze({
28
+ __proto__: null,
29
+ PayWeb: PayWeb
30
+ });
31
+
32
+ exports.Pay = Pay;
33
+
34
+ return exports;
35
+
36
+ })({}, capacitorExports);
37
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Pay = registerPlugin('Pay', {\n web: () => import('./web').then((m) => new m.PayWeb()),\n});\nexport * from './definitions';\nexport { Pay };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PayWeb extends WebPlugin {\n async isPayAvailable(_options) {\n return {\n available: false,\n platform: 'web',\n apple: {\n canMakePayments: false,\n canMakePaymentsUsingNetworks: false,\n },\n google: {\n isReady: false,\n },\n };\n }\n async requestPayment(_options) {\n throw this.unimplemented('Native payments are not implemented on the web. Use a native platform.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;IAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1D,CAAC;;ICFM,MAAM,MAAM,SAASC,cAAS,CAAC;IACtC,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,OAAO;IACf,YAAY,SAAS,EAAE,KAAK;IAC5B,YAAY,QAAQ,EAAE,KAAK;IAC3B,YAAY,KAAK,EAAE;IACnB,gBAAgB,eAAe,EAAE,KAAK;IACtC,gBAAgB,4BAA4B,EAAE,KAAK;IACnD,aAAa;IACb,YAAY,MAAM,EAAE;IACpB,gBAAgB,OAAO,EAAE,KAAK;IAC9B,aAAa;IACb,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,wEAAwE,CAAC;IAC1G,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,67 @@
1
+ # Apple Pay Setup Guide
2
+
3
+ This document walks through the steps required to enable Apple Pay in a project that uses `@capgo/capacitor-pay`. Complete every step before calling the plugin at runtime.
4
+
5
+ ## 1. Accounts and prerequisites
6
+
7
+ - Enroll in the Apple Developer Program using the same Apple ID that signs your iOS builds.
8
+ - Ensure your app bundle identifier is reserved in App Store Connect.
9
+ - Use Xcode 14 or newer, and install the latest iOS SDK.
10
+
11
+ ## 2. Create a Merchant ID
12
+
13
+ 1. Open [Apple Developer > Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list).
14
+ 2. In **Identifiers**, click the plus button and choose **Merchant IDs**.
15
+ 3. Enter a description and a unique identifier following the pattern `merchant.com.yourcompany.app`.
16
+ 4. Save the identifier. This Merchant ID will later be referenced in code as `merchantIdentifier`.
17
+
18
+ ## 3. Add the Apple Pay capability
19
+
20
+ 1. Open the iOS workspace or the Capacitor iOS project in Xcode.
21
+ 2. Select the app target, open the **Signing & Capabilities** tab, and click **+ Capability**.
22
+ 3. Choose **Apple Pay**, then select the merchant ID you created earlier.
23
+ 4. Xcode generates an `App.entitlements` file with the `com.apple.developer.in-app-payments` entry. Confirm that the Merchant ID is listed.
24
+
25
+ ## 4. Generate the payment processing certificate
26
+
27
+ 1. In the developer portal, open the Merchant ID details.
28
+ 2. Under **Payment Processing Certificate**, click **Create Certificate**.
29
+ 3. Download the certificate signing request (`.certSigningRequest`) generated by Xcode (`Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority`).
30
+ 4. Upload the CSR, download the resulting certificate, and double-click it to add it to your keychain.
31
+ 5. Export the certificate as a `.cer` file and keep it for your payment service provider if required.
32
+
33
+ ## 5. Configure the payment processor or gateway
34
+
35
+ Most processors request the Merchant ID and the payment processing certificate. Provide:
36
+
37
+ - Merchant identifier (e.g., `merchant.com.yourcompany.app`)
38
+ - Business legal name and contact information
39
+ - The `.cer` file generated in the previous step
40
+
41
+ Follow your processor’s onboarding steps to complete tokenization.
42
+
43
+ ## 6. Verify domain association (if applicable)
44
+
45
+ If your payment processor requires Apple Pay on the web, add your site domain in the developer portal and upload the `apple-developer-merchantid-domain-association` file to `https://<domain>/.well-known/`.
46
+
47
+ ## 7. Update the Capacitor project
48
+
49
+ - In `Pay.requestPayment`, set `merchantIdentifier` to the Merchant ID created earlier.
50
+ - Provide a list of networks (`supportedNetworks`) that matches the networks approved by your processor.
51
+ - Include realistic summary items and ensure the total is a final amount.
52
+
53
+ ## 8. Build and test on device
54
+
55
+ - Apple Pay is unavailable on the iOS simulator. Use a real device signed into an Apple ID with a supported card in Wallet.
56
+ - Install the build via Xcode or TestFlight.
57
+ - Trigger `Pay.isPayAvailable()` to ensure the device reports `available: true`.
58
+ - Call `Pay.requestPayment` and verify that the Apple Pay sheet loads and returns a payment token.
59
+
60
+ ## 9. Move to production
61
+
62
+ - Disable the sandbox merchant environment in your processor dashboard once you’re ready for production.
63
+ - Rebuild the app using distribution certificates and submit the build for App Review.
64
+ - Provide Apple with sample test accounts or screenshots showing the Apple Pay flow, if requested.
65
+
66
+ After these steps the Capacitor plugin can successfully authorize payments using Apple Pay.
67
+
@@ -0,0 +1,70 @@
1
+ # Google Pay Setup Guide
2
+
3
+ Follow this checklist to enable Google Pay for the Android implementation of `@capgo/capacitor-pay`.
4
+
5
+ ## 1. Requirements
6
+
7
+ - A Google Play Console account with the correct app package name registered.
8
+ - Access to the Google Pay & Wallet Console using the same Google account.
9
+ - Android Studio Hedgehog (or newer) with the latest Android SDK tools.
10
+ - Test devices running Google Play services.
11
+
12
+ ## 2. Create a Google Pay business profile
13
+
14
+ 1. Open the [Google Pay & Wallet Console](https://pay.google.com/business/console/).
15
+ 2. Create or select a business profile that matches your legal entity.
16
+ 3. Provide the merchant name that will appear in the Google Pay sheet.
17
+ 4. Verify any requested documentation to enable production processing.
18
+
19
+ ## 3. Configure payment processing
20
+
21
+ Decide between a **gateway** (e.g., Stripe, Adyen, Braintree) or **direct** processor integration:
22
+
23
+ - For gateway tokenization, collect the `gateway` and `gatewayMerchantId` values.
24
+ - For direct tokenization, create and store your public/private key pair and obtain your processor’s parameters.
25
+
26
+ Document these values because they must be inserted into the `paymentDataRequest.tokenizationSpecification`.
27
+
28
+ ## 4. Register test cards and test users
29
+
30
+ 1. In the Google Pay console, add testing cards or enable the demo cards.
31
+ 2. On every test device, add one of the sandbox cards to Google Wallet.
32
+ 3. Install the latest Google Play services if prompted.
33
+
34
+ ## 5. Update the Android project
35
+
36
+ 1. Ensure `com.google.android.gms:play-services-wallet` is included in `android/build.gradle` (already added by the plugin).
37
+ 2. In your app code, build a `paymentDataRequest` JSON matching the processor configuration:
38
+ - `apiVersion` and `apiVersionMinor`
39
+ - `allowedPaymentMethods` with card networks and authentication methods
40
+ - `transactionInfo` containing price, currency, and country
41
+ - `merchantInfo` for user-facing display
42
+ 3. Provide this JSON to `Pay.requestPayment({ google: { ... } })`.
43
+
44
+ ## 6. Use the correct environment
45
+
46
+ - During development, set `environment: 'test'` and rely on test card numbers.
47
+ - For production builds, switch to `environment: 'production'` and ensure your business profile is approved.
48
+
49
+ ## 7. Add required app manifest entries
50
+
51
+ Google Pay itself does not require additional manifest permissions beyond Internet access, but your processor may require network security configuration or HTTPS endpoints. Confirm:
52
+
53
+ - `android:usesCleartextTraffic="false"` (or a network security config for dev environments).
54
+ - Any callback URLs you use are served over HTTPS.
55
+
56
+ ## 8. Test on device
57
+
58
+ 1. Build and install the Android app on a device with the sandbox card.
59
+ 2. Call `Pay.isPayAvailable` with the same `isReadyToPayRequest` JSON you will use in production.
60
+ 3. Confirm the method returns `available: true` and `google.isReady: true`.
61
+ 4. Trigger `Pay.requestPayment` and complete a transaction with a test card to verify token payloads.
62
+
63
+ ## 9. Launch to production
64
+
65
+ 1. Submit your app for Google Play review with Google Pay screenshots or screen recordings if requested.
66
+ 2. Promote the business profile to production in the Google Pay & Wallet Console.
67
+ 3. Switch the runtime configuration to the production environment and merchant details.
68
+
69
+ Completing these steps prepares your Android app to process payments through Google Pay using the Capacitor plugin.
70
+