#Cle-iOS
1 messages ยท Page 1 of 1 (latest)
It's hard to say in certain that it is related to the migration
Are you sure it happens after you moved the account?
Sounds like you are already done these steps, but just in case:
- In new Apple Id account, create new Merchant Id
- From the merchant ID created new ApplePay certificate
- Place the new certificate into Stripe Dashboard, remove the old certificate (optionally but let' do it for sure)
- In your Xcode setup new Apple Id and new merchant Id
- Clean up/Delete Derived Data/Restart Xcode to make sure it takes effect
yes, we're still receiving payments thru Apple Pay on our live. The failed payments happens on our build on Test Flight
I'll verify number 3 and get back to you
the rest of the steps, I can verify we've done it
remove the old certificate (optionally but let' do it for sure)
this part, I need to verify
We haven't removed the old one and I'm afraid to do that. What will the repercussions be on the live apps if we remove the old one?
So right now, both certificates are in the Stripe portal
1 min
If you still have Live payment using the previous certificate, don't remove it
I was assuming we are talking about test mode
cc @fallen crystal for not breaking your integration
In that case, let's keep both certificate, each link to another Stripe Account, and just make the switch in Xcode
In that case, let's keep both certificate, each link to another Stripe Account, and just make the switch in Xcode
we need to setup a new Stripe account for the new merchant ids?
No I believe one Stripe account is okay
Sorry, mean each link to another Apple account
each link to another Stripe Apple Account
yup, that's what we have right now
we should be able to test payments on apps on TestFlight, right?
I think so. That TestFlight build is using Live mode key?
Yeah
Um but did you test TestFlight build before?
Like, before migrating Apple account
yes we've tested months ago, the first time we implemented Apple Pay via Stripe
btw we're using iOS Stripe SDK v19.3.0
Hi, really sorry but I am signing off for the day. Unfortunately our team at current time doesn't have anyone else familiar with iOS. Could you write into Support to make this a conversation (we can support your async) or wait until Europe/American time, or simply comes back tmr?
From my experience it should work, maybe just some cache issue with Apple
๐
If you use a Test mode publishable key for the new account, would it work?
I'd like to narrow down the issue
haven't tried that yet
Okie, please test this when you have time. For now can I have your Stripe account id?
acc_xxx
@fallen crystal please send our Stripe account id
Hi @storm finch can you add me as friend? So I can send you the acct id directly
is it safe to send it publicly?
It's safe to send here
acct_1Fc7pSFoq4GFBk3P
We have a number of accounts (different regions) here is one
FYI Ids is safe to send, Keys are not (secret/publish)
Is this the one with 2 Apple Pay certificate registered?
Yes, all have, but this one is easiest to test for us
my-my is the new one, mysale-my is the old one
acked
fmm looks normal to me
And in Xcode ยฅou have set Apple Id and merchant Id for my-my ?
what do you mean Apple Id? we did change the merchant id for my-my on the app
I meant the Apple Id signed in in Xcode, to set its signing certificate and Apple Pay merchant Id
ah yes
Hmm okie...
What exactly do you see the error? What value is null?
No error output in Xcode console?
let me try again
If you can try now, let's try a test Publishable key
sure
Hi @storm finch , still same result using test publishable key
btw I'm also getting false from Stripe.deviceSupportsApplePay()
And it surely has Wallet app with registered card?
i don't have wallet with registered card though
though the build from Test Flight was tested by one of our staff with wallet w/ registered card, same result
I see
Can you add a real credit card to your current device? It won't be charged as long as it is using test publishable key
okay
- Returns: YES if the device is currently able to make Apple Pay payments via one
/// of the supported networks. NO if the user does not have a saved card of a
/// supported type, or other restrictions prevent payment (such as parental controls).
Here is how the Stripe.deviceSupportsApplePay()method documented
Notice the "does not have a saved card"
yep, though I believe this flag returns yes with our staff that tested the build on Test Flight because he's able to see the Apple Pay button. We use this flag btw, to determine if we should display Apple Pay button or not.
๐ for checking the flag, it's the recommended way from our Doc
so the tester saw the button but nothing happen after click on it?
I would like to see you can reproduce with your test key
forgot, we don't have any credit card supported with Apple Pay due to country; though I tried to run the app on Simulator; now getting true from Stripe.deviceSupportsApplePay()
though still getting null from
STPApplePayContext(paymentRequest: paymentRequest, delegate: self)
I'm using the test key
Okie, which value returning null?
STPApplePayContext(paymentRequest: paymentRequest, delegate: self) is an initialization
StripeAPI.canSubmitPaymentRequest(paymentRequest)
If you log this line, is it true or false?
STPApplePayContext(paymentRequest: paymentRequest, delegate: self)
this returns null
this returns true
now I'm seeing this error
Payment request is invalid: Error Domain=PKPassKitErrorDomain Code=1 "Invalid in-app payment request" UserInfo={NSLocalizedDescription=Invalid in-app payment request, NSUnderlyingError=0x600001e302a0 {Error Domain=PKPassKitErrorDomain Code=1 "PKPaymentRequest must contain an NSArray property 'paymentSummaryItems' of valid objects of class PKPaymentSummaryItem" UserInfo={NSLocalizedDescription=PKPaymentRequest must contain an NSArray property 'paymentSummaryItems' of valid objects of class PKPaymentSummaryItem, NSUnderlyingError=0x600001e32520 {Error Domain=PKPassKitErrorDomain Code=1 "PKPaymentSummaryItem has an invalid label or amount property" UserInfo={NSLocalizedDescription=PKPaymentSummaryItem has an invalid label or amount property, NSUnderlyingError=0x600001e313b0 {Error Domain=PKPassKitErrorDomain Code=1 "Amount is not valid for specified currency. Amount: 3858.3501, Currency: MYR" UserInfo=0x6000010d7a40 (not displayed)}}}}}}
yes
Let's add this
paymentRequest.paymentSummaryItems = [
PKPaymentSummaryItem(label: "iHats, Inc", amount: 5000),
]
It's a random info just for displaying the ApplePay Sheet
generally you would want a label and amount aligns with PaymentIntent from your backend
we do have payment summary items in the paymentrequest
hmm that's weird
Okie let's log out this value also
let authorizationController = PKPaymentAuthorizationController(paymentRequest: paymentRequest)
See if this authorizationController would return nil
yes, isolating what's causing the invalid summary item
Glad to see it is finally working!
different Apple Accounts compatibility with currencies? ๐ค Just guessing
not sure yet, will update here once we find out the cause
Btw here is the content of the function returned null for you
public required init?(paymentRequest: PKPaymentRequest, delegate: _stpinternal_STPApplePayContextDelegateBase?) {
STPAnalyticsClient.sharedClient.addClass(toProductUsageIfNecessary: STPApplePayContext.self)
if !StripeAPI.canSubmitPaymentRequest(paymentRequest) {
return nil
}
authorizationController = PKPaymentAuthorizationController(paymentRequest: paymentRequest)
if authorizationController == nil {
return nil
}
self.delegate = delegate
super.init()
authorizationController?.delegate = self
}
The culprit should be something inside here
@autumn mica ๐
Hi
we're able to make the Apple Pay actionsheet appear on Simulator
but still not working on app uploaded on TestFlight with live pub key
though the live and test pub key is working on the Simulator
can you confirm, @storm finch , if it's possible to test Apple Pay on Test Flight?
Let me find around
I thought it shouldn't be a prob with TestFlight
Have your tried Release Build locally?
The main different between TestFlight and simulator is TestFlight using Release Build, while simulator you often use Debug build
though the live and test pub key is working on the Simulator
From here I am pretty confident your ApplePay certificate are set correctly on Stripe Account
It looks like an iOS development issue
i don't get how it's an iOS development issue
I meant if the certificate is not set correctly in Stripe Dashboard, you would never be able to make it working on Simulator
So we can isolate the issue is not the registration of the certificate on Stripe Dashboard
do you have at least info to confirm Apple Pay should work on Test Flight
I am checking this for you
Looks like not, since TestFlight seems to use ApplePay sandbox environment
Could you ask Apple for clarification?
I see, we'll discuss about it, thanks
Hi @storm finch
I think I was able to reproduce the problem on my side
I'm getting this error on Xcode console
it's looking for the old merchant id
what do you think is the problem here?
ahh wait
Some setting? Or cached setting?
yes, thanks
Did you resolve it?