pub struct PreviewCreditNote { /* private fields */ }
Expand description
Get a preview of a credit note without creating it.
Implementations§
Source§impl PreviewCreditNote
impl PreviewCreditNote
Sourcepub fn amount(self, amount: impl Into<i64>) -> Self
pub fn amount(self, amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the total amount of the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Sourcepub fn credit_amount(self, credit_amount: impl Into<i64>) -> Self
pub fn credit_amount(self, credit_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.
Sourcepub fn effective_at(self, effective_at: impl Into<Timestamp>) -> Self
pub fn effective_at(self, effective_at: impl Into<Timestamp>) -> Self
The date when this credit note is in effect.
Same as created
unless overwritten.
When defined, this value replaces the system-generated ‘Date of issue’ printed on the credit note PDF.
Sourcepub fn email_type(
self,
email_type: impl Into<PreviewCreditNoteEmailType>,
) -> Self
pub fn email_type( self, email_type: impl Into<PreviewCreditNoteEmailType>, ) -> Self
Type of email to send to the customer, one of credit_note
or none
and the default is credit_note
.
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 lines(self, lines: impl Into<Vec<PreviewCreditNoteLines>>) -> Self
pub fn lines(self, lines: impl Into<Vec<PreviewCreditNoteLines>>) -> Self
Line items that make up the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Sourcepub fn memo(self, memo: impl Into<String>) -> Self
pub fn memo(self, memo: impl Into<String>) -> Self
The credit note’s memo appears on the credit note PDF.
Sourcepub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
Individual keys can be unset by posting an empty value to them.
All keys can be unset by posting an empty value to metadata
.
Sourcepub fn out_of_band_amount(self, out_of_band_amount: impl Into<i64>) -> Self
pub fn out_of_band_amount(self, out_of_band_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
Sourcepub fn reason(self, reason: impl Into<CreditNoteReason>) -> Self
pub fn reason(self, reason: impl Into<CreditNoteReason>) -> Self
Reason for issuing this credit note, one of duplicate
, fraudulent
, order_change
, or product_unsatisfactory
.
Sourcepub fn refund_amount(self, refund_amount: impl Into<i64>) -> Self
pub fn refund_amount(self, refund_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
Sourcepub fn refunds(self, refunds: impl Into<Vec<CreditNoteRefundParams>>) -> Self
pub fn refunds(self, refunds: impl Into<Vec<CreditNoteRefundParams>>) -> Self
Refunds to link to this credit note.
Sourcepub fn shipping_cost(
self,
shipping_cost: impl Into<CreditNoteShippingCost>,
) -> Self
pub fn shipping_cost( self, shipping_cost: impl Into<CreditNoteShippingCost>, ) -> Self
When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Source§impl PreviewCreditNote
impl PreviewCreditNote
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 PreviewCreditNote
impl Clone for PreviewCreditNote
Source§fn clone(&self) -> PreviewCreditNote
fn clone(&self) -> PreviewCreditNote
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more