├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── config.yml
│ └── feature_request.md
└── workflows
│ └── build.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── demo
├── angular
│ ├── .editorconfig
│ ├── .gitignore
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── capacitor.build.gradle
│ │ │ ├── proguard-rules.pro
│ │ │ └── src
│ │ │ │ ├── androidTest
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── getcapacitor
│ │ │ │ │ └── myapp
│ │ │ │ │ └── ExampleInstrumentedTest.java
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── assets
│ │ │ │ │ ├── capacitor.config.json
│ │ │ │ │ └── capacitor.plugins.json
│ │ │ │ ├── java
│ │ │ │ │ └── io
│ │ │ │ │ │ └── ionic
│ │ │ │ │ │ └── starter
│ │ │ │ │ │ └── MainActivity.java
│ │ │ │ └── res
│ │ │ │ │ ├── drawable-land-hdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-mdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xxxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-hdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-mdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xxxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-v24
│ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ │ ├── drawable
│ │ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── values
│ │ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ │ └── xml
│ │ │ │ │ ├── config.xml
│ │ │ │ │ └── file_paths.xml
│ │ │ │ └── test
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── getcapacitor
│ │ │ │ └── myapp
│ │ │ │ └── ExampleUnitTest.java
│ │ ├── build.gradle
│ │ ├── capacitor.settings.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── settings.gradle
│ │ └── variables.gradle
│ ├── angular.json
│ ├── capacitor.config.ts
│ ├── e2e
│ │ ├── protractor.conf.js
│ │ ├── src
│ │ │ ├── app.e2e-spec.ts
│ │ │ └── app.po.ts
│ │ └── tsconfig.json
│ ├── eslint.config.js
│ ├── ionic.config.json
│ ├── ios
│ │ ├── .gitignore
│ │ └── App
│ │ │ ├── App.xcodeproj
│ │ │ └── project.pbxproj
│ │ │ ├── App.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── App
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ ├── AppIcon-512@2x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Contents.json
│ │ │ │ └── Splash.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── splash-2732x2732-1.png
│ │ │ │ │ ├── splash-2732x2732-2.png
│ │ │ │ │ └── splash-2732x2732.png
│ │ │ ├── Base.lproj
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ ├── capacitor.config.json
│ │ │ └── config.xml
│ │ │ ├── Podfile
│ │ │ └── Podfile.lock
│ ├── karma.conf.js
│ ├── package.json
│ ├── src
│ │ ├── .well-known
│ │ │ └── apple-developer-merchantid-domain-association
│ │ ├── app
│ │ │ ├── app.component.html
│ │ │ ├── app.component.scss
│ │ │ ├── app.component.ts
│ │ │ ├── app.routes.ts
│ │ │ ├── demo
│ │ │ │ ├── demo.page.html
│ │ │ │ ├── demo.page.scss
│ │ │ │ └── demo.page.ts
│ │ │ ├── flow
│ │ │ │ ├── flow.page.html
│ │ │ │ ├── flow.page.scss
│ │ │ │ └── flow.page.ts
│ │ │ ├── identity
│ │ │ │ ├── identity.page.html
│ │ │ │ ├── identity.page.scss
│ │ │ │ └── identity.page.ts
│ │ │ ├── shared
│ │ │ │ ├── helper.service.ts
│ │ │ │ └── interfaces.ts
│ │ │ ├── sheet
│ │ │ │ ├── sheet.page.html
│ │ │ │ ├── sheet.page.scss
│ │ │ │ └── sheet.page.ts
│ │ │ ├── tabs
│ │ │ │ ├── tabs.page.html
│ │ │ │ ├── tabs.page.scss
│ │ │ │ ├── tabs.page.ts
│ │ │ │ └── tabs.routes.ts
│ │ │ └── terminal
│ │ │ │ ├── cancelPathItems.ts
│ │ │ │ ├── checkDiscoverMethodItems.ts
│ │ │ │ ├── happyPathItems.ts
│ │ │ │ ├── terminal.page.html
│ │ │ │ ├── terminal.page.scss
│ │ │ │ ├── terminal.page.ts
│ │ │ │ ├── updateDeviceRequiredItems.ts
│ │ │ │ └── updateDeviceUpdateItems.ts
│ │ ├── assets
│ │ │ ├── icon
│ │ │ │ └── favicon.png
│ │ │ └── shapes.svg
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── global.scss
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── polyfills.ts
│ │ ├── theme
│ │ │ └── variables.scss
│ │ └── zone-flags.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ └── tsconfig.spec.json
├── react
│ ├── .gitignore
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── capacitor.build.gradle
│ │ │ ├── proguard-rules.pro
│ │ │ └── src
│ │ │ │ ├── androidTest
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── getcapacitor
│ │ │ │ │ └── myapp
│ │ │ │ │ └── ExampleInstrumentedTest.java
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── assets
│ │ │ │ │ ├── capacitor.config.json
│ │ │ │ │ └── capacitor.plugins.json
│ │ │ │ ├── java
│ │ │ │ │ └── io
│ │ │ │ │ │ └── ionic
│ │ │ │ │ │ └── starter
│ │ │ │ │ │ └── MainActivity.java
│ │ │ │ └── res
│ │ │ │ │ ├── drawable-land-hdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-mdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-land-xxxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-hdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-mdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-port-xxxhdpi
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── drawable-v24
│ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ │ ├── drawable
│ │ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ │ └── splash.png
│ │ │ │ │ ├── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_foreground.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── values
│ │ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ │ └── xml
│ │ │ │ │ ├── config.xml
│ │ │ │ │ └── file_paths.xml
│ │ │ │ └── test
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── getcapacitor
│ │ │ │ └── myapp
│ │ │ │ └── ExampleUnitTest.java
│ │ ├── build.gradle
│ │ ├── capacitor.settings.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── settings.gradle
│ │ └── variables.gradle
│ ├── capacitor.config.ts
│ ├── ionic.config.json
│ ├── ios
│ │ ├── .gitignore
│ │ └── App
│ │ │ ├── App.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace
│ │ │ │ └── contents.xcworkspacedata
│ │ │ ├── App.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── App
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ ├── AppIcon-20x20@1x.png
│ │ │ │ │ ├── AppIcon-20x20@2x-1.png
│ │ │ │ │ ├── AppIcon-20x20@2x.png
│ │ │ │ │ ├── AppIcon-20x20@3x.png
│ │ │ │ │ ├── AppIcon-29x29@1x.png
│ │ │ │ │ ├── AppIcon-29x29@2x-1.png
│ │ │ │ │ ├── AppIcon-29x29@2x.png
│ │ │ │ │ ├── AppIcon-29x29@3x.png
│ │ │ │ │ ├── AppIcon-40x40@1x.png
│ │ │ │ │ ├── AppIcon-40x40@2x-1.png
│ │ │ │ │ ├── AppIcon-40x40@2x.png
│ │ │ │ │ ├── AppIcon-40x40@3x.png
│ │ │ │ │ ├── AppIcon-512@2x.png
│ │ │ │ │ ├── AppIcon-60x60@2x.png
│ │ │ │ │ ├── AppIcon-60x60@3x.png
│ │ │ │ │ ├── AppIcon-76x76@1x.png
│ │ │ │ │ ├── AppIcon-76x76@2x.png
│ │ │ │ │ ├── AppIcon-83.5x83.5@2x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Contents.json
│ │ │ │ └── Splash.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── splash-2732x2732-1.png
│ │ │ │ │ ├── splash-2732x2732-2.png
│ │ │ │ │ └── splash-2732x2732.png
│ │ │ ├── Base.lproj
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ ├── capacitor.config.json
│ │ │ └── config.xml
│ │ │ └── Podfile
│ ├── package.json
│ ├── public
│ │ ├── assets
│ │ │ ├── icon
│ │ │ │ ├── favicon.png
│ │ │ │ └── icon.png
│ │ │ └── shapes.svg
│ │ ├── index.html
│ │ └── manifest.json
│ ├── src
│ │ ├── App.test.tsx
│ │ ├── App.tsx
│ │ ├── components
│ │ │ ├── ExploreContainer.css
│ │ │ └── ExploreContainer.tsx
│ │ ├── hooks
│ │ │ └── payment-sheet.ts
│ │ ├── index.tsx
│ │ ├── interfaces.tsx
│ │ ├── pages
│ │ │ ├── Tab1.css
│ │ │ ├── Tab1.tsx
│ │ │ ├── Tab1
│ │ │ │ ├── ApplePay.tsx
│ │ │ │ ├── GooglePay.tsx
│ │ │ │ ├── PaymentFlow.tsx
│ │ │ │ └── PaymentSheet.tsx
│ │ │ ├── Tab2.css
│ │ │ ├── Tab2.tsx
│ │ │ ├── Tab3.css
│ │ │ └── Tab3.tsx
│ │ ├── react-app-env.d.ts
│ │ ├── reportWebVitals.ts
│ │ ├── service-worker.ts
│ │ ├── serviceWorkerRegistration.ts
│ │ ├── setupTests.ts
│ │ └── theme
│ │ │ └── variables.css
│ └── tsconfig.json
├── screenshots
│ ├── apple-pay-ios.png
│ ├── google-pay-android.png
│ ├── google-pay-web.png
│ ├── identity-android.png
│ ├── identity-ios.png
│ ├── identity-web.png
│ ├── payment-flow-android.png
│ ├── payment-flow-ios.png
│ ├── payment-sheet-android.png
│ ├── payment-sheet-ios.png
│ └── payment-sheet-web.png
└── server
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .prettierrc
│ ├── nest-cli.json
│ ├── package-lock.json
│ ├── package.json
│ ├── serverless.yml
│ ├── src
│ ├── app.controller.spec.ts
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ ├── index.ts
│ ├── main.ts
│ ├── payment-intent.dto.ts
│ └── swagger.ts
│ ├── test
│ ├── app.e2e-spec.ts
│ └── jest-e2e.json
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── package.json
├── packages
├── identity
│ ├── .eslintignore
│ ├── .gitignore
│ ├── CapacitorCommunityStripeIdentity.podspec
│ ├── Package.swift
│ ├── README.md
│ ├── android
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── proguard-rules.pro
│ │ ├── settings.gradle
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── getcapacitor
│ │ │ │ └── android
│ │ │ │ └── ExampleInstrumentedTest.kt
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── getcapacitor
│ │ │ │ │ └── community
│ │ │ │ │ └── stripe
│ │ │ │ │ └── identity
│ │ │ │ │ ├── IdentityVerificationSheetEvent.kt
│ │ │ │ │ ├── StripeIdentity.kt
│ │ │ │ │ ├── StripeIdentityPlugin.kt
│ │ │ │ │ └── models
│ │ │ │ │ └── Executor.kt
│ │ │ └── res
│ │ │ │ └── .gitkeep
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── getcapacitor
│ │ │ └── ExampleUnitTest.kt
│ ├── ios
│ │ ├── .gitignore
│ │ ├── Sources
│ │ │ └── StripeIdentityPlugin
│ │ │ │ ├── IdentityVerificationSheetEvents.swift
│ │ │ │ ├── Info.plist
│ │ │ │ ├── StripeIdentity.swift
│ │ │ │ └── StripeIdentityPlugin.swift
│ │ └── Tests
│ │ │ └── StripeIdentityPluginTests
│ │ │ └── StripeIdentityPluginTests.swift
│ ├── package-lock.json
│ ├── package.json
│ ├── rollup.config.mjs
│ ├── src
│ │ ├── definitions.ts
│ │ ├── events.enum.ts
│ │ ├── index.ts
│ │ └── web.ts
│ └── tsconfig.json
├── payment
│ ├── .eslintignore
│ ├── .gitignore
│ ├── .nvmrc
│ ├── BREAKING.md
│ ├── CapacitorCommunityStripe.podspec
│ ├── Package.swift
│ ├── README.md
│ ├── android
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── proguard-rules.pro
│ │ ├── settings.gradle
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── getcapacitor
│ │ │ │ └── android
│ │ │ │ └── ExampleInstrumentedTest.kt
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── getcapacitor
│ │ │ │ │ └── community
│ │ │ │ │ └── stripe
│ │ │ │ │ ├── StripePaymentMethodsListener.kt
│ │ │ │ │ ├── StripePlugin.kt
│ │ │ │ │ ├── googlepay
│ │ │ │ │ ├── GooglePayEvent.kt
│ │ │ │ │ └── GooglePayExecutor.kt
│ │ │ │ │ ├── helper
│ │ │ │ │ ├── MetaData.kt
│ │ │ │ │ └── PaymentSheetHelper.kt
│ │ │ │ │ ├── models
│ │ │ │ │ └── Executor.kt
│ │ │ │ │ ├── paymentflow
│ │ │ │ │ ├── PaymentFlowEvent.kt
│ │ │ │ │ └── PaymentFlowExecutor.kt
│ │ │ │ │ └── paymentsheet
│ │ │ │ │ ├── PaymentSheetEvent.kt
│ │ │ │ │ └── PaymentSheetExecutor.kt
│ │ │ └── res
│ │ │ │ └── .gitkeep
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── getcapacitor
│ │ │ └── ExampleUnitTest.kt
│ ├── ios
│ │ ├── .gitignore
│ │ ├── Sources
│ │ │ └── StripePlugin
│ │ │ │ ├── ApplePay
│ │ │ │ ├── ApplePayEvents.swift
│ │ │ │ └── ApplePayExecutor.swift
│ │ │ │ ├── Info.plist
│ │ │ │ ├── PaymentFlow
│ │ │ │ ├── PaymentFlowEvents.swift
│ │ │ │ └── PaymentFlowExecutor.swift
│ │ │ │ ├── PaymentSheet
│ │ │ │ ├── PaymentSheetEvents.swift
│ │ │ │ └── PaymentSheetExecutor.swift
│ │ │ │ ├── PaymentSheetHelper.swift
│ │ │ │ └── StripePlugin.swift
│ │ └── Tests
│ │ │ └── StripePluginTests
│ │ │ └── StripePluginTests.swift
│ ├── package-lock.json
│ ├── package.json
│ ├── rollup.config.mjs
│ ├── src
│ │ ├── applepay
│ │ │ ├── apple-pay-difinitions.interface.ts
│ │ │ ├── apple-pay-events.enum.ts
│ │ │ └── index.ts
│ │ ├── definitions.ts
│ │ ├── googlepay
│ │ │ ├── google-pay-difinitions.interface.ts
│ │ │ ├── google-pay-events.enum.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── paymentflow
│ │ │ ├── index.ts
│ │ │ ├── payment-flow-definitions.interface.ts
│ │ │ └── payment-flow-events.enum.ts
│ │ ├── paymentsheet
│ │ │ ├── index.ts
│ │ │ ├── payment-sheet-definitions.interface.ts
│ │ │ └── payment-sheet-events.enum.ts
│ │ ├── private
│ │ │ └── validate-all-events-implemented.type.ts
│ │ ├── react
│ │ │ └── provider.tsx
│ │ ├── shared
│ │ │ ├── index.ts
│ │ │ └── platform.ts
│ │ └── web.ts
│ └── tsconfig.json
└── terminal
│ ├── .eslintignore
│ ├── .gitignore
│ ├── CapacitorCommunityStripeTerminal.podspec
│ ├── Package.swift
│ ├── README.md
│ ├── android
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── proguard-rules.pro
│ ├── settings.gradle
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── getcapacitor
│ │ │ └── android
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── getcapacitor
│ │ │ │ └── community
│ │ │ │ └── stripe
│ │ │ │ └── terminal
│ │ │ │ ├── StripeTerminal.kt
│ │ │ │ ├── StripeTerminalPlugin.kt
│ │ │ │ ├── TerminalConnectTypes.kt
│ │ │ │ ├── TerminalEvent.kt
│ │ │ │ ├── TokenProvider.kt
│ │ │ │ ├── helper
│ │ │ │ ├── MetaData.kt
│ │ │ │ └── TerminalMappers.kt
│ │ │ │ └── models
│ │ │ │ └── Executor.kt
│ │ └── res
│ │ │ └── .gitkeep
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── getcapacitor
│ │ └── ExampleUnitTest.kt
│ ├── ios
│ ├── .gitignore
│ ├── Sources
│ │ └── StripeTerminalPlugin
│ │ │ ├── Info.plist
│ │ │ ├── StripeTerminal.swift
│ │ │ ├── StripeTerminalPlugin.swift
│ │ │ ├── TerminalConnectTypes.swift
│ │ │ ├── TerminalEvents.swift
│ │ │ └── TerminalMappers.swift
│ └── Tests
│ │ └── StripeTerminalPluginTests
│ │ └── StripeTerminalPluginTests.swift
│ ├── package-lock.json
│ ├── package.json
│ ├── rollup.config.mjs
│ ├── src
│ ├── definitions.ts
│ ├── events.enum.ts
│ ├── index.ts
│ ├── stripe-types
│ │ └── proto.ts
│ ├── stripe.enum.ts
│ ├── terminal-mappers.ts
│ └── web.ts
│ └── tsconfig.json
└── release.js
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Platform**
11 |
12 | - [ ] Web
13 | - [ ] iOS
14 | - [ ] Android
15 |
16 | **Describe the bug**
17 | A clear and concise description of what the bug is.
18 |
19 | **To Reproduce**
20 | Steps to reproduce the behavior:
21 | 1. Go to '...'
22 | 2. Click on '....'
23 | 3. Scroll down to '....'
24 | 4. See error
25 |
26 | **Expected behavior**
27 | A clear and concise description of what you expected to happen.
28 |
29 | **Screenshots**
30 | If applicable, add screenshots to help explain your problem.
31 |
32 | **Additional context**
33 | Add any other context about the problem here.
34 |
35 | **Usage Product**
36 | If you adopt this plugin, please let us know which product you are using.
37 |
38 | Product Name:
39 | Product URL :
40 | Using Function:
41 | - [ ] Payment Sheet / Payment Flow
42 | - [ ] Apple Pay
43 | - [ ] Google Pay
44 | - [ ] Identity (@capacitor-community/stripe-identity)
45 | - [ ] Terminal(@capacitor-community/stripe-terminal)
46 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Stripe support
4 | url: https://support.stripe.com/
5 | about: |
6 | Please only file issues here that you believe represent actual bugs or feature requests for the Stripe iOS/Android library. ex) Questions about the UI of the payment, etc.
7 | If you're having general trouble with your Stripe integration, please reach out to support.
8 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
22 | **Usage Product**
23 | If you adopt this plugin, please let us know which product you are using.
24 |
25 | Product Name:
26 | Product URL :
27 | Using Function:
28 | - [ ] Payment Sheet / Payment Flow
29 | - [ ] Apple Pay
30 | - [ ] Google Pay
31 | - [ ] Identity (@capacitor-community/stripe-identity)
32 | - [ ] Terminal(@capacitor-community/stripe-terminal)
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | package-lock.json
3 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | This guide provides instructions for contributing to this Capacitor plugin.
4 |
5 | ## Developing
6 |
7 | ### Local Setup
8 |
9 | 1. Fork and clone the repo.
10 | 1. Install the dependencies.
11 |
12 | ```shell
13 | npm install
14 | ```
15 |
16 | 1. Install SwiftLint if you're on macOS.
17 |
18 | ```shell
19 | brew install swiftlint
20 | ```
21 |
22 | ### Scripts
23 |
24 | #### `npm run build`
25 |
26 | Build the plugin web assets and generate plugin API documentation using [`@capacitor/docgen`](https://github.com/ionic-team/capacitor-docgen).
27 |
28 | It will compile the TypeScript code from `src/` into ESM JavaScript in `dist/esm/`. These files are used in apps with bundlers when your plugin is imported.
29 |
30 | Then, Rollup will bundle the code into a single file at `dist/plugin.js`. This file is used in apps without bundlers by including it as a script in `index.html`.
31 |
32 | #### `npm run verify`
33 |
34 | Build and validate the web and native projects.
35 |
36 | This is useful to run in CI to verify that the plugin builds for all platforms.
37 |
38 | #### `npm run lint` / `npm run fmt`
39 |
40 | Check formatting and code quality, autoformat/autofix if possible.
41 |
42 | This template is integrated with ESLint, Prettier, and SwiftLint. Using these tools is completely optional, but the [Capacitor Community](https://github.com/capacitor-community/) strives to have consistent code style and structure for easier cooperation.
43 |
44 | # Note
45 | `docgen --api DocGenType` is for Document.
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Capacitor Community
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/demo/angular/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/demo/angular/.gitignore:
--------------------------------------------------------------------------------
1 | /.angular/cache
2 | # Specifies intentionally untracked files to ignore when using Git
3 | # http://git-scm.com/docs/gitignore
4 |
5 | *~
6 | *.sw[mnpcod]
7 | .tmp
8 | *.tmp
9 | *.tmp.*
10 | *.sublime-project
11 | *.sublime-workspace
12 | .DS_Store
13 | Thumbs.db
14 | UserInterfaceState.xcuserstate
15 | $RECYCLE.BIN/
16 |
17 | *.log
18 | log.txt
19 | npm-debug.log*
20 |
21 | /.idea
22 | /.ionic
23 | /.sass-cache
24 | /.sourcemaps
25 | /.versions
26 | /.vscode
27 | /coverage
28 | /dist
29 | /node_modules
30 | /platforms
31 | /plugins
32 | /www
33 |
--------------------------------------------------------------------------------
/demo/angular/android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build/*
2 | !/build/.npmkeep
3 |
--------------------------------------------------------------------------------
/demo/angular/android/app/capacitor.build.gradle:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2 |
3 | android {
4 | compileOptions {
5 | sourceCompatibility JavaVersion.VERSION_21
6 | targetCompatibility JavaVersion.VERSION_21
7 | }
8 | }
9 |
10 | apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
11 | dependencies {
12 | implementation project(':capacitor-community-stripe')
13 | implementation project(':capacitor-community-stripe-identity')
14 | implementation project(':capacitor-community-stripe-terminal')
15 |
16 | }
17 |
18 |
19 | if (hasProperty('postBuildExtras')) {
20 | postBuildExtras()
21 | }
22 |
--------------------------------------------------------------------------------
/demo/angular/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.myapp;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import android.content.Context;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 | import androidx.test.platform.app.InstrumentationRegistry;
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * @see Testing documentation
15 | */
16 | @RunWith(AndroidJUnit4.class)
17 | public class ExampleInstrumentedTest {
18 |
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23 |
24 | assertEquals("com.getcapacitor.app", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/assets/capacitor.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "appId": "io.ionic.starter",
3 | "appName": "capacitor-stripe",
4 | "webDir": "www/browser"
5 | }
6 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/assets/capacitor.plugins.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "pkg": "@capacitor-community/stripe",
4 | "classpath": "com.getcapacitor.community.stripe.StripePlugin"
5 | },
6 | {
7 | "pkg": "@capacitor-community/stripe-identity",
8 | "classpath": "com.getcapacitor.community.stripe.identity.StripeIdentityPlugin"
9 | },
10 | {
11 | "pkg": "@capacitor-community/stripe-terminal",
12 | "classpath": "com.getcapacitor.community.stripe.terminal.StripeTerminalPlugin"
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/java/io/ionic/starter/MainActivity.java:
--------------------------------------------------------------------------------
1 | package io.ionic.starter;
2 |
3 | import android.os.Build;
4 | import android.os.Bundle;
5 | import com.getcapacitor.BridgeActivity;
6 | import com.getcapacitor.community.stripe.StripePlugin;
7 | import com.getcapacitor.community.stripe.identity.StripeIdentityPlugin;
8 | import com.getcapacitor.community.stripe.terminal.StripeTerminalPlugin;
9 |
10 | public class MainActivity extends BridgeActivity {
11 |
12 | @Override
13 | public void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | registerPlugin(StripePlugin.class);
16 | registerPlugin(StripeIdentityPlugin.class);
17 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
18 | registerPlugin(StripeTerminalPlugin.class);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-land-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-land-hdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-land-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-land-mdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-land-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-land-xhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-land-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-land-xxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-land-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-land-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-port-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-port-hdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-port-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-port-mdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-port-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-port-xhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-port-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-port-xxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-port-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable-port-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/drawable/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/drawable/splash.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | capacitor-stripe
4 | capacitor-stripe
5 | io.ionic.starter
6 | io.ionic.starter
7 |
8 | pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM
9 | true
10 | US
11 | Widget Store
12 | true
13 | false
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
17 |
18 |
19 |
22 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/xml/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/angular/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.myapp;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import org.junit.Test;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 |
14 | @Test
15 | public void addition_isCorrect() throws Exception {
16 | assertEquals(4, 2 + 2);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/demo/angular/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:8.7.2'
10 | classpath 'com.google.gms:google-services:4.4.2'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | apply from: "variables.gradle"
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | mavenCentral()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/demo/angular/android/capacitor.settings.gradle:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2 | include ':capacitor-android'
3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
4 |
5 | include ':capacitor-community-stripe'
6 | project(':capacitor-community-stripe').projectDir = new File('../../../packages/payment/android')
7 |
8 | include ':capacitor-community-stripe-identity'
9 | project(':capacitor-community-stripe-identity').projectDir = new File('../../../packages/identity/android')
10 |
11 | include ':capacitor-community-stripe-terminal'
12 | project(':capacitor-community-stripe-terminal').projectDir = new File('../../../packages/terminal/android')
13 |
--------------------------------------------------------------------------------
/demo/angular/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
--------------------------------------------------------------------------------
/demo/angular/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/demo/angular/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/demo/angular/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | include ':capacitor-cordova-android-plugins'
3 | project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
4 |
5 | apply from: 'capacitor.settings.gradle'
--------------------------------------------------------------------------------
/demo/angular/android/variables.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | minSdkVersion = 26
3 | compileSdkVersion = 35
4 | targetSdkVersion = 35
5 | androidxActivityVersion = '1.9.2'
6 | androidxAppCompatVersion = '1.7.0'
7 | androidxCoordinatorLayoutVersion = '1.2.0'
8 | androidxCoreVersion = '1.15.0'
9 | androidxFragmentVersion = '1.8.4'
10 | coreSplashScreenVersion = '1.0.1'
11 | androidxWebkitVersion = '1.12.1'
12 | junitVersion = '4.13.2'
13 | androidxJunitVersion = '1.2.1'
14 | androidxEspressoCoreVersion = '3.6.1'
15 | cordovaAndroidVersion = '10.1.1'
16 |
17 | // If you use @capacitor-community/stripe:
18 | // stripeAndroidVersion = '20.39.+'
19 |
20 | // If you use @capacitor-community/stripe-identity:
21 | // identityVersion = '20.39.+'
22 | }
23 |
--------------------------------------------------------------------------------
/demo/angular/capacitor.config.ts:
--------------------------------------------------------------------------------
1 | import { CapacitorConfig } from '@capacitor/cli';
2 |
3 | const config: CapacitorConfig = {
4 | appId: 'io.ionic.starter',
5 | appName: 'capacitor-stripe',
6 | webDir: 'www/browser',
7 | };
8 |
9 | export default config;
10 |
--------------------------------------------------------------------------------
/demo/angular/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | // Protractor configuration file, see link for more information
3 | // https://github.com/angular/protractor/blob/master/lib/config.ts
4 |
5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
6 |
7 | /**
8 | * @type { import("protractor").Config }
9 | */
10 | exports.config = {
11 | allScriptsTimeout: 11000,
12 | specs: [
13 | './src/**/*.e2e-spec.ts'
14 | ],
15 | capabilities: {
16 | browserName: 'chrome'
17 | },
18 | directConnect: true,
19 | SELENIUM_PROMISE_MANAGER: false,
20 | baseUrl: 'http://localhost:4200/',
21 | framework: 'jasmine',
22 | jasmineNodeOpts: {
23 | showColors: true,
24 | defaultTimeoutInterval: 30000,
25 | print: function() {}
26 | },
27 | onPrepare() {
28 | require('ts-node').register({
29 | project: require('path').join(__dirname, './tsconfig.json')
30 | });
31 | jasmine.getEnv().addReporter(new SpecReporter({
32 | spec: {
33 | displayStacktrace: StacktraceOption.PRETTY
34 | }
35 | }));
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/demo/angular/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('new App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getPageTitle()).toContain('Tab 1');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/demo/angular/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getPageTitle() {
9 | return element(by.css('ion-title')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/demo/angular/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es2018",
7 | "types": [
8 | "jasmine",
9 | "node"
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/demo/angular/eslint.config.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | const eslint = require("@eslint/js");
3 | const tseslint = require("typescript-eslint");
4 | const angular = require("angular-eslint");
5 |
6 | module.exports = tseslint.config(
7 | {
8 | files: ["**/*.ts"],
9 | extends: [
10 | eslint.configs.recommended,
11 | ...tseslint.configs.recommended,
12 | ...tseslint.configs.stylistic,
13 | ...angular.configs.tsRecommended,
14 | ],
15 | processor: angular.processInlineTemplates,
16 | rules: {
17 | '@angular-eslint/component-class-suffix': [
18 | 'error',
19 | {
20 | suffixes: ['Page', 'Component'],
21 | },
22 | ],
23 | "@angular-eslint/directive-selector": [
24 | "error",
25 | {
26 | type: "attribute",
27 | prefix: "app",
28 | style: "camelCase",
29 | },
30 | ],
31 | "@angular-eslint/component-selector": [
32 | "error",
33 | {
34 | type: "element",
35 | prefix: "app",
36 | style: "kebab-case",
37 | },
38 | ],
39 | "no-prototype-builtins": "off",
40 | "@typescript-eslint/ban-ts-comment": "off",
41 | "no-async-promise-executor": "off",
42 | "@typescript-eslint/no-explicit-any": "off"
43 | },
44 | },
45 | {
46 | files: ["**/*.html"],
47 | extends: [
48 | ...angular.configs.templateRecommended,
49 | ...angular.configs.templateAccessibility,
50 | ],
51 | rules: {},
52 | }
53 | );
54 |
--------------------------------------------------------------------------------
/demo/angular/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular",
3 | "integrations": {},
4 | "type": "angular"
5 | }
6 |
--------------------------------------------------------------------------------
/demo/angular/ios/.gitignore:
--------------------------------------------------------------------------------
1 | App/build
2 | App/Pods
3 | App/output
4 | App/App/public
5 | DerivedData
6 | xcuserdata
7 |
8 | # Cordova plugins for Capacitor
9 | capacitor-cordova-ios-plugins
10 |
11 | # Generated Config files
12 | App/App/capacitor.config.json
13 | App/App/config.xml
14 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "AppIcon-512@2x.png",
5 | "idiom" : "universal",
6 | "platform" : "ios",
7 | "size" : "1024x1024"
8 | }
9 | ],
10 | "info" : {
11 | "author" : "xcode",
12 | "version" : 1
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "splash-2732x2732-2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "splash-2732x2732-1.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "splash-2732x2732.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/capacitor.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "appId": "io.ionic.starter",
3 | "appName": "capacitor-stripe",
4 | "webDir": "www/browser",
5 | "packageClassList": [
6 | "StripePlugin",
7 | "StripeIdentityPlugin",
8 | "StripeTerminalPlugin"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/App/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/angular/ios/App/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
2 |
3 | platform :ios, '14.0'
4 | use_frameworks!
5 |
6 | # workaround to avoid Xcode caching of Pods that requires
7 | # Product -> Clean Build Folder after new Cordova plugins installed
8 | # Requires CocoaPods 1.6 or newer
9 | install! 'cocoapods', :disable_input_output_paths => true
10 |
11 | def capacitor_pods
12 | pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13 | pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14 | pod 'CapacitorCommunityStripe', :path => '../../../../packages/payment'
15 | pod 'CapacitorCommunityStripeIdentity', :path => '../../../../packages/identity'
16 | pod 'CapacitorCommunityStripeTerminal', :path => '../../../../packages/terminal'
17 | end
18 |
19 | target 'App' do
20 | capacitor_pods
21 | # Add your Pods here
22 | end
23 |
24 | post_install do |installer|
25 | assertDeploymentTarget(installer)
26 | end
27 |
--------------------------------------------------------------------------------
/demo/angular/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | jasmine: {
17 | // you can add configuration options for Jasmine here
18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19 | // for example, you can disable the random execution with `random: false`
20 | // or set a specific seed with `seed: 4321`
21 | },
22 | clearContext: false // leave Jasmine Spec Runner output visible in browser
23 | },
24 | jasmineHtmlReporter: {
25 | suppressAll: true // removes the duplicated traces
26 | },
27 | coverageReporter: {
28 | dir: require('path').join(__dirname, './coverage/ngv'),
29 | subdir: '.',
30 | reporters: [
31 | { type: 'html' },
32 | { type: 'text-summary' }
33 | ]
34 | },
35 | reporters: ['progress', 'kjhtml'],
36 | port: 9876,
37 | colors: true,
38 | logLevel: config.LOG_INFO,
39 | autoWatch: true,
40 | browsers: ['Chrome'],
41 | singleRun: false,
42 | restartOnFileChange: true
43 | });
44 | };
45 |
--------------------------------------------------------------------------------
/demo/angular/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/demo/angular/src/app/app.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/app.component.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Stripe } from '@capacitor-community/stripe';
3 | import { StripeIdentity } from '@capacitor-community/stripe-identity';
4 | import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
5 |
6 | @Component({
7 | selector: 'app-root',
8 | templateUrl: 'app.component.html',
9 | styleUrls: ['app.component.scss'],
10 | imports: [IonApp, IonRouterOutlet],
11 | })
12 | export class AppComponent {
13 | constructor() {
14 | Stripe.initialize({
15 | publishableKey:
16 | 'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',
17 |
18 | /**
19 | * Danger: This is production environment using production key.
20 | * For testing ApplePay and GooglePay, but If it fails, payment will occur.
21 | */
22 | // publishableKey: 'pk_live_51KFDksKRG9PRcrzztDRkrFSon0jOxWuQ77zd2URAyn3sy4Dn1EST360KnM6ElTlAerKOBvi27J4SPlKd2rG4SNAZ00n0f3mEbg',
23 | });
24 | StripeIdentity.initialize({
25 | publishableKey:
26 | 'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',
27 | });
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/demo/angular/src/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 |
3 | export const routes: Routes = [
4 | {
5 | path: '',
6 | loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
7 | },
8 | ];
9 |
--------------------------------------------------------------------------------
/demo/angular/src/app/demo/demo.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/demo/demo.page.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/flow/flow.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | FLOW
4 |
5 |
6 |
7 |
8 |
9 | PROCESS
10 | Expect Happy Path
13 | Expect User Cancel
16 |
17 |
18 | @if (eventItems.length > 0) {
19 |
20 | EXPECT
21 | @for (item of eventItems; track item; let i = $index) {
22 |
23 |
31 | {{ item.name }}
32 | @if (item.result !== undefined) {
33 |
38 | }
39 |
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/demo/angular/src/app/flow/flow.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/flow/flow.page.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/identity/identity.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | IDENTIFY
4 |
5 |
6 |
7 |
8 |
9 | PROCESS
10 | Expect Happy Path
13 | Expect User Cancel
16 |
17 |
18 | @if (eventItems.length > 0) {
19 |
20 | EXPECT
21 | @for (item of eventItems; track item; let i = $index) {
22 |
23 |
31 | {{ item.name }}
32 | @if (item.result !== undefined) {
33 |
38 | }
39 |
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/demo/angular/src/app/identity/identity.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/identity/identity.page.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/shared/helper.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, NgZone } from '@angular/core';
2 | import { ITestItems } from './interfaces';
3 |
4 | @Injectable({
5 | providedIn: 'root',
6 | })
7 | export class HelperService {
8 | constructor(private zone: NgZone) {}
9 |
10 | /**
11 | * items is not Deep Copy, this is substitution
12 | */
13 | public async updateItem(
14 | items: ITestItems[],
15 | name: string,
16 | result: boolean,
17 | value: unknown = undefined,
18 | ) {
19 | await new Promise((resolve) => {
20 | this.zone.run(() => {
21 | let isChanged = false;
22 | items = items.map((item) => {
23 | if (item.name === name && item.result === undefined && !isChanged) {
24 | isChanged = true;
25 | if (item.expect === undefined) {
26 | item.result = result;
27 | } else if (Array.isArray(item.expect) && value) {
28 | // @ts-expect-error: valueがanyであるため
29 | item.result = item.expect.includes(value.toString());
30 | } else if (value && typeof value === 'object') {
31 | item.result = JSON.stringify(value).includes(
32 | item.expect.toString(),
33 | );
34 | } else {
35 | if (item.expect === 'error') {
36 | item.result = this.receiveErrorValue(value);
37 | }
38 | }
39 | }
40 | return item;
41 | });
42 | resolve();
43 | });
44 | });
45 | }
46 |
47 | private receiveErrorValue(value: unknown): boolean {
48 | return value.hasOwnProperty('code') && value.hasOwnProperty('message');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/demo/angular/src/app/shared/interfaces.ts:
--------------------------------------------------------------------------------
1 | export interface ITestItems {
2 | type: 'method' | 'event';
3 | name: string;
4 | result?: boolean;
5 | expect?: number | string | string[] | number[];
6 | }
7 |
--------------------------------------------------------------------------------
/demo/angular/src/app/sheet/sheet.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | SHEET
4 |
5 |
6 |
7 |
8 |
9 | PROCESS
10 | Expect Happy Path
13 | Expect User Cancel
16 |
17 |
18 | @if (eventItems.length > 0) {
19 |
20 | EXPECT
21 | @for (item of eventItems; track item; let i = $index) {
22 |
23 |
31 | {{ item.name }}
32 | @if (item.result !== undefined) {
33 |
38 | }
39 |
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/demo/angular/src/app/sheet/sheet.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/sheet/sheet.page.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/tabs/tabs.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DEMO
6 |
7 |
8 |
9 |
10 | SHEET
11 |
12 |
13 |
14 |
15 | FLOW
16 |
17 |
18 |
19 |
20 | IDENTIFY
21 |
22 |
23 |
24 |
25 | TERMINAL
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/demo/angular/src/app/tabs/tabs.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/angular/src/app/tabs/tabs.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { addIcons } from 'ionicons';
3 | import {
4 | chevronForwardCircleOutline,
5 | copyOutline,
6 | tabletLandscapeOutline,
7 | } from 'ionicons/icons';
8 | import {
9 | IonIcon,
10 | IonLabel,
11 | IonTabBar,
12 | IonTabButton,
13 | IonTabs,
14 | } from '@ionic/angular/standalone';
15 |
16 | @Component({
17 | selector: 'app-tabs',
18 | templateUrl: 'tabs.page.html',
19 | styleUrls: ['tabs.page.scss'],
20 | imports: [IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel],
21 | })
22 | export class TabsPage {
23 | constructor() {
24 | addIcons({
25 | chevronForwardCircleOutline,
26 | tabletLandscapeOutline,
27 | copyOutline,
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/demo/angular/src/app/tabs/tabs.routes.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { TabsPage } from './tabs.page';
3 | import { DemoPage } from '../demo/demo.page';
4 | import { SheetPage } from '../sheet/sheet.page';
5 | import { FlowPage } from '../flow/flow.page';
6 | import { IdentityPage } from '../identity/identity.page';
7 | import { TerminalPage } from '../terminal/terminal.page';
8 |
9 | export const routes: Routes = [
10 | {
11 | path: 'tabs',
12 | component: TabsPage,
13 | children: [
14 | {
15 | path: 'demo',
16 | component: DemoPage,
17 | },
18 | {
19 | path: 'sheet',
20 | component: SheetPage,
21 | },
22 | {
23 | path: 'flow',
24 | component: FlowPage,
25 | },
26 | {
27 | path: 'identify',
28 | component: IdentityPage,
29 | },
30 | {
31 | path: 'terminal',
32 | component: TerminalPage,
33 | },
34 | {
35 | path: '',
36 | redirectTo: '/tabs/tab1',
37 | pathMatch: 'full',
38 | },
39 | ],
40 | },
41 | {
42 | path: '',
43 | redirectTo: '/tabs/demo',
44 | pathMatch: 'full',
45 | },
46 | ];
47 |
--------------------------------------------------------------------------------
/demo/angular/src/app/terminal/cancelPathItems.ts:
--------------------------------------------------------------------------------
1 | import { ITestItems } from '../shared/interfaces';
2 | import { TerminalEventsEnum } from '@capacitor-community/stripe-terminal';
3 |
4 | export const cancelPathItems: ITestItems[] = [
5 | {
6 | type: 'method',
7 | name: 'initialize',
8 | },
9 | {
10 | type: 'event',
11 | name: TerminalEventsEnum.Loaded,
12 | },
13 | {
14 | type: 'method',
15 | name: 'discoverReaders',
16 | },
17 | {
18 | type: 'event',
19 | name: TerminalEventsEnum.DiscoveredReaders,
20 | },
21 | {
22 | type: 'method',
23 | name: 'connectReader',
24 | },
25 | {
26 | type: 'event',
27 | name: TerminalEventsEnum.ConnectedReader,
28 | },
29 | {
30 | type: 'method',
31 | name: 'HttpClientPaymentIntent',
32 | },
33 | {
34 | type: 'method',
35 | name: 'collectPaymentMethod',
36 | },
37 | {
38 | type: 'method',
39 | name: 'cancelCollectPaymentMethod',
40 | },
41 | {
42 | type: 'event',
43 | name: TerminalEventsEnum.Canceled,
44 | },
45 | ];
46 |
--------------------------------------------------------------------------------
/demo/angular/src/app/terminal/checkDiscoverMethodItems.ts:
--------------------------------------------------------------------------------
1 | import { ITestItems } from '../shared/interfaces';
2 | import { TerminalEventsEnum } from '@capacitor-community/stripe-terminal';
3 |
4 | export const checkDiscoverMethodItems: ITestItems[] = [
5 | {
6 | type: 'method',
7 | name: 'initialize',
8 | },
9 | {
10 | type: 'event',
11 | name: TerminalEventsEnum.Loaded,
12 | },
13 | {
14 | type: 'method',
15 | name: 'discoverReaders',
16 | },
17 | {
18 | type: 'event',
19 | name: TerminalEventsEnum.DiscoveredReaders,
20 | },
21 | {
22 | type: 'method',
23 | name: 'connectReader',
24 | },
25 | {
26 | type: 'event',
27 | name: TerminalEventsEnum.ConnectedReader,
28 | },
29 | {
30 | type: 'method',
31 | name: 'getConnectedReader',
32 | },
33 | {
34 | type: 'method',
35 | name: 'disconnectReader',
36 | },
37 | {
38 | type: 'event',
39 | name: TerminalEventsEnum.DisconnectedReader,
40 | },
41 | ];
42 |
--------------------------------------------------------------------------------
/demo/angular/src/app/terminal/terminal.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/app/terminal/terminal.page.scss
--------------------------------------------------------------------------------
/demo/angular/src/app/terminal/updateDeviceRequiredItems.ts:
--------------------------------------------------------------------------------
1 | import { ITestItems } from '../shared/interfaces';
2 | import { TerminalEventsEnum } from '@capacitor-community/stripe-terminal';
3 |
4 | export const updateDeviceRequiredItems: ITestItems[] = [
5 | {
6 | type: 'method',
7 | name: 'initialize',
8 | },
9 | {
10 | type: 'event',
11 | name: TerminalEventsEnum.Loaded,
12 | },
13 |
14 | {
15 | type: 'method',
16 | name: 'setSimulatorConfiguration:REQUIRED',
17 | },
18 | {
19 | type: 'method',
20 | name: 'discoverReaders',
21 | },
22 | {
23 | type: 'event',
24 | name: TerminalEventsEnum.DiscoveredReaders,
25 | },
26 | {
27 | type: 'method',
28 | name: 'connectReader',
29 | },
30 | {
31 | type: 'event',
32 | name: TerminalEventsEnum.ConnectedReader,
33 | },
34 | {
35 | type: 'event',
36 | name: TerminalEventsEnum.StartInstallingUpdate,
37 | },
38 | {
39 | type: 'event',
40 | name: TerminalEventsEnum.ReaderSoftwareUpdateProgress,
41 | },
42 | {
43 | type: 'event',
44 | name: TerminalEventsEnum.FinishInstallingUpdate,
45 | },
46 | {
47 | type: 'method',
48 | name: 'disconnectReader',
49 | },
50 | {
51 | type: 'event',
52 | name: TerminalEventsEnum.DisconnectedReader,
53 | },
54 | ];
55 |
--------------------------------------------------------------------------------
/demo/angular/src/app/terminal/updateDeviceUpdateItems.ts:
--------------------------------------------------------------------------------
1 | import { ITestItems } from '../shared/interfaces';
2 | import { TerminalEventsEnum } from '@capacitor-community/stripe-terminal';
3 |
4 | export const updateDeviceUpdateItems: ITestItems[] = [
5 | {
6 | type: 'method',
7 | name: 'initialize',
8 | },
9 | {
10 | type: 'event',
11 | name: TerminalEventsEnum.Loaded,
12 | },
13 | {
14 | type: 'method',
15 | name: 'discoverReaders',
16 | },
17 | {
18 | type: 'event',
19 | name: TerminalEventsEnum.DiscoveredReaders,
20 | },
21 | {
22 | type: 'method',
23 | name: 'connectReader',
24 | },
25 | {
26 | type: 'event',
27 | name: TerminalEventsEnum.ConnectedReader,
28 | },
29 |
30 | {
31 | type: 'method',
32 | name: 'setSimulatorConfiguration:UPDATE_AVAILABLE',
33 | },
34 | {
35 | type: 'event',
36 | name: TerminalEventsEnum.ReportAvailableUpdate,
37 | },
38 | {
39 | type: 'method',
40 | name: 'installAvailableUpdate',
41 | },
42 | {
43 | type: 'event',
44 | name: TerminalEventsEnum.StartInstallingUpdate,
45 | },
46 | {
47 | type: 'event',
48 | name: TerminalEventsEnum.ReaderSoftwareUpdateProgress,
49 | },
50 | {
51 | type: 'method',
52 | name: 'cancelInstallUpdate',
53 | },
54 | {
55 | type: 'method',
56 | name: 'disconnectReader',
57 | },
58 | {
59 | type: 'event',
60 | name: TerminalEventsEnum.DisconnectedReader,
61 | },
62 | ];
63 |
--------------------------------------------------------------------------------
/demo/angular/src/assets/icon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/angular/src/assets/icon/favicon.png
--------------------------------------------------------------------------------
/demo/angular/src/assets/shapes.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/angular/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true,
3 | api: 'https://j3x0ln9gj7.execute-api.ap-northeast-1.amazonaws.com/dev/',
4 |
5 | /**
6 | * Danger: This is production environment using production key.
7 | * For testing ApplePay and GooglePay, but If it fails, payment will occur.
8 | */
9 | // api: 'https://5vohl66z2e.execute-api.ap-northeast-1.amazonaws.com/prod/',
10 | };
11 |
--------------------------------------------------------------------------------
/demo/angular/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false,
7 | // api: 'http://localhost:3000/',
8 | api: 'https://j3x0ln9gj7.execute-api.ap-northeast-1.amazonaws.com/dev/',
9 | };
10 |
--------------------------------------------------------------------------------
/demo/angular/src/global.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * App Global CSS
3 | * ----------------------------------------------------------------------------
4 | * Put style rules here that you want to apply globally. These styles are for
5 | * the entire app and not just one component. Additionally, this file can be
6 | * used as an entry point to import other CSS/Sass files to be included in the
7 | * output CSS.
8 | * For more information on global stylesheets, visit the documentation:
9 | * https://ionicframework.com/docs/layout/global-stylesheets
10 | */
11 |
12 | /* Core CSS required for Ionic components to work properly */
13 | @import "@ionic/angular/css/core.css";
14 |
15 | /* Basic CSS for apps built with Ionic */
16 | @import "@ionic/angular/css/normalize.css";
17 | @import "@ionic/angular/css/structure.css";
18 | @import "@ionic/angular/css/typography.css";
19 | @import '@ionic/angular/css/display.css';
20 |
21 | /* Optional CSS utils that can be commented out */
22 | @import "@ionic/angular/css/padding.css";
23 | @import "@ionic/angular/css/float-elements.css";
24 | @import "@ionic/angular/css/text-alignment.css";
25 | @import "@ionic/angular/css/text-transformation.css";
26 | @import "@ionic/angular/css/flex-utils.css";
27 |
--------------------------------------------------------------------------------
/demo/angular/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/demo/angular/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode, importProvidersFrom } from '@angular/core';
2 |
3 | import { environment } from './environments/environment';
4 |
5 | import { defineCustomElements } from 'stripe-pwa-elements/loader';
6 | import { AppComponent } from './app/app.component';
7 | import {
8 | provideHttpClient,
9 | withInterceptorsFromDi,
10 | } from '@angular/common/http';
11 | import { routes } from './app/app.routes';
12 | import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
13 | import {
14 | IonicRouteStrategy,
15 | provideIonicAngular,
16 | } from '@ionic/angular/standalone';
17 | import { provideRouter, RouteReuseStrategy } from '@angular/router';
18 |
19 | if (environment.production) {
20 | enableProdMode();
21 | }
22 |
23 | bootstrapApplication(AppComponent, {
24 | providers: [
25 | provideRouter(routes),
26 | importProvidersFrom(BrowserModule),
27 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
28 | provideHttpClient(withInterceptorsFromDi()),
29 | provideIonicAngular({}),
30 | ],
31 | })
32 | .then(() => defineCustomElements(window))
33 | .catch((err) => console.log(err));
34 |
--------------------------------------------------------------------------------
/demo/angular/src/zone-flags.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Prevents Angular change detection from
3 | * running with certain Web Component callbacks
4 | */
5 |
6 | (window as any).__Zone_disable_customElements = true;
7 |
--------------------------------------------------------------------------------
/demo/angular/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": [
9 | "src/main.ts",
10 | "src/polyfills.ts"
11 | ],
12 | "include": [
13 | "src/**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/demo/angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "compileOnSave": false,
4 | "compilerOptions": {
5 | "baseUrl": "./",
6 | "outDir": "./dist/out-tsc",
7 | "forceConsistentCasingInFileNames": true,
8 | "esModuleInterop": true,
9 | "strict": false,
10 | "noImplicitOverride": true,
11 | "noPropertyAccessFromIndexSignature": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "sourceMap": true,
15 | "declaration": false,
16 | "experimentalDecorators": true,
17 | "moduleResolution": "node",
18 | "importHelpers": true,
19 | "target": "es2022",
20 | "module": "es2022",
21 | "lib": [
22 | "es2022",
23 | "dom",
24 | ],
25 | "useDefineForClassFields": false
26 | },
27 | "angularCompilerOptions": {
28 | "enableI18nLegacyMessageIdFormat": false,
29 | "strictInjectionParameters": true,
30 | "strictInputAccessModifiers": true,
31 | "strictTemplates": true
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/demo/angular/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "src/**/*.spec.ts",
16 | "src/**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/demo/react/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 | .vscode
21 | .idea
22 |
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # Optional eslint cache
28 | .eslintcache
29 |
--------------------------------------------------------------------------------
/demo/react/android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build/*
2 | !/build/.npmkeep
3 |
--------------------------------------------------------------------------------
/demo/react/android/app/capacitor.build.gradle:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2 |
3 | android {
4 | compileOptions {
5 | sourceCompatibility JavaVersion.VERSION_17
6 | targetCompatibility JavaVersion.VERSION_17
7 | }
8 | }
9 |
10 | apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
11 | dependencies {
12 | implementation project(':capacitor-community-stripe')
13 | implementation project(':capacitor-app')
14 | implementation project(':capacitor-haptics')
15 | implementation project(':capacitor-keyboard')
16 | implementation project(':capacitor-status-bar')
17 |
18 | }
19 |
20 |
21 | if (hasProperty('postBuildExtras')) {
22 | postBuildExtras()
23 | }
24 |
--------------------------------------------------------------------------------
/demo/react/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.myapp;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import android.content.Context;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 | import androidx.test.platform.app.InstrumentationRegistry;
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * @see Testing documentation
15 | */
16 | @RunWith(AndroidJUnit4.class)
17 | public class ExampleInstrumentedTest {
18 |
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23 |
24 | assertEquals("com.getcapacitor.app", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/assets/capacitor.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "appId": "io.ionic.starter",
3 | "appName": "react",
4 | "webDir": "build",
5 | "bundledWebRuntime": false
6 | }
7 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/assets/capacitor.plugins.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "pkg": "@capacitor-community/stripe",
4 | "classpath": "com.getcapacitor.community.stripe.StripePlugin"
5 | },
6 | {
7 | "pkg": "@capacitor/app",
8 | "classpath": "com.capacitorjs.plugins.app.AppPlugin"
9 | },
10 | {
11 | "pkg": "@capacitor/haptics",
12 | "classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
13 | },
14 | {
15 | "pkg": "@capacitor/keyboard",
16 | "classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
17 | },
18 | {
19 | "pkg": "@capacitor/status-bar",
20 | "classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/java/io/ionic/starter/MainActivity.java:
--------------------------------------------------------------------------------
1 | package io.ionic.starter;
2 |
3 | import com.getcapacitor.BridgeActivity;
4 |
5 | public class MainActivity extends BridgeActivity {}
6 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-land-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-land-hdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-land-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-land-mdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-land-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-land-xhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-land-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-land-xxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-land-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-land-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-port-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-port-hdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-port-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-port-mdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-port-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-port-xhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-port-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-port-xxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-port-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable-port-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/drawable/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/drawable/splash.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | capacitor-stripe
4 | capacitor-stripe
5 | io.ionic.starter
6 | io.ionic.starter
7 |
8 | pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM
9 | true
10 | US
11 | Widget Store
12 | true
13 | false
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
17 |
18 |
19 |
22 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/xml/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/react/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.myapp;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import org.junit.Test;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 |
14 | @Test
15 | public void addition_isCorrect() throws Exception {
16 | assertEquals(4, 2 + 2);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/demo/react/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | mavenCentral()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:8.2.1'
11 | classpath 'com.google.gms:google-services:4.4.0'
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | apply from: "variables.gradle"
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | mavenCentral()
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/demo/react/android/capacitor.settings.gradle:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2 | include ':capacitor-android'
3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
4 |
5 | include ':capacitor-community-stripe'
6 | project(':capacitor-community-stripe').projectDir = new File('../node_modules/@capacitor-community/stripe/android')
7 |
8 | include ':capacitor-app'
9 | project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
10 |
11 | include ':capacitor-haptics'
12 | project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
13 |
14 | include ':capacitor-keyboard'
15 | project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
16 |
17 | include ':capacitor-status-bar'
18 | project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
19 |
--------------------------------------------------------------------------------
/demo/react/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
--------------------------------------------------------------------------------
/demo/react/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/demo/react/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/demo/react/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | include ':capacitor-cordova-android-plugins'
3 | project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
4 |
5 | apply from: 'capacitor.settings.gradle'
--------------------------------------------------------------------------------
/demo/react/android/variables.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | minSdkVersion = 22
3 | compileSdkVersion = 34
4 | targetSdkVersion = 34
5 | androidxActivityVersion = '1.8.0'
6 | androidxAppCompatVersion = '1.6.1'
7 | androidxCoordinatorLayoutVersion = '1.2.0'
8 | androidxCoreVersion = '1.12.0'
9 | androidxFragmentVersion = '1.6.2'
10 | coreSplashScreenVersion = '1.0.1'
11 | androidxWebkitVersion = '1.9.0'
12 | junitVersion = '4.13.2'
13 | androidxJunitVersion = '1.1.5'
14 | androidxEspressoCoreVersion = '3.5.1'
15 | cordovaAndroidVersion = '10.1.1'
16 | }
--------------------------------------------------------------------------------
/demo/react/capacitor.config.ts:
--------------------------------------------------------------------------------
1 | import { CapacitorConfig } from '@capacitor/cli';
2 |
3 | const config: CapacitorConfig = {
4 | appId: 'io.ionic.starter',
5 | appName: 'react',
6 | webDir: 'build',
7 | bundledWebRuntime: false
8 | };
9 |
10 | export default config;
11 |
--------------------------------------------------------------------------------
/demo/react/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react",
3 | "integrations": {
4 | "capacitor": {}
5 | },
6 | "type": "react"
7 | }
8 |
--------------------------------------------------------------------------------
/demo/react/ios/.gitignore:
--------------------------------------------------------------------------------
1 | App/build
2 | App/Pods
3 | App/Podfile.lock
4 | App/App/public
5 | DerivedData
6 | xcuserdata
7 |
8 | # Cordova plugins for Capacitor
9 | capacitor-cordova-ios-plugins
10 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "splash-2732x2732-2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "splash-2732x2732-1.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "splash-2732x2732.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | react
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSAllowsArbitraryLoads
28 |
29 |
30 | UILaunchStoryboardName
31 | LaunchScreen
32 | UIMainStoryboardFile
33 | Main
34 | UIRequiredDeviceCapabilities
35 |
36 | armv7
37 |
38 | UISupportedInterfaceOrientations
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UISupportedInterfaceOrientations~ipad
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationPortraitUpsideDown
48 | UIInterfaceOrientationLandscapeLeft
49 | UIInterfaceOrientationLandscapeRight
50 |
51 | UIViewControllerBasedStatusBarAppearance
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App/capacitor.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "appId": "io.ionic.starter",
3 | "appName": "react",
4 | "webDir": "build",
5 | "bundledWebRuntime": false,
6 | "packageClassList": [
7 | "StripePlugin",
8 | "StripePlugin",
9 | "AppPlugin",
10 | "HapticsPlugin",
11 | "KeyboardPlugin",
12 | "StatusBarPlugin"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/demo/react/ios/App/App/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/react/ios/App/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
2 |
3 | platform :ios, '13.0'
4 | use_frameworks!
5 |
6 | # workaround to avoid Xcode caching of Pods that requires
7 | # Product -> Clean Build Folder after new Cordova plugins installed
8 | # Requires CocoaPods 1.6 or newer
9 | install! 'cocoapods', :disable_input_output_paths => true
10 |
11 | def capacitor_pods
12 | pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13 | pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14 | pod 'CapacitorCommunityStripe', :path => '../../node_modules/@capacitor-community/stripe'
15 | pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
16 | pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
17 | pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
18 | pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
19 | end
20 |
21 | target 'App' do
22 | capacitor_pods
23 | # Add your Pods here
24 | end
25 |
--------------------------------------------------------------------------------
/demo/react/public/assets/icon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/public/assets/icon/favicon.png
--------------------------------------------------------------------------------
/demo/react/public/assets/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/public/assets/icon/icon.png
--------------------------------------------------------------------------------
/demo/react/public/assets/shapes.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/react/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/demo/react/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Ionic App",
3 | "name": "My Ionic App",
4 | "icons": [
5 | {
6 | "src": "assets/icon/favicon.png",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "assets/icon/icon.png",
12 | "type": "image/png",
13 | "sizes": "512x512",
14 | "purpose": "maskable"
15 | }
16 | ],
17 | "start_url": ".",
18 | "display": "standalone",
19 | "theme_color": "#ffffff",
20 | "background_color": "#ffffff"
21 | }
22 |
--------------------------------------------------------------------------------
/demo/react/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders without crashing', () => {
6 | const { baseElement } = render();
7 | expect(baseElement).toBeDefined();
8 | });
9 |
--------------------------------------------------------------------------------
/demo/react/src/components/ExploreContainer.css:
--------------------------------------------------------------------------------
1 | .container {
2 | text-align: center;
3 | position: absolute;
4 | left: 0;
5 | right: 0;
6 | top: 50%;
7 | transform: translateY(-50%);
8 | }
9 |
10 | .container strong {
11 | font-size: 20px;
12 | line-height: 26px;
13 | }
14 |
15 | .container p {
16 | font-size: 16px;
17 | line-height: 22px;
18 | color: #8c8c8c;
19 | margin: 0;
20 | }
21 |
22 | .container a {
23 | text-decoration: none;
24 | }
--------------------------------------------------------------------------------
/demo/react/src/components/ExploreContainer.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import './ExploreContainer.css';
3 |
4 | interface ContainerProps {
5 | name: string;
6 | }
7 |
8 | const ExploreContainer: React.FC = ({ name }) => {
9 | return (
10 |
14 | );
15 | };
16 |
17 | export default ExploreContainer;
18 |
--------------------------------------------------------------------------------
/demo/react/src/hooks/payment-sheet.ts:
--------------------------------------------------------------------------------
1 | import { useCallback, useMemo } from "react"
2 |
3 |
4 | export const usePaymentSheet = () => {
5 | const api = useMemo(() => {
6 | if (process.env.REACT_APP_API_URL) {
7 | return process.env.REACT_APP_API_URL
8 | }
9 | return 'https://j3x0ln9gj7.execute-api.ap-northeast-1.amazonaws.com/dev/'
10 | },[])
11 | const createPaymentIntent = useCallback(async (): Promise<{
12 | customer: string;
13 | paymentIntent: string;
14 | ephemeralKey: string;
15 | }> => {
16 | const {
17 | customer,
18 | paymentIntent,
19 | ephemeralKey,
20 | } = await fetch(`${api}intent`, {
21 | method: 'POST'
22 | }).then(res => res.json())
23 | return {
24 | customer,
25 | paymentIntent,
26 | ephemeralKey,
27 | }
28 | }, [api])
29 | return {
30 | createPaymentIntent,
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/demo/react/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 | import * as serviceWorkerRegistration from './serviceWorkerRegistration';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: https://cra.link/PWA
17 | serviceWorkerRegistration.unregister();
18 |
19 | // If you want to start measuring performance in your app, pass a function
20 | // to log results (for example: reportWebVitals(console.log))
21 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
22 | reportWebVitals();
23 |
--------------------------------------------------------------------------------
/demo/react/src/interfaces.tsx:
--------------------------------------------------------------------------------
1 |
2 | export type ProcessStatus = 'ready' | 'create' | 'present' | 'confirm'
3 | export type TaskResult = '' | 'inprogress' | 'success' | 'error'
4 |
--------------------------------------------------------------------------------
/demo/react/src/pages/Tab1.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/src/pages/Tab1.css
--------------------------------------------------------------------------------
/demo/react/src/pages/Tab1.tsx:
--------------------------------------------------------------------------------
1 | import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
2 | import './Tab1.css';
3 | import { PaymentSheet } from './Tab1/PaymentSheet';
4 | import { PaymentFlow } from './Tab1/PaymentFlow';
5 | import { ApplePay } from './Tab1/ApplePay';
6 | import { GooglePay } from './Tab1/GooglePay';
7 | import React from 'react';
8 |
9 | const Tab1: React.FC = () => {
10 | return (
11 |
12 |
13 |
14 | React Demo
15 |
16 |
17 |
18 |
19 |
20 | Demo
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | );
30 | };
31 |
32 | export default Tab1;
33 |
--------------------------------------------------------------------------------
/demo/react/src/pages/Tab2.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/src/pages/Tab2.css
--------------------------------------------------------------------------------
/demo/react/src/pages/Tab3.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/react/src/pages/Tab3.css
--------------------------------------------------------------------------------
/demo/react/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/demo/react/src/reportWebVitals.ts:
--------------------------------------------------------------------------------
1 | import { ReportHandler } from 'web-vitals';
2 |
3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4 | if (onPerfEntry && onPerfEntry instanceof Function) {
5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6 | getCLS(onPerfEntry);
7 | getFID(onPerfEntry);
8 | getFCP(onPerfEntry);
9 | getLCP(onPerfEntry);
10 | getTTFB(onPerfEntry);
11 | });
12 | }
13 | };
14 |
15 | export default reportWebVitals;
16 |
--------------------------------------------------------------------------------
/demo/react/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
7 | // Mock matchmedia
8 | window.matchMedia = window.matchMedia || function() {
9 | return {
10 | matches: false,
11 | addListener: function() {},
12 | removeListener: function() {}
13 | };
14 | };
15 |
--------------------------------------------------------------------------------
/demo/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "allowJs": true,
10 | "skipLibCheck": true,
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true,
13 | "strict": true,
14 | "forceConsistentCasingInFileNames": true,
15 | "noFallthroughCasesInSwitch": true,
16 | "module": "esnext",
17 | "moduleResolution": "node",
18 | "resolveJsonModule": true,
19 | "isolatedModules": true,
20 | "noEmit": true,
21 | "jsx": "react-jsx"
22 | },
23 | "include": [
24 | "src"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/demo/screenshots/apple-pay-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/apple-pay-ios.png
--------------------------------------------------------------------------------
/demo/screenshots/google-pay-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/google-pay-android.png
--------------------------------------------------------------------------------
/demo/screenshots/google-pay-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/google-pay-web.png
--------------------------------------------------------------------------------
/demo/screenshots/identity-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/identity-android.png
--------------------------------------------------------------------------------
/demo/screenshots/identity-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/identity-ios.png
--------------------------------------------------------------------------------
/demo/screenshots/identity-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/identity-web.png
--------------------------------------------------------------------------------
/demo/screenshots/payment-flow-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/payment-flow-android.png
--------------------------------------------------------------------------------
/demo/screenshots/payment-flow-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/payment-flow-ios.png
--------------------------------------------------------------------------------
/demo/screenshots/payment-sheet-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/payment-sheet-android.png
--------------------------------------------------------------------------------
/demo/screenshots/payment-sheet-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/payment-sheet-ios.png
--------------------------------------------------------------------------------
/demo/screenshots/payment-sheet-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/demo/screenshots/payment-sheet-web.png
--------------------------------------------------------------------------------
/demo/server/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parser: '@typescript-eslint/parser',
3 | parserOptions: {
4 | project: 'tsconfig.json',
5 | sourceType: 'module',
6 | },
7 | plugins: ['@typescript-eslint/eslint-plugin'],
8 | extends: [
9 | 'plugin:@typescript-eslint/eslint-recommended',
10 | 'plugin:@typescript-eslint/recommended',
11 | 'prettier',
12 | ],
13 | root: true,
14 | env: {
15 | node: true,
16 | jest: true,
17 | },
18 | rules: {
19 | '@typescript-eslint/interface-name-prefix': 'off',
20 | '@typescript-eslint/explicit-function-return-type': 'off',
21 | '@typescript-eslint/no-explicit-any': 'off',
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/demo/server/.gitignore:
--------------------------------------------------------------------------------
1 | # compiled output
2 | /dist
3 | /node_modules
4 |
5 | # Logs
6 | logs
7 | *.log
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 | lerna-debug.log*
12 |
13 | # OS
14 | .DS_Store
15 |
16 | # Tests
17 | /coverage
18 | /.nyc_output
19 |
20 | # IDEs and editors
21 | /.idea
22 | .project
23 | .classpath
24 | .c9/
25 | *.launch
26 | .settings/
27 | *.sublime-workspace
28 |
29 | # IDE - VSCode
30 | .vscode/*
31 | !.vscode/settings.json
32 | !.vscode/tasks.json
33 | !.vscode/launch.json
34 | !.vscode/extensions.json
35 |
36 | .serverless/
37 |
--------------------------------------------------------------------------------
/demo/server/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "all"
4 | }
--------------------------------------------------------------------------------
/demo/server/nest-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "collection": "@nestjs/schematics",
3 | "sourceRoot": "src"
4 | }
5 |
--------------------------------------------------------------------------------
/demo/server/serverless.yml:
--------------------------------------------------------------------------------
1 | service: capacitor-stripe-server
2 |
3 | provider:
4 | name: aws
5 | runtime: nodejs20.x
6 | region: ap-northeast-1
7 | environment:
8 | TZ: Asia/Tokyo
9 | apiGateway:
10 | shouldStartNameWithService: true
11 |
12 | plugins:
13 | - serverless-offline
14 | - serverless-prune-plugin
15 |
16 | custom:
17 | prune:
18 | automatic: true
19 | number: 3
20 |
21 | package:
22 | exclude:
23 | - .git/**
24 | - src/**
25 | - test/**
26 | - e2e/**
27 | - nodemon.json
28 | - README.md
29 |
30 | functions:
31 | index:
32 | handler: dist/index.handler
33 | events:
34 | - http:
35 | cors: true
36 | path: '/'
37 | method: any
38 | - http:
39 | cors: true
40 | path: '{proxy+}'
41 | method: any
42 |
--------------------------------------------------------------------------------
/demo/server/src/app.controller.spec.ts:
--------------------------------------------------------------------------------
1 | import { Test, TestingModule } from '@nestjs/testing';
2 | import { AppController } from './app.controller';
3 | import { AppService } from './app.service';
4 |
5 | describe('AppController', () => {
6 | let appController: AppController;
7 |
8 | beforeEach(async () => {
9 | const app: TestingModule = await Test.createTestingModule({
10 | controllers: [AppController],
11 | providers: [AppService],
12 | }).compile();
13 |
14 | appController = app.get(AppController);
15 | });
16 |
17 | describe('root', () => {
18 | it('should return "Hello World!"', () => {
19 | expect(appController.getHello()).toBe('Hello World!');
20 | });
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/demo/server/src/app.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { AppController } from './app.controller';
3 | import { AppService } from './app.service';
4 |
5 | @Module({
6 | imports: [],
7 | controllers: [AppController],
8 | providers: [AppService],
9 | })
10 | export class AppModule {}
11 |
--------------------------------------------------------------------------------
/demo/server/src/app.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 |
3 | @Injectable()
4 | export class AppService {
5 | getHello(): string {
6 | return 'Hello World!';
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/server/src/index.ts:
--------------------------------------------------------------------------------
1 | import { NestFactory } from '@nestjs/core';
2 | import { ExpressAdapter } from '@nestjs/platform-express';
3 | import serverlessExpress from '@codegenie/serverless-express';
4 | import { Context, Handler } from 'aws-lambda';
5 | import express from 'express';
6 |
7 | import { AppModule } from './app.module';
8 |
9 | let cachedServer: Handler;
10 |
11 | async function bootstrap() {
12 | if (!cachedServer) {
13 | const expressApp = express();
14 | const nestApp = await NestFactory.create(
15 | AppModule,
16 | new ExpressAdapter(expressApp),
17 | );
18 |
19 | nestApp.enableCors();
20 |
21 | await nestApp.init();
22 |
23 | cachedServer = serverlessExpress({ app: expressApp });
24 | }
25 |
26 | return cachedServer;
27 | }
28 |
29 | export const handler = async (event: any, context: Context, callback: any) => {
30 | const server = await bootstrap();
31 | return server(event, context, callback);
32 | };
33 |
--------------------------------------------------------------------------------
/demo/server/src/main.ts:
--------------------------------------------------------------------------------
1 | import { NestFactory } from '@nestjs/core';
2 | import { AppModule } from './app.module';
3 |
4 | async function bootstrap() {
5 | const app = await NestFactory.create(AppModule);
6 | app.enableCors();
7 | await app.listen(3000);
8 | }
9 | bootstrap();
10 |
--------------------------------------------------------------------------------
/demo/server/src/payment-intent.dto.ts:
--------------------------------------------------------------------------------
1 | export class CreatePaymentIntentDTO {
2 | amount?: number;
3 | currency?: string;
4 | customer_id?: string;
5 | }
6 |
7 | export class CreateSetupIntentDTO {
8 | customer_id?: string;
9 | }
10 |
--------------------------------------------------------------------------------
/demo/server/src/swagger.ts:
--------------------------------------------------------------------------------
1 | import { NestFactory } from '@nestjs/core';
2 | import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
3 | import { AppModule } from './app.module';
4 |
5 | async function bootstrap() {
6 | const app = await NestFactory.create(AppModule);
7 |
8 | const options = new DocumentBuilder()
9 | .setTitle('Cats example')
10 | .setDescription('The cats API description')
11 | .setVersion('1.0')
12 | .addTag('cats')
13 | .build();
14 | const document = SwaggerModule.createDocument(app, options);
15 | SwaggerModule.setup('api', app, document);
16 |
17 | await app.listen(3001);
18 | }
19 | bootstrap();
20 |
--------------------------------------------------------------------------------
/demo/server/test/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { Test, TestingModule } from '@nestjs/testing';
2 | import { INestApplication } from '@nestjs/common';
3 | import * as request from 'supertest';
4 | import { AppModule } from './../src/app.module';
5 |
6 | describe('AppController (e2e)', () => {
7 | let app: INestApplication;
8 |
9 | beforeEach(async () => {
10 | const moduleFixture: TestingModule = await Test.createTestingModule({
11 | imports: [AppModule],
12 | }).compile();
13 |
14 | app = moduleFixture.createNestApplication();
15 | await app.init();
16 | });
17 |
18 | it('/ (GET)', () => {
19 | return request(app.getHttpServer())
20 | .get('/')
21 | .expect(200)
22 | .expect('Hello World!');
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/demo/server/test/jest-e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "moduleFileExtensions": ["js", "json", "ts"],
3 | "rootDir": ".",
4 | "testEnvironment": "node",
5 | "testRegex": ".e2e-spec.ts$",
6 | "transform": {
7 | "^.+\\.(t|j)s$": "ts-jest"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/demo/server/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4 | }
5 |
--------------------------------------------------------------------------------
/demo/server/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "esModuleInterop": true,
5 | "declaration": true,
6 | "removeComments": true,
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "allowSyntheticDefaultImports": true,
10 | "target": "es2017",
11 | "sourceMap": true,
12 | "outDir": "./dist",
13 | "baseUrl": "./",
14 | "incremental": true
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@capacitor-community/stripe",
3 | "version": "7.2.0-0",
4 | "engines": {
5 | "node": ">=20.0.0"
6 | },
7 | "type": "module",
8 | "private": false,
9 | "description": "Stripe SDK bindings for Capacitor Applications",
10 | "scripts": {
11 | "release": "np --no-tests --no-publish --any-branch && node ./release.js"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/capacitor-community/stripe.git"
16 | },
17 | "devDependencies": {
18 | "np": "^7.7.0",
19 | "write-pkg": "^6.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/identity/.eslintignore:
--------------------------------------------------------------------------------
1 | build
2 | dist
3 |
--------------------------------------------------------------------------------
/packages/identity/.gitignore:
--------------------------------------------------------------------------------
1 | # node files
2 | dist
3 | node_modules
4 |
5 | # iOS files
6 | Pods
7 | Podfile.lock
8 | Package.resolved
9 | Build
10 | xcuserdata
11 | /.build
12 | /Packages
13 | xcuserdata/
14 | DerivedData/
15 | .swiftpm/configuration/registries.json
16 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
17 | .netrc
18 |
19 |
20 | # macOS files
21 | .DS_Store
22 |
23 |
24 |
25 | # Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
26 |
27 | # Built application files
28 | *.apk
29 | *.ap_
30 |
31 | # Files for the ART/Dalvik VM
32 | *.dex
33 |
34 | # Java class files
35 | *.class
36 |
37 | # Generated files
38 | bin
39 | gen
40 | out
41 |
42 | # Gradle files
43 | .gradle
44 | build
45 |
46 | # Local configuration file (sdk path, etc)
47 | local.properties
48 |
49 | # Proguard folder generated by Eclipse
50 | proguard
51 |
52 | # Log Files
53 | *.log
54 |
55 | # Android Studio Navigation editor temp files
56 | .navigation
57 |
58 | # Android Studio captures folder
59 | captures
60 |
61 | # IntelliJ
62 | *.iml
63 | .idea
64 |
65 | # Keystore files
66 | # Uncomment the following line if you do not want to check your keystore files in.
67 | #*.jks
68 |
69 | # External native build folder generated in Android Studio 2.2 and later
70 | .externalNativeBuild
71 |
--------------------------------------------------------------------------------
/packages/identity/CapacitorCommunityStripeIdentity.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'CapacitorCommunityStripeIdentity'
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.license = package['license']
10 | s.homepage = package['repository']['url']
11 | s.author = package['author']
12 | s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13 | s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14 | s.ios.deployment_target = '14.0'
15 | s.dependency 'Capacitor'
16 | s.dependency 'StripeIdentity', '~> 24.15.0'
17 | s.swift_version = '5.1'
18 | end
19 |
--------------------------------------------------------------------------------
/packages/identity/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.9
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "CapacitorCommunityStripeIdentity",
6 | platforms: [.iOS(.v14)],
7 | products: [
8 | .library(
9 | name: "CapacitorCommunityStripeIdentity",
10 | targets: ["StripeIdentityPlugin"])
11 | ],
12 | dependencies: [
13 | .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14 | .package(url: "https://github.com/stripe/stripe-ios-spm.git", exact: "24.15.0")
15 | ],
16 | targets: [
17 | .target(
18 | name: "StripeIdentityPlugin",
19 | dependencies: [
20 | .product(name: "Capacitor", package: "capacitor-swift-pm"),
21 | .product(name: "Cordova", package: "capacitor-swift-pm"),
22 | .product(name: "StripeIdentity", package: "stripe-ios-spm")
23 | ],
24 | path: "ios/Sources/StripeIdentityPlugin"),
25 | .testTarget(
26 | name: "StripeIdentityPluginTests",
27 | dependencies: ["StripeIdentityPlugin"],
28 | path: "ios/Tests/StripeIdentityPluginTests")
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/packages/identity/android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/packages/identity/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
--------------------------------------------------------------------------------
/packages/identity/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/identity/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/packages/identity/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/packages/identity/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/packages/identity/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':capacitor-android'
2 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
--------------------------------------------------------------------------------
/packages/identity/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.android
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import org.junit.Assert
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumented test, which will execute on an Android device.
11 | *
12 | * @see [Testing documentation](http://d.android.com/tools/testing)
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | @Throws(Exception::class)
18 | fun useAppContext() {
19 | // Context of the app under test.
20 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
21 |
22 | Assert.assertEquals("com.getcapacitor.android", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/identity/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/packages/identity/android/src/main/java/com/getcapacitor/community/stripe/identity/IdentityVerificationSheetEvent.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.identity;
2 |
3 |
4 | enum class IdentityVerificationSheetEvent(val webEventName: String) {
5 | Loaded("identityVerificationSheetLoaded"),
6 | FailedToLoad("identityVerificationSheetFailedToLoad"),
7 | Completed("identityVerificationSheetCompleted"),
8 | Canceled("identityVerificationSheetCanceled"),
9 | Failed("identityVerificationSheetFailed"),
10 | VerificationResult("identityVerificationResult"),
11 | }
12 |
--------------------------------------------------------------------------------
/packages/identity/android/src/main/java/com/getcapacitor/community/stripe/identity/models/Executor.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.identity.models
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import androidx.core.util.Supplier
6 | import com.getcapacitor.JSObject
7 | import com.google.android.gms.common.util.BiConsumer
8 |
9 | abstract class Executor(
10 | protected var contextSupplier: Supplier,
11 | protected val activitySupplier: Supplier,
12 | protected var notifyListenersFunction: BiConsumer,
13 | pluginLogTag: String,
14 | executorTag: String
15 | ) {
16 | protected val logTag: String = "$pluginLogTag|$executorTag"
17 |
18 | // Eventually we can change the notification directly here!
19 | protected fun notifyListeners(eventName: String, data: JSObject) {
20 | notifyListenersFunction.accept(eventName, data)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/identity/android/src/main/res/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/identity/android/src/main/res/.gitkeep
--------------------------------------------------------------------------------
/packages/identity/android/src/test/java/com/getcapacitor/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor
2 |
3 | import org.junit.Assert
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 | *
9 | * @see [Testing documentation](http://d.android.com/tools/testing)
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | @Throws(Exception::class)
14 | fun addition_isCorrect() {
15 | Assert.assertEquals(4, (2 + 2).toLong())
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/identity/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .build
3 | /Packages
4 | xcuserdata/
5 | DerivedData/
6 | .swiftpm/configuration/registries.json
7 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8 | .netrc
--------------------------------------------------------------------------------
/packages/identity/ios/Sources/StripeIdentityPlugin/IdentityVerificationSheetEvents.swift:
--------------------------------------------------------------------------------
1 | public enum IdentityVerificationSheetEvents: String {
2 | case Loaded = "identityVerificationSheetLoaded"
3 | case FailedToLoad = "identityVerificationSheetFailedToLoad"
4 | case Completed = "identityVerificationSheetCompleted"
5 | case Canceled = "identityVerificationSheetCanceled"
6 | case Failed = "identityVerificationSheetFailed"
7 | case VerificationResult = "identityVerificationResult"
8 | }
9 |
--------------------------------------------------------------------------------
/packages/identity/ios/Sources/StripeIdentityPlugin/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/identity/ios/Sources/StripeIdentityPlugin/StripeIdentityPlugin.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import Capacitor
3 | import StripeIdentity
4 | import PassKit
5 |
6 | /**
7 | * Please read the Capacitor iOS Plugin Development Guide
8 | * here: https://capacitorjs.com/docs/plugins/ios
9 | */
10 | @objc(StripeIdentityPlugin)
11 | public class StripeIdentityPlugin: CAPPlugin, CAPBridgedPlugin {
12 | public let identifier = "StripeIdentityPlugin"
13 | public let jsName = "StripeIdentity"
14 | public let pluginMethods: [CAPPluginMethod] = [
15 | CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
16 | CAPPluginMethod(name: "create", returnType: CAPPluginReturnPromise),
17 | CAPPluginMethod(name: "present", returnType: CAPPluginReturnPromise)
18 | ]
19 | private let implementation = StripeIdentity()
20 |
21 | override public func load() {
22 | super.load()
23 | self.implementation.plugin = self
24 | STPAPIClient.shared.appInfo = STPAppInfo(name: "@capacitor-community/stripe-identity", partnerId: nil, version: nil, url: nil)
25 | }
26 |
27 | @objc func initialize(_ call: CAPPluginCall) {
28 | self.implementation.initialize(call)
29 | }
30 |
31 | @objc func create(_ call: CAPPluginCall) {
32 | self.implementation.create(call)
33 | }
34 |
35 | @objc func present(_ call: CAPPluginCall) {
36 | self.implementation.present(call)
37 | }
38 |
39 | func getRootVC() -> UIViewController? {
40 | var window: UIWindow? = UIApplication.shared.delegate?.window ?? nil
41 |
42 | if window == nil {
43 | let scene: UIWindowScene? = UIApplication.shared.connectedScenes.first as? UIWindowScene
44 | window = scene?.windows.filter({$0.isKeyWindow}).first
45 | if window == nil {
46 | window = scene?.windows.first
47 | }
48 | }
49 | return window?.rootViewController
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/packages/identity/ios/Tests/StripeIdentityPluginTests/StripeIdentityPluginTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import StripeIdentityPlugin
3 |
4 | class StripeIdentityTests: XCTestCase {
5 | func testEcho() {
6 | // This is an example of a functional test case for a plugin.
7 | // Use XCTAssert and related functions to verify your tests produce the correct results.
8 |
9 | let implementation = StripeIdentity()
10 | // let value = "Hello, World!"
11 | // let result = implementation.echo(value)
12 | //
13 | // XCTAssertEqual(value, result)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/identity/rollup.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | input: 'dist/esm/index.js',
3 | output: [
4 | {
5 | file: 'dist/plugin.js',
6 | format: 'iife',
7 | name: 'capacitorStripe',
8 | globals: {
9 | '@capacitor/core': 'capacitorExports',
10 | },
11 | sourcemap: true,
12 | inlineDynamicImports: true,
13 | },
14 | {
15 | file: 'dist/plugin.cjs.js',
16 | format: 'cjs',
17 | sourcemap: true,
18 | inlineDynamicImports: true,
19 | },
20 | ],
21 | external: ['@capacitor/core'],
22 | };
23 |
--------------------------------------------------------------------------------
/packages/identity/src/events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum IdentityVerificationSheetEventsEnum {
2 | Loaded = 'identityVerificationSheetLoaded',
3 | FailedToLoad = 'identityVerificationSheetFailedToLoad',
4 | Completed = 'identityVerificationSheetCompleted',
5 | Canceled = 'identityVerificationSheetCanceled',
6 | Failed = 'identityVerificationSheetFailed',
7 | VerificationResult = 'identityVerificationResult'
8 | }
9 |
10 | export type IdentityVerificationSheetResultInterface =
11 | | IdentityVerificationSheetEventsEnum.Completed
12 | | IdentityVerificationSheetEventsEnum.Canceled
13 | | IdentityVerificationSheetEventsEnum.Failed;
14 |
--------------------------------------------------------------------------------
/packages/identity/src/index.ts:
--------------------------------------------------------------------------------
1 | import { registerPlugin } from '@capacitor/core';
2 |
3 | import type { StripeIdentityPlugin } from './definitions';
4 |
5 | const StripeIdentity = registerPlugin('StripeIdentity', {
6 | web: () => import('./web').then((m) => new m.StripeIdentityWeb()),
7 | });
8 |
9 | export * from './definitions';
10 | export { StripeIdentity };
11 |
--------------------------------------------------------------------------------
/packages/identity/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowUnreachableCode": false,
4 | "declaration": true,
5 | "esModuleInterop": true,
6 | "inlineSources": true,
7 | "lib": ["dom", "es2017"],
8 | "module": "esnext",
9 | "moduleResolution": "node",
10 | "noFallthroughCasesInSwitch": true,
11 | "noUnusedLocals": true,
12 | "noUnusedParameters": true,
13 | "outDir": "dist/esm",
14 | "pretty": true,
15 | "sourceMap": true,
16 | "strict": true,
17 | "target": "es2017"
18 | },
19 | "files": ["src/index.ts"]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/payment/.eslintignore:
--------------------------------------------------------------------------------
1 | build
2 | dist
3 |
--------------------------------------------------------------------------------
/packages/payment/.gitignore:
--------------------------------------------------------------------------------
1 | # node files
2 | dist
3 | node_modules
4 |
5 | # iOS files
6 | Pods
7 | Podfile.lock
8 | Package.resolved
9 | Build
10 | xcuserdata
11 | /.build
12 | /Packages
13 | xcuserdata/
14 | DerivedData/
15 | .swiftpm/configuration/registries.json
16 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
17 | .netrc
18 |
19 |
20 | # macOS files
21 | .DS_Store
22 |
23 |
24 |
25 | # Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
26 |
27 | # Built application files
28 | *.apk
29 | *.ap_
30 |
31 | # Files for the ART/Dalvik VM
32 | *.dex
33 |
34 | # Java class files
35 | *.class
36 |
37 | # Generated files
38 | bin
39 | gen
40 | out
41 |
42 | # Gradle files
43 | .gradle
44 | build
45 |
46 | # Local configuration file (sdk path, etc)
47 | local.properties
48 |
49 | # Proguard folder generated by Eclipse
50 | proguard
51 |
52 | # Log Files
53 | *.log
54 |
55 | # Android Studio Navigation editor temp files
56 | .navigation
57 |
58 | # Android Studio captures folder
59 | captures
60 |
61 | # IntelliJ
62 | *.iml
63 | .idea
64 |
65 | # Keystore files
66 | # Uncomment the following line if you do not want to check your keystore files in.
67 | #*.jks
68 |
69 | # External native build folder generated in Android Studio 2.2 and later
70 | .externalNativeBuild
71 |
--------------------------------------------------------------------------------
/packages/payment/.nvmrc:
--------------------------------------------------------------------------------
1 | v16.13.1
2 |
--------------------------------------------------------------------------------
/packages/payment/BREAKING.md:
--------------------------------------------------------------------------------
1 | # Breaking Changes
2 | ## 3.4.0
3 | ### Dependency
4 | - Update `stripe-pwa-elements` to v1.0.0. If you use this plugin in web platform, you should run `npm i stripe-pwa-elements@latest`.
5 |
6 | ## 3.3.0
7 | ### PaymentSheet and PaymentFlow
8 | - `useGooglePay` -> `enableGooglePay`
9 | - `useApplePay` -> `enableApplePay`
10 |
--------------------------------------------------------------------------------
/packages/payment/CapacitorCommunityStripe.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'CapacitorCommunityStripe'
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.license = package['license']
10 | s.homepage = package['repository']['url']
11 | s.author = package['author']
12 | s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13 | s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14 | s.ios.deployment_target = '14.0'
15 | s.dependency 'Capacitor'
16 | s.dependency 'StripePaymentSheet', '~> 24.15.0'
17 | s.dependency 'StripeApplePay', '~> 24.15.0'
18 | s.swift_version = '5.1'
19 | end
20 |
--------------------------------------------------------------------------------
/packages/payment/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.9
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "CapacitorCommunityStripe",
6 | platforms: [.iOS(.v14)],
7 | products: [
8 | .library(
9 | name: "CapacitorCommunityStripe",
10 | targets: ["StripePlugin"])
11 | ],
12 | dependencies: [
13 | .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14 | .package(url: "https://github.com/stripe/stripe-ios-spm.git", exact: "24.15.0")
15 | ],
16 | targets: [
17 | .target(
18 | name: "StripePlugin",
19 | dependencies: [
20 | .product(name: "Capacitor", package: "capacitor-swift-pm"),
21 | .product(name: "Cordova", package: "capacitor-swift-pm"),
22 | .product(name: "StripePaymentSheet", package: "stripe-ios-spm"),
23 | .product(name: "StripeApplePay", package: "stripe-ios-spm")
24 | ],
25 | path: "ios/Sources/StripePlugin"),
26 | .testTarget(
27 | name: "StripePluginTests",
28 | dependencies: ["StripePlugin"],
29 | path: "ios/Tests/StripePluginTests")
30 | ]
31 | )
32 |
--------------------------------------------------------------------------------
/packages/payment/android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/packages/payment/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
24 |
--------------------------------------------------------------------------------
/packages/payment/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/payment/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/packages/payment/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/packages/payment/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/packages/payment/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':capacitor-android'
2 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
--------------------------------------------------------------------------------
/packages/payment/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.android
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import org.junit.Assert
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumented test, which will execute on an Android device.
11 | *
12 | * @see [Testing documentation](http://d.android.com/tools/testing)
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | @Throws(Exception::class)
18 | fun useAppContext() {
19 | // Context of the app under test.
20 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
21 |
22 | Assert.assertEquals("com.getcapacitor.android", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/java/com/getcapacitor/community/stripe/StripePaymentMethodsListener.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe;
2 |
3 | import com.google.android.gms.wallet.PaymentData
4 |
5 | internal abstract class GooglePayCallback {
6 | abstract fun onSuccess(res: PaymentData)
7 | abstract fun onError(err: Exception)
8 | }
9 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/java/com/getcapacitor/community/stripe/googlepay/GooglePayEvent.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.googlepay;
2 |
3 | enum class GooglePayEvents(val webEventName: String) {
4 | Loaded("googlePayLoaded"),
5 | FailedToLoad("googlePayFailedToLoad"),
6 | Completed("googlePayCompleted"),
7 | Canceled("googlePayCanceled"),
8 | Failed("googlePayFailed"),
9 | }
10 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/java/com/getcapacitor/community/stripe/models/Executor.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.models
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import androidx.core.util.Supplier
6 | import com.getcapacitor.JSObject
7 | import com.google.android.gms.common.util.BiConsumer
8 |
9 | abstract class Executor(
10 | protected var contextSupplier: Supplier,
11 | protected val activitySupplier: Supplier,
12 | protected var notifyListenersFunction: BiConsumer,
13 | pluginLogTag: String,
14 | executorTag: String
15 | ) {
16 | protected val logTag: String = "$pluginLogTag|$executorTag"
17 |
18 | // Eventually we can change the notification directly here!
19 | protected fun notifyListeners(eventName: String, data: JSObject) {
20 | notifyListenersFunction.accept(eventName, data)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/java/com/getcapacitor/community/stripe/paymentflow/PaymentFlowEvent.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.paymentflow;
2 |
3 | enum class PaymentFlowEvents(val webEventName: String) {
4 | Loaded("paymentFlowLoaded"),
5 | FailedToLoad("paymentFlowFailedToLoad"),
6 | Opened("paymentFlowOpened"),
7 | FailedToOpen("paymentFlowFailedToOpen"),
8 | Completed("paymentFlowCompleted"),
9 | Canceled("paymentFlowCanceled"),
10 | Failed("paymentFlowFailed"),
11 | Created("paymentFlowCreated"),
12 | }
13 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/java/com/getcapacitor/community/stripe/paymentsheet/PaymentSheetEvent.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.paymentsheet;
2 |
3 | enum class PaymentSheetEvents(val webEventName: String) {
4 | Loaded("paymentSheetLoaded"),
5 | FailedToLoad("paymentSheetFailedToLoad"),
6 | Completed("paymentSheetCompleted"),
7 | Canceled("paymentSheetCanceled"),
8 | Failed("paymentSheetFailed"),
9 | }
10 |
--------------------------------------------------------------------------------
/packages/payment/android/src/main/res/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/payment/android/src/main/res/.gitkeep
--------------------------------------------------------------------------------
/packages/payment/android/src/test/java/com/getcapacitor/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor
2 |
3 | import org.junit.Assert
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 | *
9 | * @see [Testing documentation](http://d.android.com/tools/testing)
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | @Throws(Exception::class)
14 | fun addition_isCorrect() {
15 | Assert.assertEquals(4, (2 + 2).toLong())
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/payment/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .build
3 | /Packages
4 | xcuserdata/
5 | DerivedData/
6 | .swiftpm/configuration/registries.json
7 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8 | .netrc
--------------------------------------------------------------------------------
/packages/payment/ios/Sources/StripePlugin/ApplePay/ApplePayEvents.swift:
--------------------------------------------------------------------------------
1 | public enum ApplePayEvents: String {
2 | case Loaded = "applePayLoaded"
3 | case FailedToLoad = "applePayFailedToLoad"
4 | case Completed = "applePayCompleted"
5 | case Canceled = "applePayCanceled"
6 | case Failed = "applePayFailed"
7 | case DidSelectShippingContact = "applePayDidSelectShippingContact"
8 | case DidCreatePaymentMethod = "applePayDidCreatePaymentMethod"
9 | }
10 |
--------------------------------------------------------------------------------
/packages/payment/ios/Sources/StripePlugin/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/payment/ios/Sources/StripePlugin/PaymentFlow/PaymentFlowEvents.swift:
--------------------------------------------------------------------------------
1 | public enum PaymentFlowEvents: String {
2 | case Loaded = "paymentFlowLoaded"
3 | case FailedToLoad = "paymentFlowFailedToLoad"
4 | case Opened = "paymentFlowOpened"
5 | case FailedToOpen = "paymentFlowFailedToOpen"
6 | case Completed = "paymentFlowCompleted"
7 | case Canceled = "paymentFlowCanceled"
8 | case Failed = "paymentFlowFailed"
9 | case Created = "paymentFlowCreated"
10 | }
11 |
--------------------------------------------------------------------------------
/packages/payment/ios/Sources/StripePlugin/PaymentSheet/PaymentSheetEvents.swift:
--------------------------------------------------------------------------------
1 | public enum PaymentSheetEvents: String {
2 | case Loaded = "paymentSheetLoaded"
3 | case FailedToLoad = "paymentSheetFailedToLoad"
4 | case Completed = "paymentSheetCompleted"
5 | case Canceled = "paymentSheetCanceled"
6 | case Failed = "paymentSheetFailed"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/payment/ios/Sources/StripePlugin/PaymentSheetHelper.swift:
--------------------------------------------------------------------------------
1 | import StripePaymentSheet
2 |
3 | class PaymentSheetHelper {
4 | func getCollectionModeValue(mode: String) -> PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode {
5 | switch mode {
6 | case "always":
7 | return .always
8 | case "never":
9 | return .never
10 | default:
11 | return .automatic
12 | }
13 | }
14 |
15 | func getAddressCollectionModeValue(mode: String) -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode {
16 | switch mode {
17 | case "full":
18 | return .full
19 | case "never":
20 | return .never
21 | default:
22 | return .automatic
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/payment/ios/Tests/StripePluginTests/StripePluginTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import StripePlugin
3 |
4 | class StripeTests: XCTestCase {
5 | func testEcho() {
6 | // This is an example of a functional test case for a plugin.
7 | // Use XCTAssert and related functions to verify your tests produce the correct results.
8 |
9 | let implementation = Stripe()
10 | // let value = "Hello, World!"
11 | // let result = implementation.echo(value)
12 | //
13 | // XCTAssertEqual(value, result)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/payment/rollup.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | input: 'dist/esm/index.js',
3 | output: [
4 | {
5 | file: 'dist/plugin.js',
6 | format: 'iife',
7 | name: 'capacitorStripe',
8 | globals: {
9 | '@capacitor/core': 'capacitorExports',
10 | },
11 | sourcemap: true,
12 | inlineDynamicImports: true,
13 | },
14 | {
15 | file: 'dist/plugin.cjs.js',
16 | format: 'cjs',
17 | sourcemap: true,
18 | inlineDynamicImports: true,
19 | },
20 | ],
21 | external: ['@capacitor/core'],
22 | };
23 |
--------------------------------------------------------------------------------
/packages/payment/src/applepay/apple-pay-difinitions.interface.ts:
--------------------------------------------------------------------------------
1 | import type { PluginListenerHandle } from '@capacitor/core';
2 |
3 | import type {CreateApplePayOption, DidSelectShippingContact} from '../shared';
4 |
5 | import type { ApplePayEventsEnum, ApplePayResultInterface } from './apple-pay-events.enum';
6 |
7 | export interface ApplePayDefinitions {
8 | isApplePayAvailable(): Promise;
9 |
10 | createApplePay(options: CreateApplePayOption): Promise;
11 |
12 | presentApplePay(): Promise<{
13 | paymentResult: ApplePayResultInterface;
14 | }>;
15 |
16 | addListener(
17 | eventName: ApplePayEventsEnum.Loaded,
18 | listenerFunc: () => void,
19 | ): Promise;
20 |
21 | addListener(
22 | eventName: ApplePayEventsEnum.FailedToLoad,
23 | listenerFunc: (error: string) => void,
24 | ): Promise;
25 |
26 | addListener(
27 | eventName: ApplePayEventsEnum.Completed,
28 | listenerFunc: () => void,
29 | ): Promise;
30 |
31 | addListener(
32 | eventName: ApplePayEventsEnum.Canceled,
33 | listenerFunc: () => void,
34 | ): Promise;
35 |
36 | addListener(
37 | eventName: ApplePayEventsEnum.Failed,
38 | listenerFunc: (error: string) => void,
39 | ): Promise;
40 |
41 | addListener(
42 | eventName: ApplePayEventsEnum.DidSelectShippingContact,
43 | listenerFunc: (data: DidSelectShippingContact) => void,
44 | ): Promise;
45 |
46 | addListener(
47 | eventName: ApplePayEventsEnum.DidCreatePaymentMethod,
48 | listenerFunc: (data: DidSelectShippingContact) => void,
49 | ): Promise;
50 | }
51 |
--------------------------------------------------------------------------------
/packages/payment/src/applepay/apple-pay-events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum ApplePayEventsEnum {
2 | Loaded = "applePayLoaded",
3 | FailedToLoad = "applePayFailedToLoad",
4 | Completed = "applePayCompleted",
5 | Canceled = "applePayCanceled",
6 | Failed = "applePayFailed",
7 | DidSelectShippingContact = "applePayDidSelectShippingContact",
8 | DidCreatePaymentMethod = "applePayDidCreatePaymentMethod",
9 | }
10 | export type ApplePayResultInterface =
11 | | ApplePayEventsEnum.Completed
12 | | ApplePayEventsEnum.Canceled
13 | | ApplePayEventsEnum.Failed
14 | | ApplePayEventsEnum.DidSelectShippingContact
15 | | ApplePayEventsEnum.DidCreatePaymentMethod;
16 |
--------------------------------------------------------------------------------
/packages/payment/src/applepay/index.ts:
--------------------------------------------------------------------------------
1 | export * from './apple-pay-events.enum';
2 | export * from './apple-pay-difinitions.interface';
3 |
--------------------------------------------------------------------------------
/packages/payment/src/definitions.ts:
--------------------------------------------------------------------------------
1 | import type { ApplePayDefinitions } from './applepay';
2 | import type { GooglePayDefinitions } from './googlepay';
3 | import type { PaymentFlowDefinitions } from './paymentflow';
4 | import type { PaymentSheetDefinitions } from './paymentsheet';
5 |
6 | export * from './applepay/index';
7 | export * from './googlepay/index';
8 | export * from './paymentflow/index';
9 | export * from './paymentsheet/index';
10 | export * from './shared/index';
11 |
12 | type StripeDefinitions = PaymentSheetDefinitions & PaymentFlowDefinitions & ApplePayDefinitions & GooglePayDefinitions;
13 |
14 | export interface StripePlugin extends StripeDefinitions {
15 | initialize(opts: StripeInitializationOptions): Promise;
16 | /**
17 | * iOS Only
18 | * @url https://stripe.com/docs/payments/3d-secure#return-url
19 | */
20 | handleURLCallback?(opts: StripeURLHandlingOptions): Promise;
21 | }
22 |
23 | export interface StripeInitializationOptions {
24 | publishableKey: string;
25 |
26 | /**
27 | * Optional. Making API calls for connected accounts
28 | * @info https://stripe.com/docs/connect/authentication
29 | */
30 | stripeAccount?: string;
31 | }
32 |
33 | export interface StripeURLHandlingOptions {
34 | url: string;
35 | }
36 |
37 | export interface CapacitorStripeContext {
38 | stripe: StripePlugin;
39 | isApplePayAvailable: boolean;
40 | isGooglePayAvailable: boolean;
41 | }
42 |
--------------------------------------------------------------------------------
/packages/payment/src/googlepay/google-pay-difinitions.interface.ts:
--------------------------------------------------------------------------------
1 | import type { PluginListenerHandle } from '@capacitor/core';
2 |
3 | import type { CreateGooglePayOption } from '../shared';
4 |
5 | import type { GooglePayEventsEnum, GooglePayResultInterface } from './google-pay-events.enum';
6 |
7 | export interface GooglePayDefinitions {
8 | isGooglePayAvailable(): Promise;
9 |
10 | createGooglePay(options: CreateGooglePayOption): Promise;
11 |
12 | presentGooglePay(): Promise<{
13 | paymentResult: GooglePayResultInterface;
14 | }>;
15 |
16 | addListener(
17 | eventName: GooglePayEventsEnum.Loaded,
18 | listenerFunc: () => void,
19 | ): Promise;
20 |
21 | addListener(
22 | eventName: GooglePayEventsEnum.FailedToLoad,
23 | listenerFunc: (error: string) => void,
24 | ): Promise;
25 |
26 | addListener(
27 | eventName: GooglePayEventsEnum.Completed,
28 | listenerFunc: () => void,
29 | ): Promise;
30 |
31 | addListener(
32 | eventName: GooglePayEventsEnum.Canceled,
33 | listenerFunc: () => void,
34 | ): Promise;
35 |
36 | addListener(
37 | eventName: GooglePayEventsEnum.Failed,
38 | listenerFunc: () => void,
39 | ): Promise;
40 | }
41 |
--------------------------------------------------------------------------------
/packages/payment/src/googlepay/google-pay-events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum GooglePayEventsEnum {
2 | Loaded = "googlePayLoaded",
3 | FailedToLoad = "googlePayFailedToLoad",
4 | Completed = "googlePayCompleted",
5 | Canceled = "googlePayCanceled",
6 | Failed = "googlePayFailed"
7 | }
8 | export type GooglePayResultInterface =
9 | | GooglePayEventsEnum.Completed
10 | | GooglePayEventsEnum.Canceled
11 | | GooglePayEventsEnum.Failed
12 |
--------------------------------------------------------------------------------
/packages/payment/src/googlepay/index.ts:
--------------------------------------------------------------------------------
1 | export * from './google-pay-events.enum';
2 | export * from './google-pay-difinitions.interface';
3 |
--------------------------------------------------------------------------------
/packages/payment/src/index.ts:
--------------------------------------------------------------------------------
1 | import { registerPlugin } from '@capacitor/core';
2 |
3 | import type { StripePlugin } from './definitions';
4 |
5 | const Stripe = registerPlugin('Stripe', {
6 | web: () => import('./web').then((m) => new m.StripeWeb()),
7 | });
8 |
9 | export * from './definitions';
10 | export { Stripe };
11 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentflow/index.ts:
--------------------------------------------------------------------------------
1 | export * from './payment-flow-events.enum';
2 | export * from './payment-flow-definitions.interface';
3 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentflow/payment-flow-definitions.interface.ts:
--------------------------------------------------------------------------------
1 | import type { PluginListenerHandle } from '@capacitor/core';
2 |
3 | import type { CreatePaymentFlowOption } from '../shared';
4 |
5 | import type { PaymentFlowEventsEnum, PaymentFlowResultInterface } from './payment-flow-events.enum';
6 |
7 | export interface PaymentFlowDefinitions {
8 | createPaymentFlow(options: CreatePaymentFlowOption): Promise;
9 | presentPaymentFlow(): Promise<{
10 | cardNumber: string;
11 | }>;
12 | confirmPaymentFlow(): Promise<{
13 | paymentResult: PaymentFlowResultInterface
14 | }>;
15 |
16 | addListener(
17 | eventName: PaymentFlowEventsEnum.Loaded,
18 | listenerFunc: () => void,
19 | ): Promise;
20 |
21 | addListener(
22 | eventName: PaymentFlowEventsEnum.FailedToLoad,
23 | listenerFunc: (error: string) => void,
24 | ): Promise;
25 |
26 | addListener(
27 | eventName: PaymentFlowEventsEnum.Opened,
28 | listenerFunc: () => void,
29 | ): Promise;
30 |
31 | addListener(
32 | eventName: PaymentFlowEventsEnum.Completed,
33 | listenerFunc: () => void,
34 | ): Promise;
35 |
36 | addListener(
37 | eventName: PaymentFlowEventsEnum.Canceled,
38 | listenerFunc: () => void,
39 | ): Promise;
40 |
41 | addListener(
42 | eventName: PaymentFlowEventsEnum.Failed,
43 | listenerFunc: (error: string) => void,
44 | ): Promise;
45 |
46 | addListener(
47 | eventName: PaymentFlowEventsEnum.Created,
48 | listenerFunc: (info: {
49 | cardNumber: string;
50 | }) => void,
51 | ): Promise;
52 | }
53 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentflow/payment-flow-events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum PaymentFlowEventsEnum {
2 | Loaded = "paymentFlowLoaded",
3 | FailedToLoad = "paymentFlowFailedToLoad",
4 | Opened = "paymentFlowOpened",
5 | Created = "paymentFlowCreated",
6 | Completed = "paymentFlowCompleted",
7 | Canceled = "paymentFlowCanceled",
8 | Failed = "paymentFlowFailed",
9 | }
10 | export type PaymentFlowResultInterface =
11 | | PaymentFlowEventsEnum.Completed
12 | | PaymentFlowEventsEnum.Canceled
13 | | PaymentFlowEventsEnum.Failed;
14 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentsheet/index.ts:
--------------------------------------------------------------------------------
1 | export * from './payment-sheet-events.enum';
2 | export * from './payment-sheet-definitions.interface';
3 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentsheet/payment-sheet-definitions.interface.ts:
--------------------------------------------------------------------------------
1 | import type { PluginListenerHandle } from '@capacitor/core';
2 |
3 | import type { CreatePaymentSheetOption } from '../shared';
4 |
5 | import type { PaymentSheetEventsEnum, PaymentSheetResultInterface } from './payment-sheet-events.enum';
6 |
7 | export interface PaymentSheetDefinitions {
8 | createPaymentSheet(options: CreatePaymentSheetOption): Promise;
9 | presentPaymentSheet(): Promise<{
10 | paymentResult: PaymentSheetResultInterface;
11 | }>;
12 |
13 | addListener(
14 | eventName: PaymentSheetEventsEnum.Loaded,
15 | listenerFunc: () => void,
16 | ): Promise;
17 |
18 | addListener(
19 | eventName: PaymentSheetEventsEnum.FailedToLoad,
20 | listenerFunc: (error: string) => void,
21 | ): Promise;
22 |
23 | addListener(
24 | eventName: PaymentSheetEventsEnum.Completed,
25 | listenerFunc: () => void,
26 | ): Promise;
27 |
28 | addListener(
29 | eventName: PaymentSheetEventsEnum.Canceled,
30 | listenerFunc: () => void,
31 | ): Promise;
32 |
33 | addListener(
34 | eventName: PaymentSheetEventsEnum.Failed,
35 | listenerFunc: (error: string) => void,
36 | ): Promise;
37 | }
38 |
--------------------------------------------------------------------------------
/packages/payment/src/paymentsheet/payment-sheet-events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum PaymentSheetEventsEnum {
2 | Loaded = "paymentSheetLoaded",
3 | FailedToLoad = "paymentSheetFailedToLoad",
4 | Completed = "paymentSheetCompleted",
5 | Canceled = "paymentSheetCanceled",
6 | Failed = "paymentSheetFailed"
7 | }
8 |
9 | export type PaymentSheetResultInterface =
10 | PaymentSheetEventsEnum.Completed
11 | | PaymentSheetEventsEnum.Canceled
12 | | PaymentSheetEventsEnum.Failed
13 |
--------------------------------------------------------------------------------
/packages/payment/src/private/validate-all-events-implemented.type.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This is common rule. So `@typescript-eslint/no-explicit-any` is disabled here
3 | */
4 |
5 | /* eslint-disable @typescript-eslint/no-explicit-any */
6 |
7 | import type { PluginListenerHandle } from '@capacitor/core';
8 |
9 | type Contra = (x: T) => void
10 | type UnwrapContra = [T] extends [Contra] ? S : never
11 | type UnionToIntersection = UnwrapContra : never>
12 |
13 | type Overload =
14 | (eventName: T, listenerFunc: (...args: any[]) => any) => PluginListenerHandle
15 | type OverloadUnionForEnum = T extends any ? Overload : never
16 |
17 | type OverloadUnion = OverloadUnionForEnum
18 |
19 | type Overloads = UnionToIntersection>
20 |
21 | export type ValidateAllEventsEnumAreImplemented }> = TDefinitionInterface;
22 |
--------------------------------------------------------------------------------
/packages/payment/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowUnreachableCode": false,
4 | "declaration": true,
5 | "esModuleInterop": true,
6 | "lib": ["dom", "es2017"],
7 | "module": "esnext",
8 | "moduleResolution": "node",
9 | "noFallthroughCasesInSwitch": true,
10 | "noUnusedLocals": true,
11 | "noUnusedParameters": true,
12 | "outDir": "dist/esm",
13 | "pretty": true,
14 | "sourceMap": true,
15 | "strict": true,
16 | "target": "es2017",
17 | "jsx": "react"
18 | },
19 | "files": ["src/index.ts", "src/react/provider.tsx"]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/terminal/.eslintignore:
--------------------------------------------------------------------------------
1 | build
2 | dist
3 |
--------------------------------------------------------------------------------
/packages/terminal/.gitignore:
--------------------------------------------------------------------------------
1 | # node files
2 | dist
3 | node_modules
4 |
5 | # iOS files
6 | Pods
7 | Podfile.lock
8 | Package.resolved
9 | Build
10 | xcuserdata
11 | /.build
12 | /Packages
13 | xcuserdata/
14 | DerivedData/
15 | .swiftpm/configuration/registries.json
16 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
17 | .netrc
18 |
19 |
20 | # macOS files
21 | .DS_Store
22 |
23 |
24 |
25 | # Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
26 |
27 | # Built application files
28 | *.apk
29 | *.ap_
30 |
31 | # Files for the ART/Dalvik VM
32 | *.dex
33 |
34 | # Java class files
35 | *.class
36 |
37 | # Generated files
38 | bin
39 | gen
40 | out
41 |
42 | # Gradle files
43 | .gradle
44 | build
45 |
46 | # Local configuration file (sdk path, etc)
47 | local.properties
48 |
49 | # Proguard folder generated by Eclipse
50 | proguard
51 |
52 | # Log Files
53 | *.log
54 |
55 | # Android Studio Navigation editor temp files
56 | .navigation
57 |
58 | # Android Studio captures folder
59 | captures
60 |
61 | # IntelliJ
62 | *.iml
63 | .idea
64 |
65 | # Keystore files
66 | # Uncomment the following line if you do not want to check your keystore files in.
67 | #*.jks
68 |
69 | # External native build folder generated in Android Studio 2.2 and later
70 | .externalNativeBuild
71 |
--------------------------------------------------------------------------------
/packages/terminal/CapacitorCommunityStripeTerminal.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'CapacitorCommunityStripeTerminal'
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.license = package['license']
10 | s.homepage = package['repository']['url']
11 | s.author = package['author']
12 | s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13 | s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14 | s.ios.deployment_target = '14.0'
15 | s.dependency 'Capacitor'
16 | s.dependency 'StripeTerminal', '~> 4.5.0'
17 | s.swift_version = '5.1'
18 | end
19 |
--------------------------------------------------------------------------------
/packages/terminal/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.9
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "CapacitorCommunityStripeTerminal",
6 | platforms: [.iOS(.v14)],
7 | products: [
8 | .library(
9 | name: "CapacitorCommunityStripeTerminal",
10 | targets: ["StripeTerminalPlugin"])
11 | ],
12 | dependencies: [
13 | .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14 | .package(url: "https://github.com/stripe/stripe-terminal-ios.git", exact: "4.5.0")
15 | ],
16 | targets: [
17 | .target(
18 | name: "StripeTerminalPlugin",
19 | dependencies: [
20 | .product(name: "Capacitor", package: "capacitor-swift-pm"),
21 | .product(name: "Cordova", package: "capacitor-swift-pm"),
22 | .product(name: "StripeTerminal", package: "stripe-terminal-ios")
23 | ],
24 | path: "ios/Sources/StripeTerminalPlugin"),
25 | .testTarget(
26 | name: "StripeTerminalPluginTests",
27 | dependencies: ["StripeTerminalPlugin"],
28 | path: "ios/Tests/StripeTerminalPluginTests")
29 | ]
30 | )
31 |
--------------------------------------------------------------------------------
/packages/terminal/android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/packages/terminal/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
--------------------------------------------------------------------------------
/packages/terminal/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/terminal/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/packages/terminal/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/packages/terminal/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/packages/terminal/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':capacitor-android'
2 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
--------------------------------------------------------------------------------
/packages/terminal/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.android
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import org.junit.Assert
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumented test, which will execute on an Android device.
11 | *
12 | * @see [Testing documentation](http://d.android.com/tools/testing)
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | @Throws(Exception::class)
18 | fun useAppContext() {
19 | // Context of the app under test.
20 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
21 |
22 | Assert.assertEquals("com.getcapacitor.android", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/java/com/getcapacitor/community/stripe/terminal/TerminalConnectTypes.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.terminal;
2 |
3 | enum class TerminalConnectTypes(val webEventName: String) {
4 | Simulated("simulated"),
5 | Internet("internet"),
6 | Bluetooth("bluetooth"),
7 | Usb("usb"),
8 | TapToPay("tap-to-pay"),
9 | HandOff("hand-off"),
10 | }
11 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/java/com/getcapacitor/community/stripe/terminal/TerminalEvent.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.terminal;
2 |
3 | enum class TerminalEnumEvent(val webEventName: String) {
4 | Loaded("terminalLoaded"),
5 | DiscoveringReaders("terminalDiscoveringReaders"),
6 | DiscoveredReaders("terminalDiscoveredReaders"),
7 | CancelDiscoveredReaders("terminalCancelDiscoveredReaders"),
8 | ConnectedReader("terminalConnectedReader"),
9 | DisconnectedReader("terminalDisconnectedReader"),
10 | ConnectionStatusChange("terminalConnectionStatusChange"),
11 | UnexpectedReaderDisconnect("terminalUnexpectedReaderDisconnect"),
12 | ConfirmedPaymentIntent("terminalConfirmedPaymentIntent"),
13 | CollectedPaymentIntent("terminalCollectedPaymentIntent"),
14 | Canceled("terminalCanceled"),
15 | Failed("terminalFailed"),
16 | RequestedConnectionToken("terminalRequestedConnectionToken"),
17 | ReportAvailableUpdate("terminalReportAvailableUpdate"),
18 | StartInstallingUpdate("terminalStartInstallingUpdate"),
19 | ReaderSoftwareUpdateProgress("terminalReaderSoftwareUpdateProgress"),
20 | FinishInstallingUpdate("terminalFinishInstallingUpdate"),
21 | BatteryLevel("terminalBatteryLevel"),
22 | ReaderEvent("terminalReaderEvent"),
23 | RequestDisplayMessage("terminalRequestDisplayMessage"),
24 | RequestReaderInput("terminalRequestReaderInput"),
25 | PaymentStatusChange("terminalPaymentStatusChange"),
26 | ReaderReconnectStarted("terminalReaderReconnectStarted"),
27 | ReaderReconnectSucceeded("terminalReaderReconnectSucceeded"),
28 | ReaderReconnectFailed("terminalReaderReconnectFailed"),
29 | }
30 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/java/com/getcapacitor/community/stripe/terminal/helper/MetaData.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.terminal.helper
2 |
3 | import android.content.Context
4 | import android.content.pm.PackageManager
5 | import androidx.core.util.Supplier
6 | import com.getcapacitor.Logger
7 |
8 | class MetaData(protected var contextSupplier: Supplier) {
9 | var enableIdentifier: Boolean = false
10 |
11 | init {
12 | try {
13 | val appInfo = contextSupplier
14 | .get()
15 | .packageManager
16 | .getApplicationInfo(contextSupplier.get().packageName, PackageManager.GET_META_DATA)
17 |
18 | enableIdentifier =
19 | appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.enableIdentifier")
20 | } catch (ignored: Exception) {
21 | Logger.info("MetaData didn't be prepare fore Google Pay.")
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/java/com/getcapacitor/community/stripe/terminal/models/Executor.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor.community.stripe.terminal.models
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import androidx.core.util.Supplier
6 | import com.getcapacitor.JSObject
7 | import com.google.android.gms.common.util.BiConsumer
8 |
9 | abstract class Executor(
10 | protected var contextSupplier: Supplier,
11 | protected val activitySupplier: Supplier,
12 | protected var notifyListenersFunction: BiConsumer,
13 | pluginLogTag: String,
14 | executorTag: String
15 | ) {
16 | protected val logTag: String = "$pluginLogTag|$executorTag"
17 |
18 | // Eventually we can change the notification directly here!
19 | protected fun notifyListeners(eventName: String, data: JSObject) {
20 | notifyListenersFunction.accept(eventName, data)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/terminal/android/src/main/res/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/capacitor-community/stripe/c95e30401541974d33d023220696c14eb6a61fca/packages/terminal/android/src/main/res/.gitkeep
--------------------------------------------------------------------------------
/packages/terminal/android/src/test/java/com/getcapacitor/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.getcapacitor
2 |
3 | import org.junit.Assert
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 | *
9 | * @see [Testing documentation](http://d.android.com/tools/testing)
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | @Throws(Exception::class)
14 | fun addition_isCorrect() {
15 | Assert.assertEquals(4, (2 + 2).toLong())
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/terminal/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .build
3 | /Packages
4 | xcuserdata/
5 | DerivedData/
6 | .swiftpm/configuration/registries.json
7 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8 | .netrc
--------------------------------------------------------------------------------
/packages/terminal/ios/Sources/StripeTerminalPlugin/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/terminal/ios/Sources/StripeTerminalPlugin/TerminalConnectTypes.swift:
--------------------------------------------------------------------------------
1 | public enum TerminalConnectTypes: String {
2 | case Simulated = "simulated"
3 | case Internet = "internet"
4 | case Bluetooth = "bluetooth"
5 | case Usb = "usb"
6 | case TapToPay = "tap-to-pay"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/terminal/ios/Sources/StripeTerminalPlugin/TerminalEvents.swift:
--------------------------------------------------------------------------------
1 | public enum TerminalEvents: String {
2 | case Loaded = "terminalLoaded"
3 | case DiscoveringReaders = "terminalDiscoveringReaders"
4 | case DiscoveredReaders = "terminalDiscoveredReaders"
5 | case ConnectedReader = "terminalConnectedReader"
6 | case CancelDiscoveredReaders = "terminalCancelDiscoveredReaders"
7 | case DisconnectedReader = "terminalDisconnectedReader"
8 | case ConnectionStatusChange = "terminalConnectionStatusChange"
9 | case UnexpectedReaderDisconnect = "terminalUnexpectedReaderDisconnect"
10 | case ConfirmedPaymentIntent = "terminalConfirmedPaymentIntent"
11 | case CollectedPaymentIntent = "terminalCollectedPaymentIntent"
12 | case Canceled = "terminalCanceled"
13 | case Failed = "terminalFailed"
14 | case RequestedConnectionToken = "terminalRequestedConnectionToken"
15 | case ReportAvailableUpdate = "terminalReportAvailableUpdate"
16 | case StartInstallingUpdate = "terminalStartInstallingUpdate"
17 | case ReaderSoftwareUpdateProgress = "terminalReaderSoftwareUpdateProgress"
18 | case FinishInstallingUpdate = "terminalFinishInstallingUpdate"
19 | case BatteryLevel = "terminalBatteryLevel"
20 | case ReaderEvent = "terminalReaderEvent"
21 | case RequestDisplayMessage = "terminalRequestDisplayMessage"
22 | case RequestReaderInput = "terminalRequestReaderInput"
23 | case PaymentStatusChange = "terminalPaymentStatusChange"
24 | case ReaderReconnectStarted = "terminalReaderReconnectStarted"
25 | case ReaderReconnectSucceeded = "terminalReaderReconnectSucceeded"
26 | case ReaderReconnectFailed = "terminalReaderReconnectFailed"
27 | }
28 |
--------------------------------------------------------------------------------
/packages/terminal/ios/Tests/StripeTerminalPluginTests/StripeTerminalPluginTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import StripeTerminalPlugin
3 |
4 | class StripeTerminalTests: XCTestCase {
5 | func testEcho() {
6 | // This is an example of a functional test case for a plugin.
7 | // Use XCTAssert and related functions to verify your tests produce the correct results.
8 |
9 | let implementation = StripeTerminal()
10 | // let value = "Hello, World!"
11 | // let result = implementation.echo(value)
12 | //
13 | // XCTAssertEqual(value, result)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/terminal/rollup.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | input: 'dist/esm/index.js',
3 | output: [
4 | {
5 | file: 'dist/plugin.js',
6 | format: 'iife',
7 | name: 'capacitorStripe',
8 | globals: {
9 | '@capacitor/core': 'capacitorExports',
10 | },
11 | sourcemap: true,
12 | inlineDynamicImports: true,
13 | },
14 | {
15 | file: 'dist/plugin.cjs.js',
16 | format: 'cjs',
17 | sourcemap: true,
18 | inlineDynamicImports: true,
19 | },
20 | ],
21 | external: ['@capacitor/core'],
22 | };
23 |
--------------------------------------------------------------------------------
/packages/terminal/src/events.enum.ts:
--------------------------------------------------------------------------------
1 | export enum TerminalEventsEnum {
2 | Loaded = 'terminalLoaded',
3 | DiscoveredReaders = 'terminalDiscoveredReaders',
4 | DiscoveringReaders = 'terminalDiscoveringReaders',
5 | CancelDiscoveredReaders = 'terminalCancelDiscoveredReaders',
6 | ConnectedReader = 'terminalConnectedReader',
7 | DisconnectedReader = 'terminalDisconnectedReader',
8 | ConnectionStatusChange = 'terminalConnectionStatusChange',
9 | UnexpectedReaderDisconnect = 'terminalUnexpectedReaderDisconnect',
10 | ConfirmedPaymentIntent = 'terminalConfirmedPaymentIntent',
11 | CollectedPaymentIntent = 'terminalCollectedPaymentIntent',
12 | Canceled = 'terminalCanceled',
13 | Failed = 'terminalFailed',
14 | RequestedConnectionToken = 'terminalRequestedConnectionToken',
15 | ReportAvailableUpdate = 'terminalReportAvailableUpdate',
16 | StartInstallingUpdate = 'terminalStartInstallingUpdate',
17 | ReaderSoftwareUpdateProgress = 'terminalReaderSoftwareUpdateProgress',
18 | FinishInstallingUpdate = 'terminalFinishInstallingUpdate',
19 | BatteryLevel = 'terminalBatteryLevel',
20 | ReaderEvent = 'terminalReaderEvent',
21 | RequestDisplayMessage = 'terminalRequestDisplayMessage',
22 | RequestReaderInput = 'terminalRequestReaderInput',
23 | PaymentStatusChange = 'terminalPaymentStatusChange',
24 | ReaderReconnectStarted = 'terminalReaderReconnectStarted',
25 | ReaderReconnectSucceeded = 'terminalReaderReconnectSucceeded',
26 | ReaderReconnectFailed = 'terminalReaderReconnectFailed',
27 | }
28 |
29 | export type TerminalResultInterface =
30 | | TerminalEventsEnum.ConfirmedPaymentIntent
31 | | TerminalEventsEnum.CollectedPaymentIntent
32 | | TerminalEventsEnum.Canceled
33 | | TerminalEventsEnum.Failed;
34 |
--------------------------------------------------------------------------------
/packages/terminal/src/index.ts:
--------------------------------------------------------------------------------
1 | import { registerPlugin } from '@capacitor/core';
2 |
3 | import type { StripeTerminalPlugin } from './definitions';
4 |
5 | const StripeTerminal = registerPlugin('StripeTerminal', {
6 | web: () => import('./web').then((m) => new m.StripeTerminalWeb()),
7 | });
8 |
9 | export * from './definitions';
10 | export { StripeTerminal };
11 |
--------------------------------------------------------------------------------
/packages/terminal/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowUnreachableCode": false,
4 | "declaration": true,
5 | "esModuleInterop": true,
6 | "inlineSources": true,
7 | "lib": ["dom", "es2017"],
8 | "module": "esnext",
9 | "moduleResolution": "node",
10 | "noFallthroughCasesInSwitch": true,
11 | "noUnusedLocals": true,
12 | "noUnusedParameters": true,
13 | "outDir": "dist/esm",
14 | "pretty": true,
15 | "sourceMap": true,
16 | "strict": true,
17 | "target": "es2017"
18 | },
19 | "files": ["src/index.ts"]
20 | }
21 |
--------------------------------------------------------------------------------
/release.js:
--------------------------------------------------------------------------------
1 | import { updatePackage } from 'write-pkg';
2 | import path from 'path';
3 | import pkg from './package.json' with { type: 'json' };
4 | import { exec } from 'child_process';
5 |
6 | const workspaces = ['packages/payment', 'packages/identity', 'packages/terminal'];
7 |
8 | workspaces.forEach(async (workspace) => {
9 | const releasePackagePath = path.resolve('./' + workspace);
10 | await updatePackage(releasePackagePath + '/package.json', { version: pkg.version });
11 |
12 | const isStable = (version) => {
13 | const stableRegex = /^[0-9]+\.[0-9]+\.[0-9]+$/;
14 | return stableRegex.test(version);
15 | }
16 |
17 | exec(`cd ${releasePackagePath} && npm install && npm run build && npm publish` + (isStable(pkg.version) ? '' : ' --tag next'), (err, stdout, stderr) => {
18 | if (err) {
19 | console.error(err);
20 | return;
21 | }
22 | console.log(stdout);
23 | });
24 | });
25 |
--------------------------------------------------------------------------------