#Empress Brosephine

1 messages ยท Page 1 of 1 (latest)

distant mossBOT
outer stirrup
#

Hey Pompey

#

Context: we inherited a project from outside dev source and i'm trying to put together how theyre handling webhooks and see if we need to add anything or what to enable ACH payments

delicate glacier
#

Hello ๐Ÿ‘‹

#

Yes, the webhook will get all events at the account level

outer stirrup
#

here's the events they've webhookinized:





            const stripeEvents = [



                { key: "subscription/create", event: "customer.subscription.created", config_key: "zaybra_subscription_create" },



                { key: "subscription/update", event: "customer.subscription.updated", config_key: "zaybra_subscription_update" },



                { key: "subscription/status", event: eventArray, config_key: "zaybra_subscription_status"},



                { key: "transaction/create", event: "charge.succeeded", config_key: "zaybra_transaction_create" },



                { key: "customer/create", event: "customer.created", config_key: "zaybra_customer_create" },



                { key: "customer/update", event: "customer.updated", config_key: "zaybra_customer_update" },



                { key: "charge/fail", event: "charge.failed", config_key: "zaybra_charge_fail" },



                { key: "charge/refund", event: "charge.refunded", config_key: "zaybra_charge_refund" },



            ];


delicate glacier
#

So you would need to filter in the endpoint's code after you have received the event

outer stirrup
#

so payment type is set on that then and not within the webhook itself?

#

we're using the card element if thats of any help

delicate glacier
#

Webhook events are sent to an endpoint based on two things: the account and the event type

#

So if you make an endpoint that is subscribed to the invoice.paid event, you will get events for all invoices paid on that account

outer stirrup
#

gotchaaaa; so theoretically all a client would have to do is enable ACH in their account and the card element would be good?

delicate glacier
#

Or for connect, all invoices paid on all connected accounts

#

Not sure what you mean there. Can you expand on that?

outer stirrup
#

sure thing; apologies if this is mis explained, I usually use the node library. So from what I can tell with the node library, the card element is generated based off of two factors:

  1. the payment methods activated in the account
  2. What you send to the paymentIntent as a payment method ("card" or "us_bank_account")

So I guess i'm just wondering the equivalent of step 2 in webhooks if it even is needed

delicate glacier
#

Ah gotcha. We actually call that element the "Payment Element" the "Card Element" is a separate thing that can only ever take card payments.

As for the webhooks, any payment_intent.* events will get triggered whether the payment intent was paid via ACH or card. So you can listen to the same events after enabling ACH.

outer stirrup
#

gotchaaaa ok. So I guess the area i'm getting stuck on is how do we tell Payment Element to accept ACH when using webhooks to initiate? If that's even a thing? lol

delicate glacier
#

Yeah I'm not sure what you mean by "using webhooks to initiate" a webhook is something that we send you. There are times when we wait for you to acknowledge that you got one but that wouldn't be relevant to the payment element here

#

Can you tell me more about what you are trying to do right now?

outer stirrup
#

gotcha ok, no worries. So currently, the existing developers have it setup to just take credit cards. We're just trying to add ACH functionality, but I'm unsure of where to tell that Payment Element to accept it other than my experience using the Node library lol. But this might be on me needing to do more discovery on it

#

i guess essentially the question is: what sets the payments types in a Payment Element besides setting it on the account level

delicate glacier
#

Gotcha. So you had it basically right, the payment intent will have types based on either

  1. What PMs are enabled on your account (filtered by your PI's currency and whatnot)
  2. The payment methods you provide to the payment_method_types parameter when creating the payment intent https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_types
outer stirrup
#

excellent thank you so much

#

I think they're using the card element so changing that to a payment element is probably the answer also ๐Ÿ˜„

#

you helped on many factors!!