Hy, I try to publish 2 app with Apple Pay system in. But i have a problem, all work with my simulator, but when im in test flight with Apple, Apple Pay dont work/ nothing is show when i call function. I cant do payment. I have already try with Stripe but same Issue I already add ApplePay certificat in X-Code. Thanks for help and have a good day
flutter doctor - v :
fr-FR)
• Flutter version 2.8.1 at /flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/Library/Android/
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] VS Code (version 1.63.2)
• VS Code at /Users/Desktop/Visual Studio Code.app/Contents
• Flutter extension version 3.32.0
[✓] Connected device (2 available)
•
iOS 15.3 19D5026g
• Chrome (web) • chrome • web-javascript •
Google Chrome 97.0.4692.71
! Error: iPhone de Kévin is busy: Preparing the watch for development via
iPhone de Kévin. Xcode will continue when iPhone de Kévin is finished.
(code -10)
• No issues found!
My Code
void _onStartApplePay() async {
print('Start');
try {
await InAppPayments.requestApplePayNonce(
price: '$totalEnd',
summaryLabel: 'Name',
countryCode: 'FR',
currencyCode: 'EUR',
paymentType: ApplePayPaymentType.finalPayment,
onApplePayNonceRequestSuccess: _onApplePayNonceRequestSuccess,
onApplePayNonceRequestFailure: _onApplePayNonceRequestFailure,
onApplePayComplete: _onApplePayEntryComplete);
} on PlatformException catch (ex) {}
}
void _onApplePayNonceRequestSuccess(context) async {
try {
// take payment with the card nonce details
// you can take a charge
// await chargeCard(result);
// you must call completeApplePayAuthorization to close apple pay sheet
await InAppPayments.completeApplePayAuthorization(isSuccess: true);
} on Exception catch (ex) {
// handle card nonce processing failure
// you must call completeApplePayAuthorization to close apple pay sheet
await InAppPayments.completeApplePayAuthorization(
isSuccess: false, errorMessage: 'error');
}
paiement = true;
Navigator.of(context).pushReplacementNamed('/paiementTrue');
}
void _onApplePayNonceRequestFailure(ErrorInfo errorInfo) async {
await InAppPayments.completeApplePayAuthorization(
isSuccess: false, errorMessage: errorInfo.message);
print('Request fail');
Navigator.of(context).pushReplacementNamed('/paiementFalse');
print(errorInfo.message);
}
void _onApplePayEntryComplete() {
Navigator.of(context).pushReplacementNamed('/paiementFalse');
}
