Skip to main content

PaymentsReceiver

Trait PaymentsReceiver 

Source
pub trait PaymentsReceiver:
    Send
    + Sync
    + 'static {
    // Required methods
    fn terminal(
        &self,
        terminal_id: String,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn post_terminal(
        &self,
        terminal: Terminal,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn financial_advice_confirmation(
        &self,
        id: String,
        context: RequestContext,
    ) -> impl Future<Output = Handled<FinancialAdviceConfirmation>> + Send;
    fn post_financial_advice_confirmation(
        &self,
        confirmation: FinancialAdviceConfirmation,
        context: RequestContext,
    ) -> impl Future<Output = Handled<FinancialAdviceConfirmation>> + Send;
}
Available on crate feature server only.
Expand description

The CPO side of the Payments module: the PTP’s terminals as the CPO stores them.

Unusually for OCPI, these are POSTs, not PUTs, and the URL carries no owning party:

The POST should be used by the PTP to create a newly shipped terminal on the CPO’s system.

Spec: 2.3.0 §mod_payments_cpo_interface

Required Methods§

Source

fn terminal( &self, terminal_id: String, context: RequestContext, ) -> impl Future<Output = Handled<Terminal>> + Send

GET {payments}/terminals/{terminal_id} — what the CPO has stored.

Source

fn post_terminal( &self, terminal: Terminal, context: RequestContext, ) -> impl Future<Output = Handled<Terminal>> + Send

POST {payments}/terminals — the PTP creating a terminal in the CPO’s system.

Source

fn financial_advice_confirmation( &self, id: String, context: RequestContext, ) -> impl Future<Output = Handled<FinancialAdviceConfirmation>> + Send

GET {payments}/financial-advice-confirmations/{id}.

Source

fn post_financial_advice_confirmation( &self, confirmation: FinancialAdviceConfirmation, context: RequestContext, ) -> impl Future<Output = Handled<FinancialAdviceConfirmation>> + Send

POST {payments}/financial-advice-confirmations.

The PTP has to make sure to use the same authorization reference as provided in the Commands.StartSession so that the CPO can properly map the financial advice to the session.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§