pub struct PricingPreview<'a> { /* private fields */ }
Expand description
Request builder for fetching transactions from Paddle API.
Implementations§
Source§impl<'a> PricingPreview<'a>
impl<'a> PricingPreview<'a>
pub fn new( client: &'a Paddle, items: impl IntoIterator<Item = PricePreviewItem>, ) -> Self
Sourcepub fn customer_id(&mut self, customer_id: impl Into<CustomerID>) -> &mut Self
pub fn customer_id(&mut self, customer_id: impl Into<CustomerID>) -> &mut Self
Paddle ID of the customer that this preview is for.
Sourcepub fn address_id(&mut self, address_id: impl Into<AddressID>) -> &mut Self
pub fn address_id(&mut self, address_id: impl Into<AddressID>) -> &mut Self
Paddle ID of the address that this preview is for.
Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Sourcepub fn business_id(&mut self, business_id: impl Into<BusinessID>) -> &mut Self
pub fn business_id(&mut self, business_id: impl Into<BusinessID>) -> &mut Self
Paddle ID of the business that this preview is for.
Sourcepub fn currency_code(&mut self, currency_code: CurrencyCode) -> &mut Self
pub fn currency_code(&mut self, currency_code: CurrencyCode) -> &mut Self
Supported three-letter ISO 4217 currency code.
Sourcepub fn discount_id(&mut self, discount_id: impl Into<DiscountID>) -> &mut Self
pub fn discount_id(&mut self, discount_id: impl Into<DiscountID>) -> &mut Self
Paddle ID of the discount applied to this preview
Sourcepub fn address(&mut self, address: AddressPreview) -> &mut Self
pub fn address(&mut self, address: AddressPreview) -> &mut Self
Address for this preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Sourcepub fn customer_ip_address(&mut self, ip: String) -> &mut Self
pub fn customer_ip_address(&mut self, ip: String) -> &mut Self
IP address for this transaction preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Sourcepub async fn send(&self) -> Result<SuccessResponse<PricingPreview>, Error>
pub async fn send(&self) -> Result<SuccessResponse<PricingPreview>, Error>
Send the request to Paddle and return the response.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PricingPreview<'a>
impl<'a> RefUnwindSafe for PricingPreview<'a>
impl<'a> Send for PricingPreview<'a>
impl<'a> Sync for PricingPreview<'a>
impl<'a> Unpin for PricingPreview<'a>
impl<'a> UnwindSafe for PricingPreview<'a>
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