Struct OneTimeDonationsClient
pub struct OneTimeDonationsClient<T> { /* private fields */ }Expand description
Service for making one-time donation payments (boost and gift)
Configuration for one-time donations can be found in ProductConfiguration.
Implementations§
§impl<T> OneTimeDonationsClient<T>
impl<T> OneTimeDonationsClient<T>
pub fn new(inner: T) -> OneTimeDonationsClient<T>
pub fn with_origin(inner: T, origin: Uri) -> OneTimeDonationsClient<T>
pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> OneTimeDonationsClient<InterceptedService<T, F>>
pub fn send_compressed(
self,
encoding: CompressionEncoding,
) -> OneTimeDonationsClient<T>
pub fn send_compressed( self, encoding: CompressionEncoding, ) -> OneTimeDonationsClient<T>
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
pub fn accept_compressed(
self,
encoding: CompressionEncoding,
) -> OneTimeDonationsClient<T>
pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> OneTimeDonationsClient<T>
Enable decompressing responses.
pub fn max_decoding_message_size(
self,
limit: usize,
) -> OneTimeDonationsClient<T>
pub fn max_decoding_message_size( self, limit: usize, ) -> OneTimeDonationsClient<T>
Limits the maximum size of a decoded message.
Default: 4MB
pub fn max_encoding_message_size(
self,
limit: usize,
) -> OneTimeDonationsClient<T>
pub fn max_encoding_message_size( self, limit: usize, ) -> OneTimeDonationsClient<T>
Limits the maximum size of an encoded message.
Default: usize::MAX
pub async fn create_stripe_boost(
&mut self,
request: impl IntoRequest<CreateStripeBoostRequest>,
) -> Result<Response<CreateStripeBoostResponse>, Status>
pub async fn create_stripe_boost( &mut self, request: impl IntoRequest<CreateStripeBoostRequest>, ) -> Result<Response<CreateStripeBoostResponse>, Status>
Create a Stripe payment intent and return a client secret that can be used to complete the payment. Once the payment is complete, the paymentIntentId can be used with CreateBoostReceiptCredential
pub async fn create_pay_pal_boost(
&mut self,
request: impl IntoRequest<CreatePayPalBoostRequest>,
) -> Result<Response<CreatePayPalBoostResponse>, Status>
pub async fn create_pay_pal_boost( &mut self, request: impl IntoRequest<CreatePayPalBoostRequest>, ) -> Result<Response<CreatePayPalBoostResponse>, Status>
Create a PayPal one-time payment.
Once the payment is complete, call ConfirmPayPalBoost with the payment ID and token.
The PayPal approval page presented to the user may be localized. Callers should set their language preferences via an “Accept-Language” header on the request: https://datatracker.ietf.org/doc/html/rfc3282#section-3
pub async fn confirm_pay_pal_boost(
&mut self,
request: impl IntoRequest<ConfirmPayPalBoostRequest>,
) -> Result<Response<ConfirmPayPalBoostResponse>, Status>
pub async fn confirm_pay_pal_boost( &mut self, request: impl IntoRequest<ConfirmPayPalBoostRequest>, ) -> Result<Response<ConfirmPayPalBoostResponse>, Status>
Confirm a PayPal one-time payment
pub async fn create_boost_receipt_credential(
&mut self,
request: impl IntoRequest<CreateBoostReceiptCredentialRequest>,
) -> Result<Response<CreateBoostReceiptCredentialResponse>, Status>
pub async fn create_boost_receipt_credential( &mut self, request: impl IntoRequest<CreateBoostReceiptCredentialRequest>, ) -> Result<Response<CreateBoostReceiptCredentialResponse>, Status>
Obtain a ZK receipt credential for a completed one-time donation payment. The receipt credential can then be used to redeem the one-time donation entitlement via Donations.RedeemReceipt
Trait Implementations§
§impl<T> Clone for OneTimeDonationsClient<T>where
T: Clone,
impl<T> Clone for OneTimeDonationsClient<T>where
T: Clone,
§fn clone(&self) -> OneTimeDonationsClient<T>
fn clone(&self) -> OneTimeDonationsClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for OneTimeDonationsClient<T>
impl<T> RefUnwindSafe for OneTimeDonationsClient<T>where
T: RefUnwindSafe,
impl<T> Send for OneTimeDonationsClient<T>where
T: Send,
impl<T> Sync for OneTimeDonationsClient<T>where
T: Sync,
impl<T> Unpin for OneTimeDonationsClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for OneTimeDonationsClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OneTimeDonationsClient<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].