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 <[email protected]>
  • Loading branch information
seanpianka committed Apr 26, 2024
1 parent a94ffb4 commit dbb042e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/resources/setup_intent_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@ 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
/// The client secret if on the client side, this is not supported otherwise.
#[serde(skip_serializing_if = "Option::is_none")]
pub client_secret: Option<String>,

/// Specifies which payment method
/// Specifies which payment method by ID
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method: Option<String>,
pub payment_method: Option<PaymentMethodId>,

#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_data: Option<MandateData>,

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

#[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.
///
/// For more details see <https://stripe.com/docs/api/setup_intents/cancel>
Expand Down

0 comments on commit dbb042e

Please sign in to comment.