#Mr Stinky Pants
1 messages · Page 1 of 1 (latest)
Can you elaborate? Do you mean why didn't the variable assignment work within your code?
Testmode is designed so you can test flows without needing to test in livemode.
well its difficult to know whats happening if it works in test
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?
exactly
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?
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
And at what point does that code stop doing what you're expecting it to? Are there specific examples?
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
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?
Not too well
is there a way to use a test card on live?
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
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?
the only ones coming through are payment_method.attached
You can view livemode events here, and use the filter to search for a specific type of event:
https://dashboard.stripe.com/events
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you share your account ID?
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.
aaah
cool
im sure thats it, thanks a lot
i didnt think about it because test mode sends al
Happy to help!
cheers