#keremkusmezer-transfer-metadata
1 messages · Page 1 of 1 (latest)
return this.stripe.paymentIntents.create({
amount: amount,
currency: currency,
customer: customer.id,
description: ${orderDetailText} ${sellerUser.retrieveName()},
payment_method: paymentMethodId,
application_fee_amount: applicationFee,
transfer_data: {
destination: sellerUser.stripeConnectedAccountId,
},
receipt_email: buyerUser.email,
metadata: orderData,
});
that sets metadata on the PI itself but not on the resulting Transfer in that case. There's no way to automate this
only solution is to call https://stripe.com/docs/api/transfers/update after the PI creation to set the metadata on it
yes exactly, the question is how can i set metadata there ok great thx for the quick answer
i will investigate
Basically the PaymentIntent has a charges collection today in the response after successful confirmation. That has a Charge (or multiple after failures) in it and so you get the Transfer id by doing something like paymentIntent.charges.data[0].transfer if that makes sense