#blackgriffen237

1 messages · Page 1 of 1 (latest)

mellow etherBOT
past river
acoustic harness
#

Hi, you can still mount the element as the doc, but don't call the confirmPayment

#

then it will just be there

past river
#

and it knows what payment element to load?

#

somehow?

acoustic harness
#

There is a step of mount

const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
#

That's where it will display the payment element in the HTML div with id = payment-element

past river
#

and that will be the user's payment element somehow?

acoustic harness
#

Not sure what you mean by user's payment element. It's a Payment Element, showed to your customer, but they won't be able to charge or anything unless you implement the confirm action

past river
#

i mean when i create a payment intent i set the customer on it

#

but i just want to show the customer's payment method

#

and allow them to change it if they want

acoustic harness
#

hmm that's a completely different question

#

You said "show the PaymentElement on a web page but not use it" so I thought you want to show the UI as a demo or something

past river
#

i thought paymentelements belonged to users

#

sorry

#

maybe becuase it goes to the stripe page to complete the payment intent, thats not something I can do ?

acoustic harness
#

So I think you mean payment method

#

Basically you want to show the Customer's current payment methods, and allow them to manage it without initializing any charge?

past river
#

yes

#

is that something i can do?

acoustic harness
#

You can do that but will need to build your own UI.

#

It's not that hard, in backend, you can call List PaymentMethod API on a Customer

#

then use the information got back from Stripe (ie. last 4 digit of the card) then pass back to your frontend

#

Then in frontend build an UI to display them

past river
#

theres no prebuilt thing to allow them to edit and stuff?

#

like change the expiration date or w/e

acoustic harness
#

There is one called Customer Portal actually! It includes a lot of other things tho