@capgo/capacitor-pay 8.0.2 → 8.0.4

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.
package/README.md CHANGED
@@ -324,7 +324,7 @@ Get the native Capacitor plugin version
324
324
 
325
325
  #### ApplePayNetwork
326
326
 
327
- <code>'amex' | 'chinaUnionPay' | 'discover' | 'eftpos' | 'electron' | 'girocard' | 'interac' | 'jcb' | 'mada' | 'maestro' | 'masterCard' | 'privateLabel' | 'quicPay' | 'suica' | 'visa' | 'vPay' | 'id' | 'cartesBancaires'</code>
327
+ <code>'AmEx' | 'Bancomat' | 'Bancontact' | 'PagoBancomat' | 'CarteBancaire' | 'CarteBancaires' | 'CartesBancaires' | 'ChinaUnionPay' | 'Dankort' | 'Discover' | 'Eftpos' | 'Electron' | 'Elo' | 'girocard' | 'Himyan' | 'Interac' | 'iD' | 'Jaywan' | 'JCB' | 'mada' | 'Maestro' | 'MasterCard' | 'Meeza' | 'Mir' | 'MyDebit' | 'NAPAS' | 'BankAxept' | 'PostFinanceAG' | 'PrivateLabel' | 'QUICPay' | 'Suica' | 'Visa' | 'VPay'</code>
328
328
 
329
329
 
330
330
  #### GooglePayEnvironment
@@ -26,7 +26,7 @@ import org.json.JSONObject;
26
26
  @CapacitorPlugin(name = "Pay")
27
27
  public class PayPlugin extends Plugin {
28
28
 
29
- private final String pluginVersion = "8.0.2";
29
+ private final String pluginVersion = "8.0.4";
30
30
 
31
31
  private static final int LOAD_PAYMENT_DATA_REQUEST_CODE = 8001;
32
32
 
package/dist/docs.json CHANGED
@@ -581,23 +581,55 @@
581
581
  "docs": "",
582
582
  "types": [
583
583
  {
584
- "text": "'amex'",
584
+ "text": "'AmEx'",
585
585
  "complexTypes": []
586
586
  },
587
587
  {
588
- "text": "'chinaUnionPay'",
588
+ "text": "'Bancomat'",
589
589
  "complexTypes": []
590
590
  },
591
591
  {
592
- "text": "'discover'",
592
+ "text": "'Bancontact'",
593
593
  "complexTypes": []
594
594
  },
595
595
  {
596
- "text": "'eftpos'",
596
+ "text": "'PagoBancomat'",
597
597
  "complexTypes": []
598
598
  },
599
599
  {
600
- "text": "'electron'",
600
+ "text": "'CarteBancaire'",
601
+ "complexTypes": []
602
+ },
603
+ {
604
+ "text": "'CarteBancaires'",
605
+ "complexTypes": []
606
+ },
607
+ {
608
+ "text": "'CartesBancaires'",
609
+ "complexTypes": []
610
+ },
611
+ {
612
+ "text": "'ChinaUnionPay'",
613
+ "complexTypes": []
614
+ },
615
+ {
616
+ "text": "'Dankort'",
617
+ "complexTypes": []
618
+ },
619
+ {
620
+ "text": "'Discover'",
621
+ "complexTypes": []
622
+ },
623
+ {
624
+ "text": "'Eftpos'",
625
+ "complexTypes": []
626
+ },
627
+ {
628
+ "text": "'Electron'",
629
+ "complexTypes": []
630
+ },
631
+ {
632
+ "text": "'Elo'",
601
633
  "complexTypes": []
602
634
  },
603
635
  {
@@ -605,11 +637,23 @@
605
637
  "complexTypes": []
606
638
  },
607
639
  {
608
- "text": "'interac'",
640
+ "text": "'Himyan'",
641
+ "complexTypes": []
642
+ },
643
+ {
644
+ "text": "'Interac'",
609
645
  "complexTypes": []
610
646
  },
611
647
  {
612
- "text": "'jcb'",
648
+ "text": "'iD'",
649
+ "complexTypes": []
650
+ },
651
+ {
652
+ "text": "'Jaywan'",
653
+ "complexTypes": []
654
+ },
655
+ {
656
+ "text": "'JCB'",
613
657
  "complexTypes": []
614
658
  },
615
659
  {
@@ -617,39 +661,55 @@
617
661
  "complexTypes": []
618
662
  },
619
663
  {
620
- "text": "'maestro'",
664
+ "text": "'Maestro'",
665
+ "complexTypes": []
666
+ },
667
+ {
668
+ "text": "'MasterCard'",
669
+ "complexTypes": []
670
+ },
671
+ {
672
+ "text": "'Meeza'",
673
+ "complexTypes": []
674
+ },
675
+ {
676
+ "text": "'Mir'",
677
+ "complexTypes": []
678
+ },
679
+ {
680
+ "text": "'MyDebit'",
621
681
  "complexTypes": []
622
682
  },
623
683
  {
624
- "text": "'masterCard'",
684
+ "text": "'NAPAS'",
625
685
  "complexTypes": []
626
686
  },
627
687
  {
628
- "text": "'privateLabel'",
688
+ "text": "'BankAxept'",
629
689
  "complexTypes": []
630
690
  },
631
691
  {
632
- "text": "'quicPay'",
692
+ "text": "'PostFinanceAG'",
633
693
  "complexTypes": []
634
694
  },
635
695
  {
636
- "text": "'suica'",
696
+ "text": "'PrivateLabel'",
637
697
  "complexTypes": []
638
698
  },
639
699
  {
640
- "text": "'visa'",
700
+ "text": "'QUICPay'",
641
701
  "complexTypes": []
642
702
  },
643
703
  {
644
- "text": "'vPay'",
704
+ "text": "'Suica'",
645
705
  "complexTypes": []
646
706
  },
647
707
  {
648
- "text": "'id'",
708
+ "text": "'Visa'",
649
709
  "complexTypes": []
650
710
  },
651
711
  {
652
- "text": "'cartesBancaires'",
712
+ "text": "'VPay'",
653
713
  "complexTypes": []
654
714
  }
655
715
  ]
@@ -1,5 +1,5 @@
1
1
  export type PayPlatform = 'ios' | 'android' | 'web';
2
- export type ApplePayNetwork = 'amex' | 'chinaUnionPay' | 'discover' | 'eftpos' | 'electron' | 'girocard' | 'interac' | 'jcb' | 'mada' | 'maestro' | 'masterCard' | 'privateLabel' | 'quicPay' | 'suica' | 'visa' | 'vPay' | 'id' | 'cartesBancaires';
2
+ export type ApplePayNetwork = 'AmEx' | 'Bancomat' | 'Bancontact' | 'PagoBancomat' | 'CarteBancaire' | 'CarteBancaires' | 'CartesBancaires' | 'ChinaUnionPay' | 'Dankort' | 'Discover' | 'Eftpos' | 'Electron' | 'Elo' | 'girocard' | 'Himyan' | 'Interac' | 'iD' | 'Jaywan' | 'JCB' | 'mada' | 'Maestro' | 'MasterCard' | 'Meeza' | 'Mir' | 'MyDebit' | 'NAPAS' | 'BankAxept' | 'PostFinanceAG' | 'PrivateLabel' | 'QUICPay' | 'Suica' | 'Visa' | 'VPay';
3
3
  export type ApplePayMerchantCapability = '3DS' | 'credit' | 'debit' | 'emv';
4
4
  export type ApplePaySummaryItemType = 'final' | 'pending';
5
5
  export type ApplePayContactField = 'emailAddress' | 'name' | 'phoneNumber' | 'postalAddress';
@@ -1 +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 = 'emailAddress' | 'name' | 'phoneNumber' | 'postalAddress';\n\nexport type ApplePayShippingType = 'shipping' | 'delivery' | 'servicePickup' | '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 /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
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 | 'Bancomat'\n | 'Bancontact'\n | 'PagoBancomat'\n | 'CarteBancaire'\n | 'CarteBancaires'\n | 'CartesBancaires'\n | 'ChinaUnionPay'\n | 'Dankort'\n | 'Discover'\n | 'Eftpos'\n | 'Electron'\n | 'Elo'\n | 'girocard'\n | 'Himyan'\n | 'Interac'\n | 'iD'\n | 'Jaywan'\n | 'JCB'\n | 'mada'\n | 'Maestro'\n | 'MasterCard'\n | 'Meeza'\n | 'Mir'\n | 'MyDebit'\n | 'NAPAS'\n | 'BankAxept'\n | 'PostFinanceAG'\n | 'PrivateLabel'\n | 'QUICPay'\n | 'Suica'\n | 'Visa'\n | 'VPay';\n\nexport type ApplePayMerchantCapability = '3DS' | 'credit' | 'debit' | 'emv';\n\nexport type ApplePaySummaryItemType = 'final' | 'pending';\n\nexport type ApplePayContactField = 'emailAddress' | 'name' | 'phoneNumber' | 'postalAddress';\n\nexport type ApplePayShippingType = 'shipping' | 'delivery' | 'servicePickup' | '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 /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
@@ -5,7 +5,7 @@ import PassKit
5
5
 
6
6
  @objc(PayPlugin)
7
7
  public class PayPlugin: CAPPlugin, CAPBridgedPlugin, PKPaymentAuthorizationControllerDelegate {
8
- private let pluginVersion: String = "8.0.2"
8
+ private let pluginVersion: String = "8.0.4"
9
9
  public let identifier = "PayPlugin"
10
10
  public let jsName = "Pay"
11
11
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-pay",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "Capacitor plugin to trigger native payment for iOS(Apple pay) and Android(Google Pay)",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -42,7 +42,7 @@
42
42
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
43
43
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
44
44
  "eslint": "eslint . --ext ts",
45
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
45
+ "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
46
46
  "swiftlint": "node-swiftlint",
47
47
  "docgen": "docgen --api PayPlugin --output-readme README.md --output-json dist/docs.json",
48
48
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
@@ -66,7 +66,8 @@
66
66
  "rimraf": "^6.1.0",
67
67
  "rollup": "^4.53.2",
68
68
  "swiftlint": "^2.0.0",
69
- "typescript": "^5.9.3"
69
+ "typescript": "^5.9.3",
70
+ "prettier-pretty-check": "^0.2.0"
70
71
  },
71
72
  "peerDependencies": {
72
73
  "@capacitor/core": ">=8.0.0"