#FKaiB

1 messages · Page 1 of 1 (latest)

glass sailBOT
ivory glacier
#

Hi, what does your server side code when creating the Payment Intent look like?

stark glacier
#
@app.route('/create-payment-intent', methods=['POST'])
def create_payment():
    try:
        data = json.loads(request.data)
        # Create a PaymentIntent with the order amount and currency
        intent = stripe.PaymentIntent.create(
            amount=calculate_order_amount(data['items']),
            currency='usd',
            automatic_payment_methods={
                'enabled': True,
            },
        )
        return jsonify({
            'clientSecret': intent['client_secret']
        })
    except Exception as e:
        print("Server Error:", str(e))
        print("Traceback:", traceback.format_exc())
        return jsonify(error=str(e)), 403```
ivory glacier
#

Google Pay and Apple Pay are tricky as you need to have a payment method saved in your wallet in your browser. Or else, it won't show.

stark glacier
#

req_t9mNWhEmqOSthR
Here is the request id

#

What should I be doing with the request ID?

ivory glacier
#

Looking

#

Just so we are on the same page, the above code you shared is not triggering this.. This payment Link was created from your Dashboard.

stark glacier
#

Yes I have enabled other payment methods as shown in the screenshot

ivory glacier
#

Automatic payment method only shows compatible payment method. Do you have a shareable url here so that I can test this on my end?

stark glacier
#

what do you mean by a shareable url?

ivory glacier
#

It's weird because I've enabled Apple pay and Google pay on my account but not Cash App Pay, yet the only one being displayed on the screen is Cash App Pay.

I do see CashApp enabled on your screenshot.

stark glacier
#

I'm pretty sure I have it off or maybe I'm misunderstanding something

ivory glacier
#

From your screenshot

stark glacier
#

right

ivory glacier
#

So it's turned on and it's working as expected.

stark glacier
#

on the right side it says "Turn on". Doesn't this mean that it is currently off?

ivory glacier
#

Ahh, you're right.

#

Do you happen to have more than one Stripe Account?

stark glacier
#

I only have this account

#

I am using the test mode API key

ivory glacier
#

Do you have some Payment Method enabled in Test mode vs. Live mode?

stark glacier
#

You are right. Cash App was enabled in test mode

#

and you said earlier that the users will on ly see an option to use Apple Pay or Google Pay when they have a wallet in their browser?

ivory glacier
#

That is correct

stark glacier
#

Hoe do I add Apple Pay to my safari browser? I thought it automatically does that when you have apple pay on your mac