#Cle-iOS

1 messages ยท Page 1 of 1 (latest)

storm finch
#

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:

  1. In new Apple Id account, create new Merchant Id
  2. From the merchant ID created new ApplePay certificate
  3. Place the new certificate into Stripe Dashboard, remove the old certificate (optionally but let' do it for sure)
  4. In your Xcode setup new Apple Id and new merchant Id
  5. Clean up/Delete Derived Data/Restart Xcode to make sure it takes effect
autumn mica
autumn mica
#

the rest of the steps, I can verify we've done it

autumn mica
fallen crystal
#

So right now, both certificates are in the Stripe portal

storm finch
#

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

autumn mica
#

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?

storm finch
#

No I believe one Stripe account is okay

#

Sorry, mean each link to another Apple account

#

each link to another Stripe Apple Account

autumn mica
#

yup, that's what we have right now

autumn mica
storm finch
#

I think so. That TestFlight build is using Live mode key?

autumn mica
#

you mean the publishable key, yes

#

Stripe.setDefaultPublishableKey(key)

storm finch
#

Yeah

#

Um but did you test TestFlight build before?

#

Like, before migrating Apple account

autumn mica
#

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

storm finch
#

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

autumn mica
#

okay

#

thanks

storm finch
#

๐Ÿ‘‹

#

If you use a Test mode publishable key for the new account, would it work?

#

I'd like to narrow down the issue

autumn mica
#

haven't tried that yet

storm finch
#

Okie, please test this when you have time. For now can I have your Stripe account id?

#

acc_xxx

autumn mica
#

@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

fallen crystal
#

is it safe to send it publicly?

storm finch
#

It's safe to send here

fallen crystal
#

acct_1Fc7pSFoq4GFBk3P

#

We have a number of accounts (different regions) here is one

storm finch
#

FYI Ids is safe to send, Keys are not (secret/publish)

#

Is this the one with 2 Apple Pay certificate registered?

fallen crystal
#

Yes, all have, but this one is easiest to test for us

storm finch
#

Okie let me TAL

#

my-my is old one and mysale-my is new one?

fallen crystal
#

my-my is the new one, mysale-my is the old one

storm finch
#

acked

#

fmm looks normal to me

#

And in Xcode ยฅou have set Apple Id and merchant Id for my-my ?

autumn mica
#

what do you mean Apple Id? we did change the merchant id for my-my on the app

storm finch
#

I meant the Apple Id signed in in Xcode, to set its signing certificate and Apple Pay merchant Id

autumn mica
#

ah yes

storm finch
#

Hmm okie...

#

What exactly do you see the error? What value is null?

#

No error output in Xcode console?

autumn mica
#

let me try again

storm finch
#

If you can try now, let's try a test Publishable key

autumn mica
#

sure

autumn mica
#

Hi @storm finch , still same result using test publishable key

#

btw I'm also getting false from Stripe.deviceSupportsApplePay()

storm finch
#

fmfm

#

simulator or real device?

autumn mica
#

on real device

#

installed from Xcode

storm finch
#

And it surely has Wallet app with registered card?

autumn mica
#

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

storm finch
#

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

autumn mica
#

okay

storm finch
#
 - 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"

autumn mica
#

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.

storm finch
#

๐Ÿ‘ 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

autumn mica
#

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

storm finch
#

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?

autumn mica
#

STPApplePayContext(paymentRequest: paymentRequest, delegate: self)
this returns null

autumn mica
#

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)}}}}}}

storm finch
#

You started seeing this after using my recommendation?

#

This looks unrelated tho

autumn mica
#

yes

storm finch
#

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

autumn mica
#

we do have payment summary items in the paymentrequest

storm finch
#

hmm that's weird

#

Okie let's log out this value also

let authorizationController = PKPaymentAuthorizationController(paymentRequest: paymentRequest)
#

See if this authorizationController would return nil

autumn mica
#

hmm just a sec

#

it appeared when I removed the other PaymentSummaryItems

storm finch
#

You have others?

#

Nice to see it's displayed at least

autumn mica
#

yes, isolating what's causing the invalid summary item

storm finch
#

Glad to see it is finally working!

#

different Apple Accounts compatibility with currencies? ๐Ÿค” Just guessing

autumn mica
#

not sure yet, will update here once we find out the cause

storm finch
#

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

storm finch
#

@autumn mica ๐Ÿ‘‹

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?

storm finch
#

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

autumn mica
#

i don't get how it's an iOS development issue

storm finch
#

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

autumn mica
storm finch
#

I am checking this for you

#

Looks like not, since TestFlight seems to use ApplePay sandbox environment

#

Could you ask Apple for clarification?

autumn mica
#

I see, we'll discuss about it, thanks

autumn mica
#

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

storm finch
#

Some setting? Or cached setting?

autumn mica
#

yes, thanks

storm finch
#

Did you resolve it?