#pannagger_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1361758889674146054
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! just wanted to acknowledge that i've seen your question, but the discord is a little busy atm so it might be a bit before i can get back to you
Hello ๐
Jumping into help out here
I'm not sure I fully grasp the issue you're describing. Can you maybe share some example screenshots so that I'm on the same page?
This is what i get
My call back handler looks like in:
And this is how i set returnUrl
IF you omit the URL, does the error go away?
No, all that changes is that i get a warning and can not use paypal or revolut anymore
But you still see the concurrent calls error?
I suspect the issue lies somewhere else
Can you share the code where you're presenting the Sheet?
Give me a sec need to share as file
๐งโ๐ป How to format code on Discord
Inline code: wrap in single backticks (`)
This:
The variable `foo` contains the value `bar`.
Will turn into this:
The variable
foocontains the valuebar.
Code blocks: wrap in three backticks (```)
Also, you can specify the language after the first three backticks to get syntax highlighting.
This:
```javascript
function foo() {
return 'bar';
}
```
Will turn into this:
function foo() {
return 'bar';
}```
Notes about **code blocks**:
- Specifying the language is optional (e.g., you can omit `javascript` in the example above)
- If you don't specify the language you won't get syntax highlighting
- When you're inside a code block (after you type \`\`\`) the `Return`/`Enter` key will add a new line instead of sending your message
- Once you end the code block `Return`/`Enter` works normally again
You can [read more about message formatting on Discord's website.](https://support.discord.com/hc/en-us/articles/210298617)
The error shows up when you click submit?
When i press pay here
Can you move the code out of the <Modal /> and let the presentPaymentSheet() present on its own?
did the error go away?
no
it used to work when callbackUrl was "weexplan://....", i mean not working but at least an error occured that url is invalid and i could close sheet manually and use again
payment intend on server side is created like:
fun createPaymentIntentContract(personId: BsonObjectId, productId: BsonObjectId): ResponseDTO? {
val productTmp = contractRepository.findById(productId).getOrNull() ?: return null
return createPaymentIntent(personId, productTmp.id.value.toString())
}
fun createPaymentIntentProducts(personId: BsonObjectId, productId: BsonObjectId): ResponseDTO? {
val productTmp = productsRepository.findById(productId).getOrNull() ?: return null
return createPaymentIntent(personId, productTmp.id.value.toString())
}
fun createPaymentIntent(personId: BsonObjectId, productId: String): ResponseDTO? {
val person = personService.getPersonById(personId) ?: return null
val resource: Product = Product.retrieve(productId)
val priceId: String = resource.defaultPrice
val price: Price = Price.retrieve(priceId)
val customerId: String = person.stripeId.toString()
println(resource.defaultPriceObject)
val createParams: PaymentIntentCreateParams = PaymentIntentCreateParams
.builder()
.setCustomer(customerId)
.setAmount(price.unitAmount.toLong())
.setCurrency("EUR")
.build()
val intent = PaymentIntent.create(createParams)
return PaymentResponse(BigDecimal(intent.amount/100.0), intent.id, intent.clientSecret, false)
}
So if you put the old callback URL back does the concurrent API call error goes away?
I'm just puzzled by the error itself. This specific error shouldn't be triggered for malformed URL
no it does not go away anmore, doesn't matter what url is... just tried a web url
just to be clear about when it happens...
Oh you have paymentIntent as a dependency in a useEffect
I wonder if the confirmation re-renders and invokes following again
const initializePaymentSheet = async () => {
const {error} = await initPaymentSheet({
paymentIntentClientSecret: paymentIntent?.clientSecret,
returnURL: 'exp://stripe-redirect',
// Set `allowsDelayedPaymentMethods` to true if your business handles
// delayed notification payment methods like US bank accounts.
allowsDelayedPaymentMethods: true,
// appearance: customAppearance
});
if(error){
console.log(error);
}
};
console.log(paymentIntent);
initializePaymentSheet();
}, [paymentIntent, initPaymentSheet]);```
my logs only show the console.log 2 times, once at inital render and when i set clientSecret from intent
Can you use a breakpoint instead? https://docs.expo.dev/debugging/tools/
and see if that useEffect runs again after you click on the pay button?
Sorry the video is blurry but it looks like it does run the useEffect again?
Only once before showing the sheet
Discord does downscale Video Resolution somehow
Ah ok ok
After the sheet opened it does not go into the useeffect anymore
how about the other useEffect that presents the payment sheet?
Ahh wait
Same, it stops at line:
if(paymentIntent) once before showing it but not after it appears anymore
not sure I follow
Yeah i'm not sure about expo go -- the docs are quite vague about it - https://docs.expo.dev/linking/overview/#in-a-standalone-app
i can try to make a developement build and test it in apple's testflight
Yeah but you'd want to make sure you've followed the steps outlined in - https://docs.expo.dev/linking/overview/#in-a-standalone-app
for iOS
sure i can try but still not sure if it helps since the error clearly states:
"The current action is not yet completed:
STPPaymentHandler does not support concurrent calls to its API."
which sounds for me like an api problem
let me quickly try an android phone
Yeah I'm 99% sure this works fine on Android.
When you click on "pay", PaymentSheet invokes the code that involves the return URL
I believe there's some validation that's firing with incorrect URL
this may take some time, android crashes
okay i guess this is a problem for tomorrow on android i got the error:
"merchantDisplayName cannot be empty or null."
but when i set it, it crashed on present payment shee
We will be here tomorrow