pub struct PayInvoice { /* private fields */ }
Expand description
Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
Implementations§
Source§impl PayInvoice
impl PayInvoice
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn forgive(self, forgive: impl Into<bool>) -> Self
pub fn forgive(self, forgive: impl Into<bool>) -> Self
In cases where the source used to pay the invoice has insufficient funds, passing forgive=true
controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice.
This effectively forgives the difference between the amount available on the source and the amount due.
Passing forgive=false
will fail the charge if the source hasn’t been pre-funded with the right amount.
An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference.
Defaults to false
.
Sourcepub fn mandate(self, mandate: impl Into<String>) -> Self
pub fn mandate(self, mandate: impl Into<String>) -> Self
ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice’s default_payment_method or default_source, if set.
Sourcepub fn off_session(self, off_session: impl Into<bool>) -> Self
pub fn off_session(self, off_session: impl Into<bool>) -> Self
Indicates if a customer is on or off-session while an invoice payment is attempted.
Defaults to true
(off-session).
Sourcepub fn paid_out_of_band(self, paid_out_of_band: impl Into<bool>) -> Self
pub fn paid_out_of_band(self, paid_out_of_band: impl Into<bool>) -> Self
Boolean representing whether an invoice is paid outside of Stripe.
This will result in no charge being made.
Defaults to false
.
Sourcepub fn payment_method(self, payment_method: impl Into<String>) -> Self
pub fn payment_method(self, payment_method: impl Into<String>) -> Self
A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
Source§impl PayInvoice
impl PayInvoice
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response, blocking until completion.
Trait Implementations§
Source§impl Clone for PayInvoice
impl Clone for PayInvoice
Source§fn clone(&self) -> PayInvoice
fn clone(&self) -> PayInvoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more