pub struct CancelPaymentIntent { /* private fields */ }
Expand description
You can cancel a PaymentIntent object when it’s in one of these statuses: requires_payment_method
, requires_capture
, requires_confirmation
, requires_action
or, in rare cases, processing
.
After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error.
For PaymentIntents with a status
of requires_capture
, the remaining amount_capturable
is automatically refunded.
You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead.
Implementations§
Source§impl CancelPaymentIntent
impl CancelPaymentIntent
Sourcepub fn new(intent: impl Into<PaymentIntentId>) -> Self
pub fn new(intent: impl Into<PaymentIntentId>) -> Self
Construct a new CancelPaymentIntent
.
Sourcepub fn cancellation_reason(
self,
cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>,
) -> Self
pub fn cancellation_reason( self, cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>, ) -> Self
Reason for canceling this PaymentIntent.
Possible values are: duplicate
, fraudulent
, requested_by_customer
, or abandoned
.
Source§impl CancelPaymentIntent
impl CancelPaymentIntent
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 CancelPaymentIntent
impl Clone for CancelPaymentIntent
Source§fn clone(&self) -> CancelPaymentIntent
fn clone(&self) -> CancelPaymentIntent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more