Skip to content

Commit

Permalink
feat(setup_intent): add mandate_data for confirm
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Pianka <pianka@eml.cc>
  • Loading branch information
seanpianka committed Apr 26, 2024
1 parent a94ffb4 commit 51e34d6
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/resources/setup_intent_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://stripe.com/docs/api/setup_intents/confirm>
#[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<String>,
pub payment_method: Option<PaymentMethodId>,

/// Specifies which payment method
/// This hash contains details about the mandate to create
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method: Option<String>,
pub mandate_data: Option<MandateData>,

/// 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<crate::UpdatePaymentIntentPaymentMethodData>,

/// Payment method-specific configuration for this SetupIntent.
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method_options: Option<crate::UpdatePaymentIntentPaymentMethodOptions>,

// 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<String>,

/// 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.
Expand Down

0 comments on commit 51e34d6

Please sign in to comment.