pub struct PaymentSession {
pub payment_id: PaymentId,
pub provider: PaymentProvider,
pub provider_reference: ProviderReference,
pub merchant_reference: MerchantReference,
pub status: PaymentStatus,
pub next_action: Option<NextAction>,
}Expand description
Normalized payment creation response.
Fields§
§payment_id: PaymentIdPayRail payment ID.
provider: PaymentProviderProvider handling the payment.
provider_reference: ProviderReferenceProvider reference.
merchant_reference: MerchantReferenceMerchant reference.
status: PaymentStatusNormalized status.
next_action: Option<NextAction>Next required action.
Implementations§
Source§impl PaymentSession
impl PaymentSession
Sourcepub fn new(
provider: PaymentProvider,
provider_reference: ProviderReference,
merchant_reference: MerchantReference,
status: PaymentStatus,
next_action: Option<NextAction>,
) -> Result<Self, PaymentError>
pub fn new( provider: PaymentProvider, provider_reference: ProviderReference, merchant_reference: MerchantReference, status: PaymentStatus, next_action: Option<NextAction>, ) -> Result<Self, PaymentError>
Creates a normalized session with a generated PayRail payment ID.
§Errors
Returns an error if generated ID validation fails.
Sourcepub const fn payment_id(&self) -> &PaymentId
pub const fn payment_id(&self) -> &PaymentId
Returns the PayRail payment ID.
Sourcepub const fn provider(&self) -> &PaymentProvider
pub const fn provider(&self) -> &PaymentProvider
Returns the provider handling the payment.
Sourcepub const fn provider_reference(&self) -> &ProviderReference
pub const fn provider_reference(&self) -> &ProviderReference
Returns the provider reference.
Sourcepub const fn merchant_reference(&self) -> &MerchantReference
pub const fn merchant_reference(&self) -> &MerchantReference
Returns the merchant reference.
Sourcepub const fn status(&self) -> PaymentStatus
pub const fn status(&self) -> PaymentStatus
Returns the normalized status.
Sourcepub const fn next_action(&self) -> Option<&NextAction>
pub const fn next_action(&self) -> Option<&NextAction>
Returns the next required action.
Trait Implementations§
Source§impl Clone for PaymentSession
impl Clone for PaymentSession
Source§fn clone(&self) -> PaymentSession
fn clone(&self) -> PaymentSession
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 moreSource§impl Debug for PaymentSession
impl Debug for PaymentSession
Source§impl PartialEq for PaymentSession
impl PartialEq for PaymentSession
Source§fn eq(&self, other: &PaymentSession) -> bool
fn eq(&self, other: &PaymentSession) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PaymentSession
impl StructuralPartialEq for PaymentSession
Auto Trait Implementations§
impl Freeze for PaymentSession
impl RefUnwindSafe for PaymentSession
impl Send for PaymentSession
impl Sync for PaymentSession
impl Unpin for PaymentSession
impl UnsafeUnpin for PaymentSession
impl UnwindSafe for PaymentSession
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