#fazil-payment-reconciliation

1 messages · Page 1 of 1 (latest)

agile lintelBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

quiet flower
#

elements.create('payment', ...)

ancient crow
#

with this
const paymentElement = elements.create('payment', {
paymentMethodOrder: ['apple_pay', 'google_pay', 'card', 'klarna']
});

#

?

quiet flower
#

yep!

#

layout is a sibling option to paymentMethodOrder

ancient crow
#

thanks

quiet flower
#

NP!

ancient crow
#

i have another question could you please assiste me wit this

quiet flower
#

Sure, what's that?

ancient crow
#

im sharing a response with you which is sent by stripe to webhook on the event payment.success

#

please makre sure read it asap so i can delete it

quiet flower
#

Don't share private info here, if it has anything sensitive redact it

#

Because even if deleted the message is public and might be recorded

ancient crow
#

{
"id": "evt_3OMYGILYxS9gopqX0ZRtHQN6",
"object": "event",
"api_version": "2023-08-16",
"created": 1702396370,
"data": {
"object": {
"id": "pi_3OMYGILYxS9gopqX0WLpfhh4",
"object": "payment_intent",
"amount": 525,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 525,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always",
"enabled": true
},
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3OMYGILYxS9gopqX0WLpfhh4_secret_GDjh1qKAwNu83C7lITxdni4ME",
"confirmation_method": "automatic",
"created": 1702396366,
"currency": "usd",
"customer": null,
"description": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "ch_3OMYGILYxS9gopqX0dwkaUmD",
"livemode": false,
"metadata": {
"campaign_slug": "lets-bless-nicole-and-give-thousands-an-education",
"company_tip": "0.25",
"is_display": "1",
"donation_amount": "5"
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1OMYGLLYxS9gopqXbseONOBs",
"payment_method_configuration_details": {
"id": "pmc_1OAVobLYxS9gopqXkqUmbKDl",
"parent": null
},
"payment_method_options": {
"acss_debit": {
"verification_method": "automatic"
},
"afterpay_clearpay": {
"reference": null
},

#

"alipay": {
},
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
},
"cashapp": {
},
"klarna": {
"preferred_locale": null
},
"link": {
"persistent_token": null
},
"us_bank_account": {
"financial_connections": {
"permissions": [
"payment_method"
],
"prefetch": [
]
},
"verification_method": "automatic"
},
"wechat_pay": {
"app_id": null,
"client": null
}
},
"payment_method_types": [
"card",
"acss_debit",
"afterpay_clearpay",
"alipay",
"klarna",
"link",
"us_bank_account",
"wechat_pay",
"cashapp"
],
"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_C7kOPJKZAj6PiF",
"idempotency_key": "456b1d1f-5ae2-47e4-a2c2-758ceb513fad"
},
"type": "payment_intent.succeeded"
}

#

ops i have shared

#

okay you can see the details now

#

ill delete it it

quiet flower
#

I don't see anything individual except perhaps the campaign name in your metadata

ancient crow
#

okay thats also not any major thing

quiet flower
#

Sure but what is your question?

ancient crow
#

this is response send by stripe to webhook.
i want to get the customer details who made this payment such as last 4 digits of bank. name and billing address

agile lintelBOT
ancient crow
#

hi @koopajah

ancient crow
#

payment method or payment intent ?

safe shoal
#

Wait why would you do that @quiet flower ?

ancient crow
#

as we allowed multiple payment methods

safe shoal
#

Isn't the right approach to look at the Charge's payment_method_details?

#

fazil-payment-reconciliation

ancient crow
#

i have allowed multiple payment methods

safe shoal
#

@ancient crow when a PaymentIntent is paid successfully you can look at its underlying Charge ch_123 and it will have the payment_method_details property that has details about the PaymentMethod being used like the type (card, us_bank_account, etc.) and for the relevant one information like last4 or bank and such

quiet flower
ancient crow
#

but as i shared complete response with you

#

im unable to see that details in the response

#

yeah i can se all these details in the stripe dashboard

#

im stuck in this part and its wasting my time please give me complete guide how i can do this

safe shoal
#

You dumped a payment_intent.succeeded Event. That is not the Charge object. It's the PaymentIntent object. That has latest_charge: 'ch_3OMYGILYxS9gopqX0dwkaUmD' and you can use that id to call https://stripe.com/docs/api/charges/retrieve

ancient crow
#

okay you means i need to get
latest_charge key first

safe shoal
#

yes

ancient crow
#

after doing this ill call this api

like this
$stripe->charges->retrieve(latest_charge , [])

#

than it will provide me the all details of customer

#

?

safe shoal
#

yes

#

well not details of the Customer. Details of the payment method they used

ancient crow
#

than how ill get the customer details?
the name and address

safe shoal
#

Pause and try please

ancient crow
#

okay thanks

#

finally i get what i actully want

#

now i can see the details thanks

#

i have another question almost related to this section

#

i want to get the email which is missin in billing address

safe shoal
#

It's missing because you didn't collect it

ancient crow
#

okay how i can get the email also

safe shoal
#

you have to collect it yourself in your own UI and then you can pass it when you call confirmPayment()

ancient crow
#

okay
here is the code
const {
error
} = await stripe.confirmPayment({
elements,
clientSecret,
confirmParams: {
return_url: retur_url,
},
});

safe shoal
#

Please read the docs and try first.

ancient crow
#

where i need to pass the email

ancient crow
safe shoal
#

Come on

#

I'm sorry but you're really pushy and not even trying for 2 minutes. Can you look at the docs yourself first and try to figure it out?

ancient crow
#

yeah because I've been working with Stripe for last 6 hours and now even I do not waste my 1 second

#

well thanks for your time

safe shoal
#

and now even I do not waste my 1 second
I mean I'm sorry but it's on you to read our docs and ask clear questions. We're happy to help and we have multiple times in this thread but we can't just give you every answer without you looking.
So please try to look at the confirmPayment() docs first and if you're stuck ask a question about it and I'll help you