#ssbjsb_webhooks

1 messages ¡ Page 1 of 1 (latest)

simple dustBOT
#

👋 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.

true sundial
#

I can provide a screenshot if necessary

tranquil perch
#

Did you receive a payment_intent.requires_action event with amount_remaining ?

true sundial
#

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

tranquil perch
#

Can you share the Payment Intent Id? pi_xxx

true sundial
#

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

tranquil perch
#

Sure looking

true sundial
#

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?

tranquil perch
#

Yeah could you share that one too?

true sundial
#

Customer ID: cus_RB35tIYUaWhcW4

tranquil perch
#

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.

true sundial
#

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

tranquil perch
#

pi_2QFe2X5QM0nABsUH1zLGv2eM, right?

true sundial
#

pi_2QFe2X5QM0nABsUH1zLGv2eM, yes from the previous test

#

So what's going on with the current test customer?

tranquil perch
#

Thank you. qq on the same new Customer cus_RB35tIYUaWhcW4, if you fund more than then PI amount, would it automatically reconciled?

true sundial
#

When the payment is lower

tranquil perch
#

Trying to see if that's a Customer difference

true sundial
#

I am going to simulate more fund transfer

#

gimme a sec

tranquil perch
#

Please remember using the same Customer cus_RB35tIYUaWhcW4

true sundial
#

yes

#

I transferred $30 more and the invoice got paid automatically

#

Please check

tranquil perch
#

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

true sundial
#

I'll have to go through our app flow again to create a new customer with a subscription

#

Should take 3-5 mins max

tranquil perch
#

Can you just reuse the same Customer?

#

Sure that works too

#

np

true sundial
#

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

tranquil perch
#

Okie now let's call Confirm PaymentIntent on backend

true sundial
#

Can you share the call?

tranquil perch
#

Use a backend runnable script

true sundial
#

I see the payload
Do I just pass the payment_intent ID?

tranquil perch
#

Yes, the one inside your Invoice

true sundial
#

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)

tranquil perch
true sundial
#

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?

tranquil perch
#

I don't think so. Gimme a few mins

true sundial
#

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

tranquil perch
#

That should be correct. Can you paste me the PI Id on the screenshot above? pi_2QI...

true sundial
#

pi_2QIiFC5QM0nABsUH0tyszB4y

tranquil perch
#

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

true sundial
#

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?

tranquil perch
#

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

true sundial
#

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?

tranquil perch
#

No that default_payment_method expects a Payment Method Id in format of pm_xxx

#

customer_balance is a payment method type

true sundial
#

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?

tranquil perch
#

Um I don't think so...

#

not sure

#

the cash balance is kinda different

true sundial
#

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

#

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 :/

tranquil perch
#

Yes that's what I thought

true sundial
#

Kind of like a deadlock

tranquil perch
#

But you are uisng Subscription

#

which is a different engine and have different behaviors. Subscription's Invoice is different to the one off Invoice

true sundial
#

Okay so is our last resort to just email the customer if the payment is lower?

tranquil perch
#

Can you try the charge_automatically first

#

Yep that works too. Just maybe the partial refund part doesn't work on Subscription

true sundial
#

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

tranquil perch
#

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

true sundial
#

Okay

I don't see older conversations here with previous engineers.
Will your colleague be able to see this convo?

tranquil perch
#

Will be linked back for 1 week

true sundial
#

Okay gotcha

#

Thank you so much for your help.
Really appreciate it.

tranquil perch
#

Np