From 51e34d6fec2238d27e937f361d9e0b60f1bc564c Mon Sep 17 00:00:00 2001 From: Sean Pianka Date: Fri, 26 Apr 2024 13:36:23 -0400 Subject: [PATCH] feat(setup_intent): add mandate_data for confirm Signed-off-by: Sean Pianka --- src/resources/setup_intent_ext.rs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/resources/setup_intent_ext.rs b/src/resources/setup_intent_ext.rs index 7fdf31ef4..61e8fe8b8 100644 --- a/src/resources/setup_intent_ext.rs +++ b/src/resources/setup_intent_ext.rs @@ -2,26 +2,40 @@ use serde::Serialize; use crate::client::{Client, Response}; use crate::resources::SetupIntent; -use crate::{SetupIntentCancellationReason, SetupIntentId}; +use crate::{PaymentMethodId, SetupIntentCancellationReason, SetupIntentId}; /// The set of parameters that can be used when confirming a setup_intent object. /// /// For more details see #[derive(Clone, Debug, Serialize)] pub struct ConfirmSetupIntent { - /// The client secret if on the client side + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. #[serde(skip_serializing_if = "Option::is_none")] - pub client_secret: Option, + pub payment_method: Option, - /// Specifies which payment method + /// This hash contains details about the mandate to create #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, + pub mandate_data: Option, + + /// When included, this hash creates a PaymentMethod that is set as the payment_method value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option, + + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option, - // Mandate data and payment method options not implemented. If you want - // something better, create an issue and lets fix /// The URL to redirect your customer back to after they authenticate on the payment method’s app or site. #[serde(skip_serializing_if = "Option::is_none")] pub return_url: Option, + + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + pub use_stripe_sdk: bool, +} + +#[derive(Clone, Debug, Default, Serialize)] +pub struct MandateData { + pub customer_acceptance: crate::CustomerAcceptance, } /// The set of parameters that can be used when canceling a setup_intent object.