#devraj_api

1 messages ยท Page 1 of 1 (latest)

craggy marshBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

past storm
#

I am sure I am missing something little here ๐Ÿ™‚

cinder star
#

Hey there, sorry for the delay, taking a look

past storm
#

no worries at all, thanks for joining the chat

craggy marshBOT
past storm
#

for reference originally I was attempting to surface alipay as a option using a Payment Element, which our customers already use to link their card or AU BECS account for off session payments

#
        setup_intent = stripe.SetupIntent.create(
            customer=starrez_entry.get('Stripe_ID'),
            payment_method_types=['card', 'au_becs_debit', 'alipay', 'payto'],
            stripe_account=starrez_entry.get('StripeConnectedAccountID'),
            usage='off_session',
            # Passing this here so we can fetch the Stripe Connect Id
            # from StarRez which will be used to attach the payment method
            payment_method_options={
                'alipay': {
                    'currency': 'aud',
                },
            },
            mandate_data={
                'customer_acceptance': {
                    'type': 'offline',
                }
            },
            metadata={
                'starrezId': entry_id,
            },            
        )
#

which I assume doesn't work for alipay, so I went back to attempting to create an intent on the server, to see if I can fetch the next_action

cinder star
#

Right, so looking at this request: https://dashboard.stripe.com/acct_1Psvf4Kh8ZCyeXqY/test/logs/req_JL5RD7cSW5nrkt

If you're managing this server-side you also need to specify the payment_method_data to pass minimal information that the customer wishes to complete payment with alipay:

payment_method_data: {
    type: 'alipay',
},
#

When confirming like this you need to pass either a payment_method or payment_method_data

#

In the case of alipay, nothing but type is required, and you'll then have to redirect the customer to the next action url to complete the flow

past storm
#
>>> stripe.SetupIntent.create(stripe_account='acct_1Psvf4Kh8ZCyeXqY', customer='cus_TUbfZTQRZFhe7e', payment_method_types=['alipay'],)
<SetupIntent setup_intent id=seti_1T2IgcKh8ZCyeXqYA9risR6X at 0xffff971aba70> JSON: {
  "application": "ca_QjhuLWe5qXrO3fpHs0TD78JCcadOJL8W",
  "automatic_payment_methods": null,
  "cancellation_reason": null,
  "client_secret": "seti_1T2IgcKh8ZCyeXqYA9risR6X_secret_U0JJRs6WIVIydlUjtr6G6qwGTAUKNnO",
  "created": 1771451614,
  "customer": "cus_TUbfZTQRZFhe7e",
  "customer_account": null,
  "description": null,
  "excluded_payment_method_types": null,
  "flow_directions": null,
  "id": "seti_1T2IgcKh8ZCyeXqYA9risR6X",
  "last_setup_error": null,
  "latest_attempt": null,
  "livemode": false,
  "mandate": null,
  "metadata": {},
  "next_action": null,
  "object": "setup_intent",
  "on_behalf_of": null,
  "payment_method": null,
  "payment_method_configuration_details": null,
  "payment_method_options": {},
  "payment_method_types": [
    "alipay"
  ],
  "single_use_mandate": null,
  "status": "requires_payment_method",
  "usage": "off_session"
}
#

I did try that and the next_action always comes back as null

#

ideally I would want to allow the user to follow a link from Elements? but if that's not possible I am happy to build the interaction

tight cloak
#

hi there; I'll be taking over for synthrider here who needed to step away

past storm
#

no problem at all, thank you both for your time

tight cloak
past storm
#

thank you, I will give this a go and get back to you if I need further help

#

looks like it has all the information i need, apologies that I missed this