PaymentIntent::create `payment_method_types` does not send data in a correct format to stripe api.
kushwahashiv opened this issue · 1 comments
kushwahashiv commented
PaymentIntent::create payment_method_types does not send data in a correct format to stripe api.
when i send
async fn create_payment_intent(&self, input: NewPaymentIntent) -> Result<PaymentIntent, Error> {
let mut params = CreatePaymentIntent::new(input.amount, input.currency);
params.payment_method_types = vec![PaymentIntentMethodType::Card];
params.capture_method = input.capture_method
params.customer = input.customer_id;
params.source = input.source;
params.description = input.description;
params.shipping = input.shipping;
PaymentIntent::create(&self.client, params).await.map_err(From::from)
}
in above code params.payment_method_types
is of Vec<PaymentIntentMethodType>
type and when I assign vec![PaymentIntentMethodType::Card]
it sends on stripe side below
| POST /v1/payment_intents
{
"payment_method_types": {
"0": "card"
},
...
}
instead of
{
"payment_method_types": [
"card"
],
....
}
what I'm missing here?
/Shiv
kushwahashiv commented
I was missing confirm
attribute in the param.