pub struct CreateRefund {
pub payment_id: PaymentId,
pub amount: Option<Decimal>,
pub reason: Option<String>,
pub external_id: Option<String>,
pub idempotency_key: Option<String>,
pub notes: Option<String>,
}Expand description
Input for creating a refund
Fields§
§payment_id: PaymentIdPayment to refund
amount: Option<Decimal>Refund amount (defaults to full payment amount)
reason: Option<String>Reason for refund
external_id: Option<String>External refund ID
idempotency_key: Option<String>Idempotency key for safely retrying refund creation
notes: Option<String>Additional notes
Trait Implementations§
Source§impl Clone for CreateRefund
impl Clone for CreateRefund
Source§fn clone(&self) -> CreateRefund
fn clone(&self) -> CreateRefund
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateRefund
impl Debug for CreateRefund
Source§impl Default for CreateRefund
impl Default for CreateRefund
Source§fn default() -> CreateRefund
fn default() -> CreateRefund
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CreateRefund
impl<'de> Deserialize<'de> for CreateRefund
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateRefund, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateRefund, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CreateRefund
impl Serialize for CreateRefund
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Validate for CreateRefund
impl Validate for CreateRefund
Source§fn validate(&self) -> Result<(), CommerceError>
fn validate(&self) -> Result<(), CommerceError>
Validate a refund create request.
Requires a non-nil payment reference. The amount-specific rules
(positivity and not exceeding the remaining refundable balance) are
enforced against the live payment in Payment::validate_refund, which
is where the refund’s monetary semantics belong; this structural check
only guards the payment reference itself.
Auto Trait Implementations§
impl Freeze for CreateRefund
impl RefUnwindSafe for CreateRefund
impl Send for CreateRefund
impl Sync for CreateRefund
impl Unpin for CreateRefund
impl UnsafeUnpin for CreateRefund
impl UnwindSafe for CreateRefund
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more