pub struct PaymentsClient<'a>(/* private fields */);client only.Expand description
The Payments module, from either side.
The PTP owns the objects, so the Sender methods are the ones a CPO calls to drive a
terminal, and the Receiver methods are the ones a PTP calls to seed the CPO’s copy. See
SenderEndpoint::payments_terminals
for how the module’s two endpoint URLs are resolved from one discovered payments endpoint.
Spec: 2.3.0 §mod_payments_payments_module
Implementations§
Source§impl<'a> PaymentsClient<'a>
impl<'a> PaymentsClient<'a>
Sourcepub const fn new(client: ModuleClient<'a>) -> Self
pub const fn new(client: ModuleClient<'a>) -> Self
Wraps a module client.
Sourcepub fn list_terminals(
&self,
query: PageQuery,
) -> Result<PageStream<'a, Terminal>, OcpiError>
pub fn list_terminals( &self, query: PageQuery, ) -> Result<PageStream<'a, Terminal>, OcpiError>
GET {payments}/terminals — every Terminal, paginated.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn put_terminal(
&self,
terminal: &Terminal,
) -> Result<Terminal, OcpiError>
pub async fn put_terminal( &self, terminal: &Terminal, ) -> Result<Terminal, OcpiError>
PUT {payments}/terminals/{terminal_id} — the CPO updating a terminal’s location data.
§Errors
Propagates validation, transport and OCPI-level errors.
Sourcepub async fn patch_terminal<T>(
&self,
terminal_id: &str,
patch: &Patch<T>,
) -> Result<Terminal, OcpiError>
pub async fn patch_terminal<T>( &self, terminal_id: &str, patch: &Patch<T>, ) -> Result<Terminal, OcpiError>
PATCH {payments}/terminals/{terminal_id} — assigning Locations or EVSEs.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn activate_terminal<T>(
&self,
terminal: &Patch<T>,
) -> Result<Terminal, OcpiError>
pub async fn activate_terminal<T>( &self, terminal: &Patch<T>, ) -> Result<Terminal, OcpiError>
Sourcepub async fn deactivate_terminal(
&self,
terminal_id: &str,
) -> Result<Terminal, OcpiError>
pub async fn deactivate_terminal( &self, terminal_id: &str, ) -> Result<Terminal, OcpiError>
POST {payments}/terminals/{terminal_id}/deactivate.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub fn list_financial_advice_confirmations(
&self,
query: PageQuery,
) -> Result<PageStream<'a, FinancialAdviceConfirmation>, OcpiError>
pub fn list_financial_advice_confirmations( &self, query: PageQuery, ) -> Result<PageStream<'a, FinancialAdviceConfirmation>, OcpiError>
GET {payments}/financial-advice-confirmations — paginated.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn financial_advice_confirmation(
&self,
id: &str,
) -> Result<FinancialAdviceConfirmation, OcpiError>
pub async fn financial_advice_confirmation( &self, id: &str, ) -> Result<FinancialAdviceConfirmation, OcpiError>
GET {payments}/financial-advice-confirmations/{id}.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn post_terminal_to_receiver(
&self,
terminal: &Terminal,
) -> Result<Terminal, OcpiError>
pub async fn post_terminal_to_receiver( &self, terminal: &Terminal, ) -> Result<Terminal, OcpiError>
POST {payments}/terminals on the CPO’s Receiver interface — the PTP creating a
terminal in the CPO’s system.
§Errors
Propagates validation, transport and OCPI-level errors.
Sourcepub async fn post_financial_advice_confirmation(
&self,
confirmation: &FinancialAdviceConfirmation,
) -> Result<FinancialAdviceConfirmation, OcpiError>
pub async fn post_financial_advice_confirmation( &self, confirmation: &FinancialAdviceConfirmation, ) -> Result<FinancialAdviceConfirmation, OcpiError>
POST {payments}/financial-advice-confirmations on the CPO’s Receiver interface.
§Errors
Propagates validation, transport and OCPI-level errors.
Trait Implementations§
Source§impl<'a> Clone for PaymentsClient<'a>
impl<'a> Clone for PaymentsClient<'a>
Source§fn clone(&self) -> PaymentsClient<'a>
fn clone(&self) -> PaymentsClient<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more