#Mr Stinky Pants

1 messages · Page 1 of 1 (latest)

amber pierBOT
vast charm
#

Can you elaborate? Do you mean why didn't the variable assignment work within your code?

bold needle
#

yes i mean it works in test mode

#

but how can i find out on live?

vast charm
#

Testmode is designed so you can test flows without needing to test in livemode.

bold needle
#

well its difficult to know whats happening if it works in test

vast charm
#

Sorry, I'm not sure I understand what you're trying to ask.

#

Are you trying to say that something you've tested in testmode, where you've confirmed it works, is not working in livemode?

bold needle
#

exactly

vast charm
#

Okay, so what doesn't work, is there more context than that one line of code? When you imply it doesn't work, what does that mean exactly, what isn't working and how?

bold needle
#

well its not getting past that first part in webhook

#

case Events.SetupIntentSucceeded:
var setupIntent = stripeEvent.Data.Object as SetupIntent;
customerService = new CustomerService();
customer = customerService.Get(setupIntent.CustomerId);

                    var customerInvoiceSettingsOptions = new CustomerInvoiceSettingsOptions
                    {
                        DefaultPaymentMethod = setupIntent.PaymentMethodId
                    };
                    var customerUpdateOptions = new CustomerUpdateOptions
                    {
                        InvoiceSettings = customerInvoiceSettingsOptions
                    };
                    customerService = new CustomerService();
                    customerService.Update(customer.Id, customerUpdateOptions);
#

after the setup intend succeeds i want to set that card as the default method

vast charm
#

And at what point does that code stop doing what you're expecting it to? Are there specific examples?

bold needle
#

it looks like it doesnt apply it to the customer

#

theres nothing in logs

#

all i can tell is it doesnt get to customerservice.update

vast charm
#

Did you add logging to the function so you can track exactly where it stops doing what you expect? Are there any errors being thrown on your server that is running this event handler code?

bold needle
#

i dont have any experices with viewing logs on my server

#

do you know .net?

vast charm
#

Not too well

bold needle
#

is there a way to use a test card on live?

vast charm
#

No

#

They are only for testmode use.

bold needle
#

ive found my webhook does return a response which should show up in the dashboard logs

#

so it would look like SetupIntentSucceeded is not being fired at all

vast charm
#

That response should just be your webhook endpoint providing us with acknowledgement that it received the event.

#

Have you tried filtering your events to see if one is being generated?

bold needle
#

the only ones coming through are payment_method.attached

vast charm
#

Can you share your account ID?

bold needle
#

you mean windowcad?

#

acct_1JIb8NJKY8YXH2zh

vast charm
#

Your livemode webhook isn't listening for setup_intent.succeeded events, it's only listening for payment_method.attached. I'm not sure how your case statement is checking the type of event, but if it is looking for setup_intent.succeeded events then it won't triggered because those currently aren't being sent to your webhook endpoint.

To change this, you'll need to update your webhook endpoint so that it is listening to the events that you want it to.

bold needle
#

aaah

#

cool

#

im sure thats it, thanks a lot

#

i didnt think about it because test mode sends al

vast charm
#

Happy to help!

bold needle
#

cheers