pub enum RefundReason {
Duplicate,
Fraudulent,
RequestedByCustomer,
Other(Box<str>),
}Expand description
What a merchant tells the provider the money went back for.
Not a label for the shop’s own use. Two of the five providers here have a
field for it that ends up in chargeback and reconciliation reporting —
Stripe’s reason, iyzico’s reason — and a fraudulent order refunded
without saying so has told them nothing, and cannot tell them later.
The three named ones are the intersection: Stripe documents exactly these
three, and iyzico’s four are these three plus its own OTHER. What each
adapter does with them, and with RefundReason::Other, is on that
adapter’s refund.
§Exhaustive, for the same reason Currency is
This is a value travelling out to a provider rather than one a caller reads back, and an adapter that met a reason it had no word for would quietly send none — which is the failure this type exists to prevent. Adding a variant is a breaking change, and it forces every adapter to say what it maps to.
Variants§
Duplicate
The same money was taken twice.
Fraudulent
The payment was not the cardholder’s.
RequestedByCustomer
The buyer asked for their money back.
Other(Box<str>)
Something else, in the caller’s own words.
A provider with a free-text field takes this; one with an enumeration
sends its own “other” value beside it, and one with neither drops it.
Which of the three a provider is, is on its refund.
Trait Implementations§
Source§impl Clone for RefundReason
impl Clone for RefundReason
Source§fn clone(&self) -> RefundReason
fn clone(&self) -> RefundReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more