flutter_stripe_payment icon indicating copy to clipboard operation
flutter_stripe_payment copied to clipboard

canMakeNativePayPayments return false in production

Open JTorrus opened this issue 4 years ago • 5 comments

I've got this piece of code in my app

final deviceSupportsNativePay = (await StripePayment.deviceSupportsNativePay()) 
&& 
(await StripePayment.canMakeNativePayPayments(<String>["american_express", "discover", "master_card", "visa"]));

It works in Sandbox mode but returns false in production despite having supported cards in my Apple Wallet.

I'm currently using version 1.0.7 of this package.

Output of flutter doctor -v

[√] Flutter (Channel stable, v1.17.1, on Microsoft Windows [Version 10.0.18363.836], locale en-US)
    • Flutter version 1.17.1 at D:\workspace\devkits\flutter
    • Framework revision f7a6a7906b (7 days ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

JTorrus avatar May 19 '20 19:05 JTorrus

Feel free to open the project in Xcode and debug this line: https://github.com/jonasbark/flutter_stripe_payment/blob/master/ios/Classes/TPSStripeManager.m#L327

jonasbark avatar May 20 '20 12:05 jonasbark

I test print(await StripePayment.canMakeNativePayPayments([]));

Display always false, despite of the fact that I can pay with google pay with this device with my app :). In which valid use case device could return "deviceSupportsNativePay: true" and "canMakeNativePayPayments: false" ?

I didn't known how debug it with android studio...

@jonasbark

EArminjon avatar May 29 '20 15:05 EArminjon

For others out there: I added "mastercard" to the list of networks in addition to "master_card" and it works fine now. Not sure whether master_card is worth keeping.

Noticed it in this issue: https://github.com/jonasbark/flutter_stripe_payment/issues/179.

I assume canMakeNativePayPayments was returning false because I only had mastercard cards in my Apple Wallet. Hope it helps :)

vahurh avatar Nov 29 '20 20:11 vahurh

I'm having this issue as well, but not really sure why it's happening. Here is the "networks" I'm using: const kPaymentNetworks = ["american_express", "visa","discover", "mastercard"]; I loaded it into xcode and basically everything looked good until it went into the resolve(@([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:networks])); but get a false out the other side... not really sure where to go from there... Would love any feedback.

It was working fine before, but we needed to upgrade from ^1.0.8 to ^1.1.0 to get it working in modern flutter (with a bit of help from over in #284 ).

mclark4386 avatar May 06 '21 02:05 mclark4386

Ooook, so follow up in case it helps anyone else. The issue for us was the "Apple Pay Entitlement". We had set it up before but had to re-create the iOS project in the aforementioned updates and in so doing that entitlement did NOT get re-set... added it and the merchant id and BOOM works again!

mclark4386 avatar May 06 '21 22:05 mclark4386