#hendr1x_api

1 messages ยท Page 1 of 1 (latest)

onyx rockBOT
#

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

๐Ÿ“ 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.

unkempt lynx
#

For code...here is the request

       $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);
#

For response....

#

Where it does not

#

Here is the data that I am sending exactly

#

Array ( [customer] => cus_RMZxI2SLKKEHah [items] => Array ( [0] => Array ( [price] => price_1QfN0lCTw3MsNtCvYgd3niiX ) ) [default_payment_method] => pm_1QWI3XCTw3MsNtCvPMLGdRtS [payment_behavior] => default_incomplete [payment_settings] => Array ( [save_default_payment_method] => on_subscription ) [currency] => usd [expand] => Array ( [0] => latest_invoice.payment_intent ) [metadata] => Array ( [source] => subscription_plan [token] => 4LN3Y3C4 ) )

vague berry
#

Thanks for the info, taking a look

unkempt lynx
#

Happy to give you more info. I've got everything sitting ready to run if needed.

vague berry
#

Ah you are running into our minimum charge amount. Basically by default the minimum USD charge amount is $0.50 because lower than that you can lose money on fees and such (though you can write into support in you want to remove this restriction).

#

So when an invoice is created for less than that amount, we immediately mark it as paid and put a debit for that amount on the customer's balance, which gets added to the next invoice on that customer.

unkempt lynx
#

haha...ah ok

vague berry
#

You are creating $0.33 invoices, so the first one gets automatically marked paid and no PI is generated because there is no payment, but the debit is applied to the next invoice which means that that one is $0.66 which does get charged so it does create an intent

unkempt lynx
#

I'm seeing a amount of $5.55 for price_1QfN0lCTw3MsNtCvYgd3niiX

#

I might be wrong...I will check

#

Nope...my db is out of date

#

ok

#

thats great

#

Do I have acess to these errors in a log?

#

It's all working properly now fyi. Thanks for the help. I would never have been able to figure it out.

vague berry
#

Of course, that was definitely a subtle one

onyx rockBOT
unkempt lynx
#

I think he missed my question

#

Do I have acess to these errors in a log?

vague berry
#

Our dashboard request logs page has a filter for requests that errored out. This behavior didn't result in an error on our side, so you wouldn't see these calls here but that is a good way to find them https://dashboard.stripe.com/test/logs