#pannagger_api

1 messages ยท Page 1 of 1 (latest)

robust parrotBOT
#

๐Ÿ‘‹ 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.

cobalt elbow
#

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

unique solar
#

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?

crystal remnant
#

This is what i get

#

And this is how i set returnUrl

unique solar
#

IF you omit the URL, does the error go away?

crystal remnant
#

No, all that changes is that i get a warning and can not use paypal or revolut anymore

unique solar
#

But you still see the concurrent calls error?

#

I suspect the issue lies somewhere else

crystal remnant
unique solar
#

Can you share the code where you're presenting the Sheet?

crystal remnant
#

Give me a sec need to share as file

robust parrotBOT
#

๐Ÿง‘โ€๐Ÿ’ป 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 foo contains the value bar.

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)
unique solar
#

You can use codeblocks instead^^

#

and copy paste the code

crystal remnant
#

too long...

unique solar
#

The error shows up when you click submit?

crystal remnant
unique solar
#

Can you move the code out of the <Modal /> and let the presentPaymentSheet() present on its own?

crystal remnant
#

Give me a sec

unique solar
#

did the error go away?

crystal remnant
#

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)
    }
unique solar
#

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

crystal remnant
#

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...

unique solar
#

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]);```
crystal remnant
#

my logs only show the console.log 2 times, once at inital render and when i set clientSecret from intent

unique solar
crystal remnant
unique solar
#

Sorry the video is blurry but it looks like it does run the useEffect again?

crystal remnant
#

Only once before showing the sheet

#

Discord does downscale Video Resolution somehow

unique solar
#

Ah ok ok

crystal remnant
#

After the sheet opened it does not go into the useeffect anymore

unique solar
#

how about the other useEffect that presents the payment sheet?

crystal remnant
#

Ahh wait

#

Same, it stops at line:
if(paymentIntent) once before showing it but not after it appears anymore

unique solar
#

not sure I follow

crystal remnant
#

I tried again a video and did film every action i did clearly

unique solar
#

Oh maybe it is related to the URL ๐Ÿค”

#

You probably need a valid return URL here

crystal remnant
#

which is a costum but working url

unique solar
crystal remnant
#

i can try to make a developement build and test it in apple's testflight

unique solar
#

for iOS

crystal remnant
#

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

unique solar
#

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

robust parrotBOT
crystal remnant
#

this may take some time, android crashes

crystal remnant
#

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

graceful wedge
#

We will be here tomorrow