#geekymechanic
1 messages · Page 1 of 1 (latest)
That doc says to include the payment method ID instead of a Source if you are using the Payment Methods API (the pm_ ID is the ID of a PaymentMethod)
So I think you need to include payment_method='pm_1NSJfCAfoReX6TchfgQrVGdt' when creating this cloned customer
I'm currently at the token creation stage
Ohhh, I can't create a token because I'm using the Payment Methods API right? When saving a payment method through Checkout and SetupIntent, it uses this api?
So something like this : CustomerCreateParams params = CustomerCreateParams.builder() .setPaymentMethod(paymentMethod) .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount(connectedAccId).build();
I'm not sure about this part : ```Stripe.apiKey = "sk_test_51NSJBwPIICTqiIipza0yFUU7ay8cnfjMdRPb7b6WjmpW3Tfmiis5odw4VS4jrWe6uuURJQkv6ajT6GGMr9onAQQT00kz2P3ZjU";
PaymentIntentCreateParams params =
PaymentIntentCreateParams.builder()
.setAmount(999L)
.setCurrency("usd")
.addPaymentMethodType("card")
.setCustomer("{{CUSTOMER_ID}}")
.setPaymentMethod("{{CARD_ID}}")
.build();
RequestOptions requestOptions =
RequestOptions.builder().setStripeAccount("{{CONNECTED_ACCOUNT_ID}}").build();
PaymentIntent paymentIntent = PaymentIntent.create(params, requestOptions);```
Where do I get the CARD_ID, in the docs it says that the customers.create docs returns it, but the closest I can get to this is by getting the defaultSource object
What is the ID that you see in the defaultSource field?
I think you might have an easier time following the flow from this doc: https://stripe.com/docs/payments/payment-methods/connect
I think it is the slightly more recent flow and works a bit better with PaymentMethods
So cloning the payment method rather than the customers, are there different implications for this? Either invoice-wise or for refunds? (I'm using direct charges)
No big differences here. They both result in you having new separate PaymentMethod and Customer objects on the connect account
So they should behave the exact same
Okay thanks, I'll head on through this path instead