#wasko

1 messages · Page 1 of 1 (latest)

signal hedgeBOT
willow ridge
#

Can you show an example of this?

#

How does this error surface to you?

severe iris
#

yes sure

#

i give you visual exemple and log

#

so this is what happens when i clique top open my paymentSheet

willow ridge
severe iris
#

and this is the log when i click on the card

willow ridge
#

Can you share one of those request IDs? req_123

severe iris
willow ridge
#

Can you copy that ID as text here?

severe iris
#

req_cek4WAylVwteGV

#

no problem like this?

willow ridge
#

yes, thank you

#

Can you share code snippets of your ios integration code?

severe iris
#

yes wait 2 mn

willow ridge
#

Text using code multiline notation is preferred over images. using ``` and ``` makes this:

multi
  line
  code
here
severe iris
#

okay no probleme sending you only where im doing all the parameters for the paymentSheet okay?

willow ridge
#

Trying to make sure we have enough information to help you

severe iris
#

class CardPaymentIntent: ObservableObject {
    @Published var paymentSheet: PaymentSheet?
    @Published var paymentResult: PaymentSheetResult?
    @EnvironmentObject  var ScanServiceID : GetTransactionByScanIDAPI
    //Card method
    
    func preparePaymentSheet() async {
        //          Configuration de Stripes -->

        let ephemeralKeyString =   ScanIDService.shared.dataTransaction.dataTransactionApi?.stripEphemeralKey ?? "pas de clé ephemere pour la configuation du customer"
        let customerId = ScanIDService.shared.dataTransaction.dataTransactionApi?.customer_id ?? "pas de customer ID dans la configuration"
        let paymentIntent = ScanIDService.shared.dataTransaction.dataTransactionApi?.paymentIntent ?? "pas de pi"
        
        

        STPAPIClient.shared.publishableKey = ScanIDService.shared.dataTransaction.dataTransactionApi?.publishableKey

        // MARK: Create a PaymentSheet instance
        var configuration = PaymentSheet.Configuration()
        configuration.merchantDisplayName = "Example, Inc."
        configuration.returnURL = "topthetop://successPayment"
        configuration.customer = .init(id:customerId ,
                                       ephemeralKeySecret: ephemeralKeyString )
        configuration.allowsDelayedPaymentMethods = false
        
        self.paymentSheet = PaymentSheet(paymentIntentClientSecret: paymentIntent, configuration: configuration)
    }
    
    //    function completion
    func onPaymentCompletion(result: PaymentSheetResult) {
        self.paymentResult = result
    }
    
}
#

And if you ask me, I can indeed print all the variables that are above for the configuration of the paymentSheet

willow ridge
#

Is the value in paymentIntent a client secret?

#

with a value like pi_1234_secret_5678?

severe iris
#

yes like this "paymentIntent": "pi_3OPWKtIuOb4DjiSK0jkiKIJ6_secret_rAvPXQc6k1DuHpaE9zs6pgCnk"

severe iris
#

?

summer void
#

Apologies, still looking in to this. And just to confirm, you have double checked that the publishable key, customer ID, and PaymentIntent ID all have the values that you are expecting here

severe iris
#

no problem brother

#

yes you want me to print it?

summer void
#

Yes please

severe iris
#

okay wait

summer void
#

Can you send the text of that output?

severe iris
#

yes

#

like this or you want me to delete it?

summer void
#

That is great, thank you

severe iris
#

okayy thx

summer void
#

So it looks like the payment intent is a direct charge (one that you created on a connected account). Can you try setting configuration.stripeAccount to the ID of the account that you are creating this intent for?

#

Our API clients also need to know which account they are making calls for. I am wondering if this is an error because of a mixup there (in which case I will make sure we improve the error message)

severe iris
#

i have had this line and its works don't understant why..

#
STPAPIClient.shared.stripeAccount = ScanIDService.shared.dataTransaction.dataTransactionApi?.merchantAccountId
summer void
#

So when you create the PaymentIntent, you are making the API call with your platform's secret key and are specifying the Stripe-Account header.
In your app, you are making API calls with your platform's publishable key and that setting is how you specify the Stripe-Account in the iOS SDK

#

So before that line, your payment intent and ephemeral key existed on your connected account, but the iOS SDK was trying to use the API as your platform account, so it could not find them

severe iris
#

Okay, thank you very much, I understand where the problem was coming from. However, a week ago, I didn't have this line, and it was working. Have stripes made any updates? Because I received an email stating that the return URL was becoming obligatory.

summer void
#

This behavior has not changed recently, if it was working without that line, it sounds like your server was also not setting the Stripe-Account header so the intent would also be on your plaform account

severe iris
#

okay i see now i have to get a talk with my brother for that...👊

#

thansk lot brother for you're time and you're help god bless you:)

summer void
#

Happy to help!