pub struct ChargeRequest {
pub reference: String,
pub amount: Money,
pub channel: Channel,
pub expires_in: Duration,
pub customer: Customer,
pub description: String,
pub metadata: Json,
}Expand description
What to ask for.
Fields§
§reference: StringThe application’s own id for this charge — an order number, an invoice id. Sent to the gateway and echoed back in every event, which is how a webhook is matched to the thing it is about.
amount: Money§channel: Channel§expires_in: DurationHow long the customer has. After this the gateway expires the charge and says so by webhook.
customer: Customer§description: StringShown on the payment screen and the bank statement where the channel allows it.
metadata: JsonAnything the application wants back unchanged in the webhook.
Implementations§
Source§impl ChargeRequest
impl ChargeRequest
pub fn new( reference: impl Into<String>, amount: Money, channel: Channel, ) -> ChargeRequest
pub fn expires_in(self, duration: Duration) -> ChargeRequest
pub fn customer(self, customer: Customer) -> ChargeRequest
pub fn description(self, description: impl Into<String>) -> ChargeRequest
pub fn metadata(self, metadata: Json) -> ChargeRequest
Trait Implementations§
Source§impl Clone for ChargeRequest
impl Clone for ChargeRequest
Source§impl Debug for ChargeRequest
impl Debug for ChargeRequest
Source§impl PartialEq for ChargeRequest
impl PartialEq for ChargeRequest
impl StructuralPartialEq for ChargeRequest
Auto Trait Implementations§
impl Freeze for ChargeRequest
impl RefUnwindSafe for ChargeRequest
impl Send for ChargeRequest
impl Sync for ChargeRequest
impl Unpin for ChargeRequest
impl UnsafeUnpin for ChargeRequest
impl UnwindSafe for ChargeRequest
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