#umang-archcgi_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1284111230256287880
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- umang-archcgi_api, 22 hours ago, 9 messages
- umang-archcgi_api, 1 day ago, 12 messages
- umang-archcgi_api, 1 day ago, 8 messages
- umang-archcgi_api, 1 day ago, 14 messages
You'd set up a webhook to be notified when the payment succeeds, which will contain all related details
How do I set it up? Do you have any guide?
I am getting the paymentintent id and the shipping address correctly on confirmPayment(). But, the paymentintent.phone and paymentintent.receipt_email are null. I am trying to get the email and phone number after express checkout. I don't know how it can be done with webhook
null where? When are you looking them up? Are you setting them?
What's an example pi_xxx ID?
amount
:
9900
amount_details
:
{tip: {…}}
automatic_payment_methods
:
{allow_redirects: 'always', enabled: true}
canceled_at
:
null
cancellation_reason
:
null
capture_method
:
"automatic_async"
client_secret
:
"pi_3PyX2lHp1fshk1Zy1W7StPHy_secret_F8viVip3cGnJ3Y4qeUrMK265Z"
confirmation_method
:
"automatic"
created
:
1726224483
currency
:
"usd"
description
:
null
id
:
"pi_3PyX2lHp1fshk1Zy1W7StPHy"
last_payment_error
:
null
livemode
:
false
next_action
:
null
object
:
"payment_intent"
payment_method
:
"pm_1PyX2qHp1fshk1ZyGgBXur4R"
payment_method_configuration_details
:
{id: 'pmc_1PnFFkHp1fshk1ZyOidXAvYq', parent: null}
payment_method_types
:
(4) ['card', 'link', 'cashapp', 'amazon_pay']
processing
:
null
receipt_email
:
null
setup_future_usage
:
null
shipping
:
address
:
{city: 'Lansing', country: 'US', line1: '201 East Shiawassee Street', line2: null, postal_code: '48933', …}
carrier
:
null
name
:
"Sangitaben Bhalani"
phone
:
null
tracking_number
:
null
[[Prototype]]
:
Object
source
:
null
status
:
"succeeded"
Here is the paymentintent. I am getting the details from paymentintents
The pi_xxx ID please, not the full JSON
pi_3PyX2lHp1fshk1Zy1W7StPHy
Which field(s) are not what you expect?
You never set receipt_email on creation or confirmation so that seems expected:
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
stripe.shipping.phone is null and how can I get the user's email after confirmPayment?
Where do you think you pass those values? What's the code look like?
Because you passed shipping on confirmation, but not shipping[phone]: https://dashboard.stripe.com/test/logs/req_V1KEys00KFZtyO
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I am sharing my code here:
In JSX return:
<ExpressCheckoutElement onClick={handleexpressclick} onConfirm={handleexpresssubmit}
options={options} onShippingAddressChange={onShippingAddressChange}/>
In JS:
const handleexpressclick = async ({resolve}) => {
const options ={
emailRequired: true,
phoneNumberRequired: true,
shippingAddressRequired: true,
allowedShippingCountries: ['US'],
shippingRates: [
{
id: 'free-shipping',
displayName: 'Free shipping',
amount: 0,
deliveryEstimate: {
maximum: {unit: 'day', value: 7},
minimum: {unit: 'day', value: 4}
}
},
]
}
resolve(options)
}
const handleexpresssubmit = async () => {
const {error, paymentIntent} = await stripe.confirmPayment({
elements,
clientSecret,
confirmParams:{
return_url: ${process.env.NEXT_PUBLIC_DOMAIN}
},
redirect: "if_required"
})
if (error) {
console.error(error);
// handleError();
} else if (paymentIntent && paymentIntent.status === "succeeded") {
console.log(paymentIntent)
var userdetails = paymentIntent.shipping
}
}
I would guess that whichever wallet you're paying, looks like Link, with doesn't have a phone number set
Oh okay. I think phone number will be solved. But, how do I get the email that the user has entered?
It's set on the underlying Charge object that is created once the intent confirmation succeeds: https://docs.stripe.com/api/charges/object#charge_object-billing_details-email
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Which is why I suggested using webhooks, as you'll receive a charge.succeeded event with that info in
Okay. I will do so accordingly. Thanks