#hendr1x_api

1 messages ยท Page 1 of 1 (latest)

blissful escarpBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dark bronzeBOT
potent token
#

looks like current code got cut off

#
        $subscription = [
            'customer' => $account_code,
            'items' => [['price' => $payment_price_code]],
            'default_payment_method' => $payment_method_code,
            'payment_behavior' => 'default_incomplete', // this lets us confirm the payment later
            'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
            'currency' => $currency,
            'expand' => ['latest_invoice.payment_intent'] // provides secret for us to add to response
        ];
        if (!empty($source) or !empty($token)){
            $subscription['metadata'] = [];
            if (!empty($source)){ $subscription['metadata']['source'] = $source; }
            if (!empty($token)){ $subscription['metadata']['token'] = $token; }
        }
        $result = $this->system->subscriptions->create($subscription);
runic vault
#

Hi there ๐Ÿ‘‹

Subscriptions automatically cause setupFutureUsage to be set appropriately, that's not a parameter you need to worry about.

Is this code not doing what you're hoping when you're testing it? That insight may better help me understand what you're trying to ask.

It seems a little odd to me, at least at first, that you're providing values for both the default_payment_method parameter and the payment_settings.save_default_payment_method parameter in the code you shared. Are you trying to use an already saved Payment Method, or use the Subscription to create a new one?

potent token
#

Howdy!

#

So....no issues that I am noticing but I am just setting up subscriptions for the first time

#

So, if you will bear with me

#

In my use case I want a confirmation page during the checkout flow

#

payment_method+address -> confirm -> confirm PaymentIntent (client side) -> complete (return url)

#

I do support payment methods already save to accounts

#

So do my settings need adjusting?

runic vault
#

I don't think so. You already have payment_behavior set to default_incomplete, which is the key thing to make this work.

potent token
#

ok. Thank you for your time.