pub struct SubscriptionOneTimeCharge<'a> { /* private fields */ }
Expand description
Request builder for creating a new one-time charge for a subscription.
Implementations§
Source§impl<'a> SubscriptionOneTimeCharge<'a>
impl<'a> SubscriptionOneTimeCharge<'a>
pub fn new( client: &'a Paddle, subscription_id: impl Into<SubscriptionID>, ) -> Self
Sourcepub fn effective_from(&mut self, effective_from: EffectiveFrom) -> &mut Self
pub fn effective_from(&mut self, effective_from: EffectiveFrom) -> &mut Self
When one-time charges should be billed.
Sourcepub fn items(
&mut self,
items: impl IntoIterator<Item = TransactionItem>,
) -> &mut Self
pub fn items( &mut self, items: impl IntoIterator<Item = TransactionItem>, ) -> &mut Self
List of one-time charges to bill for. Only prices where the billing_cycle
is null
may be added.
You can charge for items that you’ve added to your catalog by passing the Paddle ID of an existing price entity, or you can charge for non-catalog items by passing a price object.
Non-catalog items can be for existing products, or you can pass a product object as part of your price to charge for a non-catalog product.
Sourcepub fn on_payment_failure(
&mut self,
mode: SubscriptionOnPaymentFailure,
) -> &mut Self
pub fn on_payment_failure( &mut self, mode: SubscriptionOnPaymentFailure, ) -> &mut Self
How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to prevent_change
.
Sourcepub async fn send(&self) -> Result<SuccessResponse<Subscription>, Error>
pub async fn send(&self) -> Result<SuccessResponse<Subscription>, Error>
Send the request to Paddle and return the response.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SubscriptionOneTimeCharge<'a>
impl<'a> RefUnwindSafe for SubscriptionOneTimeCharge<'a>
impl<'a> Send for SubscriptionOneTimeCharge<'a>
impl<'a> Sync for SubscriptionOneTimeCharge<'a>
impl<'a> Unpin for SubscriptionOneTimeCharge<'a>
impl<'a> UnwindSafe for SubscriptionOneTimeCharge<'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