feat(connector): add authorize, capture, void, refund, psync, rsync support for Dlocal connector (#650)

Co-authored-by: Venkatesh <inventvenkat@gmail.com>
This commit is contained in:
Arjun Karthik
2023-02-25 19:43:40 +05:30
committed by GitHub
parent 6a487b195b
commit 7792de55ef
17 changed files with 1635 additions and 8 deletions

View File

@ -38,6 +38,7 @@ pub trait PaymentsRequestData {
fn get_billing(&self) -> Result<&api::Address, Error>;
fn get_billing_country(&self) -> Result<String, Error>;
fn get_billing_phone(&self) -> Result<&api::PhoneDetails, Error>;
fn get_billing_address(&self) -> Result<&api::AddressDetails, Error>;
fn get_card(&self) -> Result<api::Card, Error>;
fn get_return_url(&self) -> Result<String, Error>;
}
@ -79,6 +80,13 @@ impl PaymentsRequestData for types::PaymentsAuthorizeRouterData {
.and_then(|a| a.phone.as_ref())
.ok_or_else(missing_field_err("billing.phone"))
}
fn get_billing_address(&self) -> Result<&api::AddressDetails, Error> {
self.address
.billing
.as_ref()
.and_then(|a| a.address.as_ref())
.ok_or_else(missing_field_err("billing.address"))
}
fn get_billing(&self) -> Result<&api::Address, Error> {
self.address
.billing