#Som-payment-failed

1 messages · Page 1 of 1 (latest)

stable depot
#

Hi there!

#

Let's use this thread to chat

#

You said: ```Getting this error after this

applePayContext.presentApplePay()```

trim halo
#

this

#

yes

#

Do you know about this error.?

stable depot
trim halo
#

Yes I did set my publish key as mentioned in the article.

#

StripeAPI.defaultPublishableKey = "pk_test_GUbs5JkiUf0VPJa6fCUwt2vI"

stable depot
#

Hmm okay, and what about server-side?

#

Is your Secret key set up correctly to initialize Stripe in order to create the PaymentIntent on your account?

trim halo
#

No, I didn't use anything on sever side related to apple pay.

#

isn't directly communication with Stripe?

#

Cannot initialize FundingType from invalid String value unknown

#

now getting this error

#

Payment Failed: Optional(Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "card", intValue: nil), CodingKeys(stringValue: "funding", intValue: nil)], debugDescription: "Cannot initialize FundingType from invalid String value unknown", underlyingError: nil)))

stable depot
#

Hmm I'm not familiar with that error. What line is throwing that?

trim halo
#

My this delegate not getting called

#

func applePayContext(_ context: STPApplePayContext, didCreatePaymentMethod paymentMethod: StripeAPI.PaymentMethod, paymentInformation: PKPayment, completion: @escaping STPIntentClientSecretCompletionBlock) {

#

so how I can pass the clientsecret key

stable depot
#

You would need to fetch the client secret from your server within that applePayContext function.

trim halo
#

But that function is not getting called

#

I mean, I'm not receiving callback in that function.

bitter wyvern
#

Hi 👋

trim halo
#

Thank you for your help

#

working now

bitter wyvern
#

Oh really? What changed?

trim halo
#
  1. Add publish key again before payment request.
  2. Change the Test card from master card to discover card.
  3. Hit v1/payment_intents Api at client side for now.