capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 75 forks source link

Google Pay doesn't work when dynamically changing the Stripe account and Stripe public key. #299

Closed xDmv closed 8 months ago

xDmv commented 10 months ago

Platform

In our project, we need to change the values of 'stripeAccount' and the Stripe public key. Everything is working correctly for Apple Pay. For Google Pay, the data is taken only that is set in the 'strings.xml' file and does not change if it is modified in the Ionic code.

In our project, we are using version 3.9.1 of the plugin. We have the following dependencies in the project: "dependencies": { "@angular/animations": "^12.2.1", "@angular/cdk": "^12.2.1", "@angular/common": "~12.1.1", "@angular/compiler": "~12.1.1", "@angular/core": "~12.1.1", "@angular/forms": "~12.1.1", "@angular/material": "^12.2.1", "@angular/platform-browser": "~12.1.1", "@angular/platform-browser-dynamic": "~12.1.1", "@angular/router": "~12.1.1", "@capacitor-community/stripe": "^3.9.1", "@capacitor/android": "3.1.2", "@capacitor/app": "1.0.2", "@capacitor/camera": "^1.3.1", "@capacitor/clipboard": "^1.0.8", "@capacitor/core": "3.1.2", "@capacitor/haptics": "1.0.2", "@capacitor/ios": "3.1.2", "@capacitor/keyboard": "1.0.2", "@capacitor/push-notifications": "^1.0.4", "@capacitor/splash-screen": "^1.1.6", "@capacitor/status-bar": "1.0.2", "@capacitor/storage": "^1.2.0", "@googlemaps/js-api-loader": "^1.13.5", "@ionic-native/core": "^5.35.0", "@ionic-native/splash-screen": "^5.35.0", "@ionic-native/status-bar": "^5.35.0", "@ionic/angular": "^6.2.6", "@ngrx/store": "^12.4.0", "@ngxs/store": "^3.7.2", "@stripe/stripe-js": "^1.35.0", "@types/google.maps": "^3.53.2", "cropperjs": "^1.5.12", "install": "^0.13.0", "jwt-decode": "^3.1.2", "moment": "^2.29.1", "ngx-material-timepicker": "^5.5.3", "ngx-stripe": "^12.8.2", "rxjs": "~6.6.0", "tslib": "^2.2.0", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "^12.1.1", "@angular-eslint/builder": "^12.7.0", "@angular-eslint/eslint-plugin": "~12.0.0", "@angular-eslint/eslint-plugin-template": "~12.0.0", "@angular-eslint/template-parser": "~12.0.0", "@angular/cli": "~12.1.1", "@angular/compiler": "~12.1.1", "@angular/compiler-cli": "~12.1.1", "@angular/language-service": "~12.0.1", "@capacitor/cli": "3.1.2", "@ionic/angular-toolkit": "^2.1.2", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "4.16.1", "@typescript-eslint/parser": "4.16.1", "eslint": "^7.6.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.6", "eslint-plugin-prefer-arrow": "1.2.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.2", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "^7.0.0", "ts-node": "~8.3.0", "typescript": "~4.2.4" },

Here are our settings in the 'AndroidManifest.xml' file: screen And here are the settings in 'strings.xml': screen

Please advise on how to configure the plugin for Google Pay so that we can use different data.

rdlabo commented 10 months ago

This implementation seems impossible because GooglePayLauncher must be executed onCreate .

https://stripe.com/docs/google-pay?platform=android&locale=en-US#instantiate

Maybe,

https://github.com/stripe/stripe-android

You may be able to get some tips at

rdlabo commented 8 months ago

This Issue is closed because there is no activity. If you still have problems, please create a new Issue.