Skip to main content

PaymentsSender

Trait PaymentsSender 

Source
pub trait PaymentsSender:
    Send
    + Sync
    + 'static {
    // Required methods
    fn terminals(
        &self,
        query: PageQuery,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Page<Terminal>>> + Send;
    fn terminal(
        &self,
        terminal_id: String,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn put_terminal(
        &self,
        terminal_id: String,
        terminal: Terminal,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn patch_terminal(
        &self,
        terminal_id: String,
        patch: Patch<Terminal>,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn activate_terminal(
        &self,
        terminal: Patch<Terminal>,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn deactivate_terminal(
        &self,
        terminal_id: String,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Terminal>> + Send;
    fn financial_advice_confirmations(
        &self,
        query: PageQuery,
        context: RequestContext,
    ) -> impl Future<Output = Handled<Page<FinancialAdviceConfirmation>>> + Send;
    fn financial_advice_confirmation(
        &self,
        id: String,
        context: RequestContext,
    ) -> impl Future<Output = Handled<FinancialAdviceConfirmation>> + Send;
}
Available on crate feature server only.
Expand description

The PTP side of the Payments module: the terminals this Payment Terminal Provider owns.

Note the direction. In Payments the PTP is the Sender — it owns the Terminal objects — and the CPO drives them, which is why activation and location assignment are writes on this interface rather than pushes to the CPO.

Spec: 2.3.0 §mod_payments_ptp_interface

Required Methods§

Source

fn terminals( &self, query: PageQuery, context: RequestContext, ) -> impl Future<Output = Handled<Page<Terminal>>> + Send

GET {payments}/terminals — one page of Terminals.

Source

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

GET {payments}/terminals/{terminal_id}.

Source

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

PUT {payments}/terminals/{terminal_id} — the CPO updating a terminal’s location data.

Source

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

PATCH {payments}/terminals/{terminal_id}.

This PATCH should be used by the CPO to assign location ids and/or evse_uids to a terminal.

Source

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

POST {payments}/terminals/activate.

NOTE: The terminal_id is optional in the activation request as it will be set by the PTP. The cardinality for the remaining fields stays the same.

A Terminal without its terminal_id is not a Terminal, so the body arrives as a Patch — this crate’s type for “an OCPI object with fields left out”. Note that it is not a merge patch: this is a POST, nothing is being merged into anything, and the rule that a PATCH must carry last_updated deliberately does not apply. Read the fields with Patch::as_value; do not call Patch::apply.

Source

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

POST {payments}/terminals/{terminal_id}/deactivate.

Source

fn financial_advice_confirmations( &self, query: PageQuery, context: RequestContext, ) -> impl Future<Output = Handled<Page<FinancialAdviceConfirmation>>> + Send

GET {payments}/financial-advice-confirmations — one page.

Source

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

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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§