payway 0.1.0

Unofficial Rust SDK for ABA PayWay Payment Gateway
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Pre-auth API Operations

use crate::client::PayWayClient;
use crate::constants::endpoint;
use crate::error::Result;
use crate::types::{CompletePreAuthRequest, CompletePreAuthResponse};

impl PayWayClient {
    pub async fn complete_preauth(
        &self,
        tran_id: impl Into<String>,
        complete_amount: f64,
    ) -> Result<CompletePreAuthResponse> {
        let request = CompletePreAuthRequest::new(self, tran_id, complete_amount).await?;
        self.post(endpoint::PRE_AUTH_COMPLETE, &request).await
    }
}