#arturs-email-phone-name
1 messages · Page 1 of 1 (latest)
Hi there
Why exactly do you want the email/name/phone on the Charges object specifically?
Currently I see there None
I want to pass there email / phone / name
Where I need to pass them
stripe.PaymentIntent.create dont have billing details field
In other words when in Python SDK call I need to make to add email / phone / name in PaymentIntent object
Or add it later somewhere
Sorry, one sec.
Let's back up
As noted, why do you want it specifically on the Charge object?
This isn't really possible if you are using PaymentIntents
Having the name/email/phone on the Charge object is a legacy path
Your client passed to me this screen http://joxi.ru/zANwv9aFwJpRwr
сделан при помощи Joxi.net
Check this screen, there is email , phone, name
He asks to make the same logic
Ah okay sorry. I think I misunderstood the ask initially. Those properties come from the PaymentMethod's billing details.
Are you confirming the PaymentIntent using Stripe.JS?
_ = stripe.PaymentMethod.modify(
intent['payment_method'],
metadata={'charged': True},
api_key=api_key,
billing_details={
'email': g.user.email,
'name': g.user.name,
'phone': f'{g.user.phone_prefix}{g.user.phone}',
},
)
Will this help ?
I tried this and still in all other payments I do not see email / phone / name.
I need to modify this payment method before I create PaymentIntent ?
Yeah for it to show on the Charge it would need to be before the Charge is created. However, you can do this at time of Charge if you are confirming client-side. Which integration are you using? Payment Element? Card Element?
stripe.PaymentIntent.create
stripe.PaymentIntent.confirm
Can you show me your full stripe.PaymentIntent.confirm request?
intent = stripe.PaymentIntent.confirm(
args.payment_intent_id,
api_key=api_key,
)
Okay and your create request?
Sounds like you already have the PaymentMethod here server-side.
How was the Paymentmethod created?
intent = stripe.PaymentIntent.create(
api_key=api_key,
payment_method=args.payment_method_id,
amount=args.amount,
currency=currency_code.lower(),
capture_method='automatic',
confirmation_method='manual',
save_payment_method=True, # I do not see this in https://stripe.com/docs/api/payment_intents
setup_future_usage='off_session',
confirm=True,
customer=g.user.stripe_customer_id,
use_stripe_sdk=True,
return_url=STRIPE_RETURN_URL,
metadata=metadata,
description=PAYMENT_DESCRIPTION,
application_fee_amount=stripe_calculate_application_fee(amount=args.amount),
transfer_data={
'destination': STRIPE_CONNECTED_ACCOUNT_ID,
},
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yep great. So how did you create args.payment_method_id
Ah okay that's helpful. One sec
Before I do payment intent I recheck if this payment method still exist:
payment_method = stripe.PaymentMethod.retrieve(
args.payment_method_id,
api_key=api_key,
)
So in your STPPaymentMethodParams you can pass billingDetails
I tried to add this before payment intend in python:
_ = stripe.PaymentMethod.modify(
args.payment_method_id,
api_key=api_key,
billing_details={
'email': g.user.email,
'name': g.user.name,
'phone': f'{g.user.phone_prefix}{g.user.phone}',
},
)
and it helped 🙂
Thank you for help