#cetnix2chicago_api

1 messages ยท Page 1 of 1 (latest)

granite furnaceBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1261346655421337733

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

foggy basin
#

Using in my backend following code:
`
var invoiceSettings = CustomerCreateParams.InvoiceSettings.builder().setDefaultPaymentMethod(pmId).build();
var createCustomerParams = CustomerCreateParams.builder()
.setEmail(email)
.setDescription(userId)
.setPaymentMethod(pmId)
.setInvoiceSettings(invoiceSettings)
.build();

    Customer customer = Customer.create(createCustomerParams);

`
But i was looking now for a API on your documentation for the "frontend" part where I can build the cus token or in this case the paymentMethod... I didnt found anything... I think this is deprecated, right?

silver lavaBOT
granite furnaceBOT
lucid sinew
#

Hi there ๐Ÿ‘‹
Customers still exist in our API:
https://docs.stripe.com/api/customers

I'm not entirely sure I'm grasping what you're asking in that last part, are you asking about how to collect the details from the customer to process a payment? Or are you trying to create Payment Methods that you can charge later? Or possibly something else?

foggy basin
#

I got the part where a user can pay for a product...

What I need now is to provide the functionallity, that a user can save their payment methods. As I remember, this case works following:

  • User provides his card information in frontend.
  • When its successfull, it creates a payment method id (token, secret, whatever)...
  • The frontend send this payment method id to backend.
  • Backend create a new "Customer" and attach this payment method to the "customer"

I think this is still the way...

Im not sure how can I do the first/second step (frontend part).
I was looking for an HTML example with JS, where the user can provide the details and this creates the payment method id.

foggy basin
lucid sinew
#

The process has changed a bit in recent years, you should use a Setup Intent to create and setup a Payment Method for future usage. You shouldn't create that Payment Method directly, nor directly attach it to the Customer anymore, that's all part of the Setup Intents's lifecycle and handled by the intent.

If you want to save the details while processing a payment, this is the best guide:
https://docs.stripe.com/payments/save-during-payment?platform=web&ui=embedded-form

If you want to save payment method details without processing a payment, then this is the best guide:
https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements

#

Each of those guides has three integration paths in them, one using hosted Checkout Sessions, one using embedded Checkout Sessions, and the last using our Payment Element which can be embedded on your page.

foggy basin
#

YES! That was I looking for .. the second page ! ๐Ÿ˜„

#

okay dont know this kind of sessions .. have to read it

#

it has been years ago I used stripe ๐Ÿ˜„

#

Thank you very much!

lucid sinew
#

Things will look a bit different then ๐Ÿ˜… but that guide does a good job walking through all the steps. If anything seems off or gives you trouble, feel free to let us know!

foggy basin
#

Thank you very much. Enjoy the weekend ๐Ÿ™‚