#wasko
1 messages · Page 1 of 1 (latest)
yes sure
i give you visual exemple and log
so this is what happens when i clique top open my paymentSheet
Do you see any erroring requests in your developer logs?
https://dashboard.stripe.com/test/logs/
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
and this is the log when i click on the card
no error look
Can you share one of those request IDs? req_123
sure
Can you copy that ID as text here?
yes wait 2 mn
Text using code multiline notation is preferred over images. using ``` and ``` makes this:
multi
line
code
here
okay no probleme sending you only where im doing all the parameters for the paymentSheet okay?
Trying to make sure we have enough information to help you
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
Is the value in paymentIntent a client secret?
with a value like pi_1234_secret_5678?
yes like this "paymentIntent": "pi_3OPWKtIuOb4DjiSK0jkiKIJ6_secret_rAvPXQc6k1DuHpaE9zs6pgCnk"
?
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
Yes please
Can you send the text of that output?
That is great, thank you
okayy thx
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)
i have had this line and its works don't understant why..
STPAPIClient.shared.stripeAccount = ScanIDService.shared.dataTransaction.dataTransactionApi?.merchantAccountId
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
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.
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
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:)
Happy to help!