diff --git a/src/resources/charge.rs b/src/resources/charge.rs index b77bec80..2be17d39 100644 --- a/src/resources/charge.rs +++ b/src/resources/charge.rs @@ -621,3 +621,9 @@ pub struct TransferDataParams { pub destination: String, } + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TransferDataUpdateParams { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} diff --git a/src/resources/payment_intent.rs b/src/resources/payment_intent.rs index f9ac5b8a..f733db73 100644 --- a/src/resources/payment_intent.rs +++ b/src/resources/payment_intent.rs @@ -5,6 +5,7 @@ use crate::resources::{ Account, Application, Charge, Currency, Customer, Invoice, PaymentIntentOffSession, PaymentMethod, PaymentSource, Review, Shipping, TransferDataParams, }; +use crate::TransferDataUpdateParams; use serde_derive::{Deserialize, Serialize}; /// The resource representing a Stripe "PaymentIntent". @@ -480,6 +481,8 @@ pub struct PaymentIntentUpdateParams<'a> { pub source: Option<&'a str>, #[serde(skip_serializing_if = "Option::is_none")] pub transfer_group: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, } /// The set of parameters that can be used when confirming a payment_intent object. diff --git a/src/resources/setup_intent.rs b/src/resources/setup_intent.rs index 0251665f..2772831e 100644 --- a/src/resources/setup_intent.rs +++ b/src/resources/setup_intent.rs @@ -266,24 +266,19 @@ pub struct CreateSetupIntent<'a> { /// If this hash is populated, this SetupIntent will generate a single_use Mandate on success. #[serde(skip_serializing_if = "Option::is_none")] pub single_use: Option, + + /// Indicates how the payment method is intended to be used in the future. + /// + /// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. + /// + /// Use `off_session` if your customer may or may not be in your checkout flow. + /// If not provided, this value defaults to `off_session`. + pub usage: String, } impl<'a> CreateSetupIntent<'a> { pub fn new() -> Self { - CreateSetupIntent { - confirm: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - mandate_data: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_method: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - return_url: Default::default(), - single_use: Default::default(), - } + CreateSetupIntent { ..Default::default() } } }