pub struct ChargeRequestBuilder { /* private fields */ }Expand description
Collects the parts of a ChargeRequest before it is checked.
Implementations§
Source§impl ChargeRequestBuilder
impl ChargeRequestBuilder
Sourcepub fn customer(self, customer: impl Into<Box<str>>) -> Self
pub fn customer(self, customer: impl Into<Box<str>>) -> Self
Names the payer in the provider’s own terms.
Sourcepub fn description(self, description: impl Into<Box<str>>) -> Self
pub fn description(self, description: impl Into<Box<str>>) -> Self
Sets the free text shown on statements or in the provider’s dashboard.
Sourcepub fn return_url(self, url: Url) -> Self
pub fn return_url(self, url: Url) -> Self
Sets where the provider should send the payer back to.
Sourcepub fn failure_url(self, url: Url) -> Self
pub fn failure_url(self, url: Url) -> Self
Sets where the provider should send the payer when it fails.
Only PayTR asks for a second address; everywhere else this is unused
and ChargeRequestBuilder::return_url serves for both outcomes.
Sourcepub fn buyer(self, buyer: Buyer) -> Self
pub fn buyer(self, buyer: Buyer) -> Self
Names the person paying, which some providers require.
Sourcepub fn billing_address(self, address: Address) -> Self
pub fn billing_address(self, address: Address) -> Self
Sets where to bill.
Sourcepub fn shipping_address(self, address: Address) -> Self
pub fn shipping_address(self, address: Address) -> Self
Sets where to ship, when that is somewhere else.
Sourcepub fn item(self, item: BasketItem) -> Self
pub fn item(self, item: BasketItem) -> Self
Adds one line to what is being paid for.
Sourcepub fn idempotency_key(self, key: IdempotencyKey) -> Self
pub fn idempotency_key(self, key: IdempotencyKey) -> Self
Sets the key that makes replaying this request safe.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds one key/value pair to hand to the provider.
Sourcepub fn build(self) -> Result<ChargeRequest, ChargeRequestError>
pub fn build(self) -> Result<ChargeRequest, ChargeRequestError>
Checks the request and produces it.
Trait Implementations§
Source§impl Clone for ChargeRequestBuilder
impl Clone for ChargeRequestBuilder
Source§fn clone(&self) -> ChargeRequestBuilder
fn clone(&self) -> ChargeRequestBuilder
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 moreAuto Trait Implementations§
impl Freeze for ChargeRequestBuilder
impl RefUnwindSafe for ChargeRequestBuilder
impl Send for ChargeRequestBuilder
impl Sync for ChargeRequestBuilder
impl Unpin for ChargeRequestBuilder
impl UnsafeUnpin for ChargeRequestBuilder
impl UnwindSafe for ChargeRequestBuilder
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