#avneetsingh_11747

1 messages · Page 1 of 1 (latest)

red oasisBOT
full thunder
#

Sorry for the delay! Metadata can be set on a PaymentIntent or an underlying Charge object. You can make update calls after payment to update metadata on either of these objects

polar dagger
#

Thanks a lot man!

#

Also, please share some details on customer field. Looks like it is empty in my dashboard. Where does it come from?

red oasisBOT
full thunder
#

This may be populated with a customer email address or customer ID but only for successful payments or if a customer was passed when creating the PaymentIntent

polar dagger
#

We are using our own email API to send emails to customers. Can you please share documentation/example on how customer can be passed during payment intent creation. Thanks

pastel creek
#

Hello! I'm taking over and catching up...

polar dagger
#

Something like this?

String customerId = createCustomer("customer@example.com");
PaymentIntent paymentIntent = createPaymentIntent(1000, "usd", customerId);

pastel creek
#

No, you need to specify the customer property specifically. What language are you using?

polar dagger
#

java

pastel creek
#

For that you would need to use PaymentIntentCreateParams.builder() and then use .setCustomer(customerId).

polar dagger
#

Getting InvalidRequestException no such customer: 'test_customer'; resource_missing; request-id: req_vjDJL4TIsAALk5" with below code:

Stripe.apiKey = stripeSecret;
PaymentIntentCreateParams createParams = new PaymentIntentCreateParams.Builder()
.addPaymentMethodType("card")
.setAmount(request.getAmount())
.setCurrency(request.getCurrency())
.setCustomer("test_customer123")
.build();
RequestOptions requestOptions = RequestOptions.builder()
.setIdempotencyKey(UUID.randomUUID().toString())
.build();
PaymentIntent paymentIntent = PaymentIntent.create(createParams, requestOptions);

pastel creek
#

You need to specify a valid Customer ID. The string test_customer123 is not a valid Customer ID.

polar dagger
#

Even with a number, I am getting this:

"errors": [
{
"source": "com.stripe.exception.InvalidRequestException",
"errorCode": null,
"message": "No such customer: '1'; code: resource_missing; request-id: req_KsOr8zmy1OjBC3"
}
]

#

Please elaborate on a valid customer id

pastel creek