#ssbjsb_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ 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/1304259389187948637
đ 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.
- ssbjsb_webhooks, 2 days ago, 4 messages
Did you receive a payment_intent.requires_action event with amount_remaining ?
No
I refreshed the Stripe page. It's the same events as in the screenshot
No more events created after the "cash_balance.funds_available" event
Can you share the Payment Intent Id? pi_xxx
We use invoicing so the payment_intent is created automatically.
Should share the payment_intent ID from the invoice?
Nvm
Here's the ID: pi_2QIh0v5QM0nABsUH1nRrG5Ng
This is in stripe test mode
Sure looking
Can you try to Retrieve the Customer, and check this reconciliation_mode? https://docs.stripe.com/api/customers/create#create_customer-cash_balance-settings-reconciliation_mode
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Checking
There is no cash_balance hash on the customer
In my previous test I made payment in excess and Stripe auto reconciled the invoice.
Only when the payment is below the invoice amount it's not auto-reconciling
Would you like to check the test customer?
Yeah could you share that one too?
Customer ID: cus_RB35tIYUaWhcW4
It's the same customer with the Invoice, right? Can you share the previous test Invoice where
I made payment in excess and Stripe auto reconciled the invoice.
Sure
This is not the same customer as before
Previous customer ID: cus_R7tIKvYBXWXQT2
You can see for this previous customer, after I simulated the funds transfer, the payment_intent_succeeded event was created.
With this new test customer since the payment is lower than invoice amount no new events were created after the simulated funds transfer
pi_2QFe2X5QM0nABsUH1zLGv2eM, right?
pi_2QFe2X5QM0nABsUH1zLGv2eM, yes from the previous test
So what's going on with the current test customer?
Thank you. qq on the same new Customer cus_RB35tIYUaWhcW4, if you fund more than then PI amount, would it automatically reconciled?
When the payment is lower
Trying to see if that's a Customer difference
Please remember using the same Customer cus_RB35tIYUaWhcW4
Yeah you are right
hmm
Okie let's do this test again, create a new PI, transfer an amount < the PI amount, expecting nothing happens. Then you try to call Confirm Payment Intent or Pay Invoice API
Let's see if there is a trigger of payment_intent.requires_action
I'll have to go through our app flow again to create a new customer with a subscription
Should take 3-5 mins max
I don't know how to create a new invoice
Okay let me cancel the customer's plan and put them again on a plan for our app
Okay we got a new open invoice
Transferring lower funds now
Done
Did not auto-reconcile or create new events expected
Okie now let's call Confirm PaymentIntent on backend
Can you share the call?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Use a backend runnable script
I see the payload
Do I just pass the payment_intent ID?
Yes, the one inside your Invoice
You cannot confirm this PaymentIntent because it's missing a payment method. To confirm the PaymentIntent with cus_RB35tIYUaWhcW4, specify a payment method attached to this customer along with the customer ID. (Stripe::InvalidRequestError)
Okie can you try this Pay Invoice APi instead: https://docs.stripe.com/api/invoices/pay
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There is no default_payment_methodset on this Customer or Invoice. Set a default on one of those objects, or specify the Payment Method you wish to use in thepayment_method parameter. (Stripe::CardError)
I put this on the invoice when the invoice is created from our code
Do I need to set the default_mandate while creating the invoice from our app too?
I don't think so. Gimme a few mins
I tried to pass the payment_method param as customer_balance in the invoice.pay call but it didn't accept it. Seems like it wants a payment_method ID
We were told we don't need to create or use PaymentMethods if we are using customer_balance
That should be correct. Can you paste me the PI Id on the screenshot above? pi_2QI...
pi_2QIiFC5QM0nABsUH0tyszB4y
Okie, let's try this again. Could you run over the flow, but this time when you create Subscription, pass collection_method : charge_automatically?
instead of send_invoice
Oh
For that I'll have to change our code and it'll have to build again in our CI for the env to be ready to perform the end-2-end test.
Also send_invoice sends the invoice to the customer with the VBAN right? That is what we want.
If we change it to charge_automatically it won't send the invoice to the customer right?
We can use the customer_cash_balance_transaction.created webhook event with the type funded to manually reconcile the invoice if the payment is lower.
Can you suggest a way to get the Invoice.pay call to work without me having to change the collection_method?
Um I am not entirely sure, just trying to figure it out if charge_automatically makes any different here. What I see the the last few PI is it doesn't have automatic_payment_methods (see it's null) so it wasn't automatically attempted
Okay I know a way
In an error message with invoice.pay it said the default_payment_method on the customer is not set
So can I set the default_payment_method to customer_balance on the stripe customer while creating the it?
Will that make the invoice.pay call pass?
No that default_payment_method expects a Payment Method Id in format of pm_xxx
customer_balance is a payment method type
Hmm
So how do we programatically pay the invoice if the payment is lower?
Can a PaymentMethod be created with customer_balance?
We link the stripe customer ID to our customers.
We could link the PaymentMethod ID to the customers as well.
And use that ID to manually pay the invoice if needed
Will that work?
Another way for us could be to only create a PaymentMethod with the type customer_balance when we process this webhook and use the PM to pay the invoice
https://docs.stripe.com/api/payment_methods/create This document says customer_balance is a type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah the PM method does not work
It requires a PM to be attached to a customer but a PM of type customer_balance cannot be attached to a customer :/
Yes that's what I thought
Kind of like a deadlock
Sorry, the thing is the bank transfer here https://docs.stripe.com/payments/bank-transfers/accept-a-payment?payment-ui=direct-api&invoices=with&integration=pm-manual is the flow for a standalone Invoice or PaymentIntent, isn't really for a Subscription
But you are uisng Subscription
which is a different engine and have different behaviors. Subscription's Invoice is different to the one off Invoice
Okay so is our last resort to just email the customer if the payment is lower?
Can you try the charge_automatically first
Yep that works too. Just maybe the partial refund part doesn't work on Subscription
We'll have to keep this thread open for that till tomorrow.
I'll have to make code changes and have it go through our CI for the env to be ready to be tested with the changes
We will need to close the thread when we change the staffing member. But don't worry you can always open a new thread and it will link here
My colleague can pick up
Okay
I don't see older conversations here with previous engineers.
Will your colleague be able to see this convo?
It's in this message
Will be linked back for 1 week
Np