feat(connector) : [Globalpay]add mandates and bank redirects support for globalpay (#830)

Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
This commit is contained in:
chikke srujan
2023-04-11 17:46:01 +05:30
committed by GitHub
parent 6188d51579
commit ce912dd852
6 changed files with 206 additions and 78 deletions

View File

@ -145,6 +145,7 @@ pub trait PaymentsAuthorizeRequestData {
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>;
fn get_card(&self) -> Result<api::Card, Error>;
fn get_return_url(&self) -> Result<String, Error>;
fn is_mandate_payment(&self) -> bool;
fn get_webhook_url(&self) -> Result<String, Error>;
}
@ -171,6 +172,14 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData {
.clone()
.ok_or_else(missing_field_err("return_url"))
}
fn is_mandate_payment(&self) -> bool {
self.setup_mandate_details.is_some()
|| self
.mandate_id
.as_ref()
.and_then(|mandate_ids| mandate_ids.connector_mandate_id.as_ref())
.is_some()
}
fn get_webhook_url(&self) -> Result<String, Error> {
self.router_return_url
.clone()