#arturs-email-phone-name

1 messages · Page 1 of 1 (latest)

molten plover
#

Hi there

#

Why exactly do you want the email/name/phone on the Charges object specifically?

buoyant obsidian
#

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

molten plover
#

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

buoyant obsidian
#

Check this screen, there is email , phone, name

#

He asks to make the same logic

molten plover
#

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?

buoyant obsidian
#

_ = 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 ?

molten plover
#

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?

buoyant obsidian
#

stripe.PaymentIntent.create
stripe.PaymentIntent.confirm

molten plover
#

Can you show me your full stripe.PaymentIntent.confirm request?

buoyant obsidian
#

intent = stripe.PaymentIntent.confirm(
args.payment_intent_id,
api_key=api_key,
)

molten plover
#

Okay and your create request?

#

Sounds like you already have the PaymentMethod here server-side.

#

How was the Paymentmethod created?

buoyant obsidian
#

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,
},

molten plover
#

Yep great. So how did you create args.payment_method_id

buoyant obsidian
#

payment method comes from iOS Stripe SDK

molten plover
#

Ah okay that's helpful. One sec

buoyant obsidian
#

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,
)

molten plover
#

So in your STPPaymentMethodParams you can pass billingDetails

buoyant obsidian
#

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 🙂

molten plover
#

Yeah that would be the other way

#

If you didn't want to collect it client-side

buoyant obsidian
#

Thank you for help