#Hotsauce - Webhook 400s

1 messages · Page 1 of 1 (latest)

winter sluice
#

Hello! What are the details?

unborn citrus
#

The webhook seems to trigger and show up the in the event log but I wanted to know if I was missing something

winter sluice
#

So you're trying to create a Webhook Endpoint via the API?

unborn citrus
#

I see.

#

Doing something like the example code here?

#

// Handle the event
switch (event.type) {
case 'payment_intent.succeeded':
const paymentIntent = event.data.object;
// Then define and call a method to handle the successful payment intent.
// handlePaymentIntentSucceeded(paymentIntent);
break;
case 'payment_method.attached':
const paymentMethod = event.data.object;
// Then define and call a method to handle the successful attachment of a PaymentMethod.
// handlePaymentMethodAttached(paymentMethod);
break;
// ... handle other event types
default:
console.log(Unhandled event type ${event.type});
}

winter sluice
#

That's code for handling incoming events, which is different than creating a Webhook Endpoint. At a high level what are you trying to do?

unborn citrus
#

Sorry, pretty new to stripe.

#

I want to send Successful payments to stripe (which is already setup through Stripe Checkout) information to PipeDrive.

#

PipeDrive has endpoints that receive requests**

winter sluice
#

Ah, okay, so are you following a guide or instructions from PipeDrive?

unborn citrus
#

I am at the beginning stages having Stripe and PipeDrive communicate. I was under the impression that I need to send order information to PipeDrive from Stripe.

winter sluice
#

Can you give me more information? Who or what gave you that impression? Why are you trying to link PipeDrive and Stripe together?

unborn citrus
#

Internally, we use PipeDrive for sales related tracking. I am attempting to generate a Customer in PipeDrive when payments succeed in Stripe. I have a handful of custom fields added to the payment_intent_data's metadata object that I need to pass to PipeDrive for the customer creation.

winter sluice
#

And you want to write custom code to link the two systems together?

unborn citrus
#

Exactly. I am hoping the Stripe webhook I set up can send the information over to PipeDrive.

winter sluice
#

Okay, so the high-level steps are:

  1. Create a Webhook Endpoint in Stripe that points to the URL where the code you're writing can be reached. You can do this in the Dashboard here: https://dashboard.stripe.com/test/webhooks
  2. Write code that will accept the incoming events when we send them to the URL you specified and send the relevant data to PipeDrive.
unborn citrus
#

Awesome, thanks for talking me through the steps