Closed kushwahashiv closed 2 years ago
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
params.payment_method_types
Vec<PaymentIntentMethodType>
vec![PaymentIntentMethodType::Card]
| POST /v1/payment_intents
{ "payment_method_types": { "0": "card" }, ... }
instead of
{ "payment_method_types": [ "card" ], .... }
what I'm missing here?
/Shiv
I was missing confirm attribute in the param.
confirm
PaymentIntent::create payment_method_types does not send data in a correct format to stripe api.
when i send
in above code
params.payment_method_types
is ofVec<PaymentIntentMethodType>
type and when I assignvec![PaymentIntentMethodType::Card]
it sends on stripe side below| POST /v1/payment_intents
instead of
what I'm missing here?
/Shiv