#nate!

1 messages · Page 1 of 1 (latest)

toxic briarBOT
stiff gate
#

Hi there

floral meteor
#

hi there

stiff gate
#

No those are not parameters of the PaymentIntent object

floral meteor
#

how can i get it?

stiff gate
#

You would collect those separately if you are using a custom integration

#

And you can store them on the Customer object or as metadata for the PaymentIntent or in your own database

floral meteor
#

i dont wanna collect anything

#

i want to see the users email when this happens

#

anda send him an email

stiff gate
#

Well you would have to collect the users email for it to be returned in the webhook

#

For some PaymentMethods it will indeed be collected via Payment Element for instance

floral meteor
#

i am

#

look

stiff gate
#

But not for cards as an example

#

How are you collecting it?

floral meteor
#

in here

stiff gate
#

Ahh okay so you are using Checkout

#

Sorry, when you said PaymentIntent I assumed you were using a custom flow

#

So the email is stored on the PaymentMethod's billing_details

floral meteor
#

using

#

checkou

#

t

#

in checkout i can't get the webhook thingy

stiff gate
#

Do you have an example PaymentIntent from your account that I can look at?

floral meteor
#

wdym

#

?

#
{
  "id": "evt_3MwPEzG89Ysy6SxP08ni4v6o",
  "object": "event",
  "api_version": "2022-11-15",
  "created": 1681388827,
  "data": {
    "object": {
      "id": "pi_3MwPEzG89Ysy6SxP03y4bIGz",
      "object": "payment_intent",
      "amount": 500,
      "amount_capturable": 0,
      "amount_details": {
        "tip": {
        }
      },
      "amount_received": 500,
      "application": null,
      "application_fee_amount": null,
      "automatic_payment_methods": null,
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "client_secret": "p",
      "confirmation_method": "automatic",
      "created": 1681388825,
      "currency": "usd",
      "customer": null,
      "description": null,
      "invoice": null,
      "last_payment_error": null,
      "latest_charge": "ch_3MwPEzG89Ysy6SxP0wupBFVL",
      "livemode": false,
      "metadata": {
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": "pm_1MwPEzG89Ysy6SxPPQMKwTTa",
      "payment_method_options": {
        "card": {
          "installments": null,
          "mandate_options": null,
          "network": null,
          "request_three_d_secure": "automatic"
        }
      },
      "payment_method_types": [
        "card"
      ],
      "processing": null,
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    }
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": "req_RSOU1QNI8sTPsa",
    "idempotency_key": "92d0a2b4-4945-47dc-9495-cc0f2f1237e8"
  },
  "type": "payment_intent.succeeded"
}
#

@stiff gate here

stiff gate
#

Thanks give me one sec to look

#

Okay yeah so you are using Stripe Checkout as I noted. That means the email is associated with the billing_details of the PaymentMethod. So you can either retrieve the PaymentIntent again when you receive the webhook and expand latest_charge (in which case you will see billing_details within payment_method_data or you can retrieve the PaymentMethod directly.

floral meteor
#

so

#

event.data.object.lates_charge?

#

thats jus treturning me this

#

@stiff gate ch_3MwPEzG89Ysy6SxP0wupBFVL

stiff gate
floral meteor
#

what do i use to return that

#

what do i give there

stiff gate
#

You want the event.data.object.id to retrieve the PaymentIntent. Then you use { expand: ['latest_charge'] }

floral meteor
stiff gate
#

Because custom fields are associated with the Checkout Session object

#

So you would want to listen for checkout_session.completed if you want custom fiels

floral meteor
#

this

stiff gate
#

To get custom fields?

floral meteor
#

yes

#

where is the value

#

checkout

#

?

#

@stiff gate this only runs when the checkout is succesfull right?

stiff gate
#

Not sure what you are referring to with "where is the value checkout"

#

And what only runs?

floral meteor
#

nvm that

stiff gate
#

The Webhook?

floral meteor
#

yes

#

i only get this when user pays

#

and i recieve the payment

#

@stiff gate ??????

stiff gate
#

I am helping multiple people at once, you will need to be patient.

#

Yes these webhooks will only fire after a Checkout Session is completed

floral meteor
#

right?

stiff gate
#

Yes

floral meteor
#

checkout.session.completed

#

this runs