mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat(connector): [BILLWERK, FISERVEMEA, TSYS] add in feature matrix api (#7165)
Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local> Co-authored-by: Anurag Singh <anurag.singh.001@AnuragSMHJ5619X.lan> Co-authored-by: AkshayaFoiger <131388445+AkshayaFoiger@users.noreply.github.com>
This commit is contained in:
@ -2,6 +2,7 @@ pub mod transformers;
|
||||
|
||||
use api_models::webhooks::{IncomingWebhookEvent, ObjectReferenceId};
|
||||
use base64::Engine;
|
||||
use common_enums::enums;
|
||||
use common_utils::{
|
||||
consts::BASE64_ENGINE,
|
||||
errors::CustomResult,
|
||||
@ -22,7 +23,10 @@ use hyperswitch_domain_models::{
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
|
||||
RefundsData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::{PaymentsResponseData, RefundsResponseData},
|
||||
router_response_types::{
|
||||
ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
|
||||
SupportedPaymentMethods, SupportedPaymentMethodsExt,
|
||||
},
|
||||
types::{
|
||||
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
|
||||
PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData, TokenizationRouterData,
|
||||
@ -40,6 +44,7 @@ use hyperswitch_interfaces::{
|
||||
types::{self, Response},
|
||||
webhooks::{IncomingWebhook, IncomingWebhookRequestDetails},
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
use masking::{Mask, PeekInterface};
|
||||
use transformers::{
|
||||
self as billwerk, BillwerkAuthType, BillwerkCaptureRequest, BillwerkErrorResponse,
|
||||
@ -50,7 +55,7 @@ use transformers::{
|
||||
use crate::{
|
||||
constants::headers,
|
||||
types::ResponseRouterData,
|
||||
utils::{construct_not_implemented_error_report, convert_amount, RefundsRequestData},
|
||||
utils::{convert_amount, RefundsRequestData},
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -153,25 +158,7 @@ impl ConnectorCommon for Billwerk {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorValidation for Billwerk {
|
||||
fn validate_connector_against_payment_request(
|
||||
&self,
|
||||
capture_method: Option<common_enums::CaptureMethod>,
|
||||
_payment_method: common_enums::PaymentMethod,
|
||||
_pmt: Option<common_enums::PaymentMethodType>,
|
||||
) -> CustomResult<(), errors::ConnectorError> {
|
||||
let capture_method = capture_method.unwrap_or_default();
|
||||
match capture_method {
|
||||
common_enums::CaptureMethod::Automatic
|
||||
| common_enums::CaptureMethod::Manual
|
||||
| common_enums::CaptureMethod::SequentialAutomatic => Ok(()),
|
||||
common_enums::CaptureMethod::ManualMultiple
|
||||
| common_enums::CaptureMethod::Scheduled => Err(
|
||||
construct_not_implemented_error_report(capture_method, self.id()),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl ConnectorValidation for Billwerk {}
|
||||
|
||||
impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Billwerk {
|
||||
//TODO: implement sessions flow
|
||||
@ -818,4 +805,88 @@ impl IncomingWebhook for Billwerk {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Billwerk {}
|
||||
lazy_static! {
|
||||
static ref BILLWERK_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
|
||||
let supported_capture_methods = vec![
|
||||
enums::CaptureMethod::Automatic,
|
||||
enums::CaptureMethod::Manual,
|
||||
enums::CaptureMethod::SequentialAutomatic,
|
||||
];
|
||||
|
||||
let supported_card_network = vec![
|
||||
common_enums::CardNetwork::Mastercard,
|
||||
common_enums::CardNetwork::Visa,
|
||||
common_enums::CardNetwork::AmericanExpress,
|
||||
common_enums::CardNetwork::Discover,
|
||||
common_enums::CardNetwork::JCB,
|
||||
common_enums::CardNetwork::UnionPay,
|
||||
common_enums::CardNetwork::DinersClub,
|
||||
common_enums::CardNetwork::Interac,
|
||||
common_enums::CardNetwork::CartesBancaires,
|
||||
];
|
||||
|
||||
let mut billwerk_supported_payment_methods = SupportedPaymentMethods::new();
|
||||
|
||||
billwerk_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Credit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
billwerk_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Debit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
billwerk_supported_payment_methods
|
||||
};
|
||||
|
||||
static ref BILLWERK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
|
||||
display_name: "Billwerk",
|
||||
description: "Billwerk+ Pay is an acquirer independent payment gateway that's easy to setup with more than 50 recurring and non-recurring payment methods.",
|
||||
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
|
||||
};
|
||||
|
||||
static ref BILLWERK_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Billwerk {
|
||||
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
|
||||
Some(&*BILLWERK_CONNECTOR_INFO)
|
||||
}
|
||||
|
||||
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
|
||||
Some(&*BILLWERK_SUPPORTED_PAYMENT_METHODS)
|
||||
}
|
||||
|
||||
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
|
||||
Some(&*BILLWERK_SUPPORTED_WEBHOOK_FLOWS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,10 @@ use hyperswitch_domain_models::{
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
|
||||
RefundsData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::{PaymentsResponseData, RefundsResponseData},
|
||||
router_response_types::{
|
||||
ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
|
||||
SupportedPaymentMethods, SupportedPaymentMethodsExt,
|
||||
},
|
||||
types::{
|
||||
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
|
||||
PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
|
||||
@ -38,6 +41,7 @@ use hyperswitch_interfaces::{
|
||||
types::{self, Response},
|
||||
webhooks,
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
use masking::{ExposeInterface, Mask, PeekInterface};
|
||||
use ring::hmac;
|
||||
use time::OffsetDateTime;
|
||||
@ -249,24 +253,7 @@ impl ConnectorCommon for Fiservemea {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorValidation for Fiservemea {
|
||||
fn validate_connector_against_payment_request(
|
||||
&self,
|
||||
capture_method: Option<enums::CaptureMethod>,
|
||||
_payment_method: enums::PaymentMethod,
|
||||
_pmt: Option<enums::PaymentMethodType>,
|
||||
) -> CustomResult<(), errors::ConnectorError> {
|
||||
let capture_method = capture_method.unwrap_or_default();
|
||||
match capture_method {
|
||||
enums::CaptureMethod::Automatic
|
||||
| enums::CaptureMethod::Manual
|
||||
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
|
||||
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
|
||||
utils::construct_not_implemented_error_report(capture_method, self.id()),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl ConnectorValidation for Fiservemea {}
|
||||
|
||||
impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Fiservemea {
|
||||
fn get_headers(
|
||||
@ -791,4 +778,88 @@ impl webhooks::IncomingWebhook for Fiservemea {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Fiservemea {}
|
||||
lazy_static! {
|
||||
static ref FISERVEMEA_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
|
||||
let supported_capture_methods = vec![
|
||||
enums::CaptureMethod::Automatic,
|
||||
enums::CaptureMethod::Manual,
|
||||
enums::CaptureMethod::SequentialAutomatic,
|
||||
];
|
||||
|
||||
let supported_card_network = vec![
|
||||
common_enums::CardNetwork::Mastercard,
|
||||
common_enums::CardNetwork::Visa,
|
||||
common_enums::CardNetwork::AmericanExpress,
|
||||
common_enums::CardNetwork::Discover,
|
||||
common_enums::CardNetwork::JCB,
|
||||
common_enums::CardNetwork::UnionPay,
|
||||
common_enums::CardNetwork::DinersClub,
|
||||
common_enums::CardNetwork::Interac,
|
||||
common_enums::CardNetwork::CartesBancaires,
|
||||
];
|
||||
|
||||
let mut fiservemea_supported_payment_methods = SupportedPaymentMethods::new();
|
||||
|
||||
fiservemea_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Credit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
fiservemea_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Debit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
fiservemea_supported_payment_methods
|
||||
};
|
||||
|
||||
static ref FISERVEMEA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
|
||||
display_name: "Fiservemea",
|
||||
description: "Fiserv powers over 6+ million merchants and 10,000+ financial institutions enabling them to accept billions of payments a year.",
|
||||
connector_type: enums::PaymentConnectorCategory::BankAcquirer,
|
||||
};
|
||||
|
||||
static ref FISERVEMEA_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Fiservemea {
|
||||
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
|
||||
Some(&*FISERVEMEA_CONNECTOR_INFO)
|
||||
}
|
||||
|
||||
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
|
||||
Some(&*FISERVEMEA_SUPPORTED_PAYMENT_METHODS)
|
||||
}
|
||||
|
||||
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
|
||||
Some(&*FISERVEMEA_SUPPORTED_WEBHOOK_FLOWS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,10 @@ use hyperswitch_domain_models::{
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
|
||||
RefundsData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::{PaymentsResponseData, RefundsResponseData},
|
||||
router_response_types::{
|
||||
ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
|
||||
SupportedPaymentMethods, SupportedPaymentMethodsExt,
|
||||
},
|
||||
types::{
|
||||
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
|
||||
PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
|
||||
@ -40,6 +43,7 @@ use hyperswitch_interfaces::{
|
||||
},
|
||||
webhooks,
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
use transformers as tsys;
|
||||
|
||||
use crate::{constants::headers, types::ResponseRouterData, utils};
|
||||
@ -104,24 +108,7 @@ impl ConnectorCommon for Tsys {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorValidation for Tsys {
|
||||
fn validate_connector_against_payment_request(
|
||||
&self,
|
||||
capture_method: Option<enums::CaptureMethod>,
|
||||
_payment_method: enums::PaymentMethod,
|
||||
_pmt: Option<enums::PaymentMethodType>,
|
||||
) -> CustomResult<(), errors::ConnectorError> {
|
||||
let capture_method = capture_method.unwrap_or_default();
|
||||
match capture_method {
|
||||
enums::CaptureMethod::Automatic
|
||||
| enums::CaptureMethod::Manual
|
||||
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
|
||||
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
|
||||
utils::construct_not_supported_error_report(capture_method, self.id()),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl ConnectorValidation for Tsys {}
|
||||
|
||||
impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Tsys {}
|
||||
|
||||
@ -658,4 +645,85 @@ impl webhooks::IncomingWebhook for Tsys {
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Tsys {}
|
||||
lazy_static! {
|
||||
static ref TSYS_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
|
||||
let supported_capture_methods = vec![
|
||||
enums::CaptureMethod::Automatic,
|
||||
enums::CaptureMethod::Manual,
|
||||
enums::CaptureMethod::SequentialAutomatic,
|
||||
];
|
||||
|
||||
let supported_card_network = vec![
|
||||
common_enums::CardNetwork::Mastercard,
|
||||
common_enums::CardNetwork::Visa,
|
||||
common_enums::CardNetwork::AmericanExpress,
|
||||
common_enums::CardNetwork::Discover,
|
||||
common_enums::CardNetwork::JCB,
|
||||
common_enums::CardNetwork::UnionPay,
|
||||
];
|
||||
|
||||
let mut tsys_supported_payment_methods = SupportedPaymentMethods::new();
|
||||
|
||||
tsys_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Credit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
tsys_supported_payment_methods.add(
|
||||
enums::PaymentMethod::Card,
|
||||
enums::PaymentMethodType::Debit,
|
||||
PaymentMethodDetails{
|
||||
mandates: enums::FeatureStatus::NotSupported,
|
||||
refunds: enums::FeatureStatus::Supported,
|
||||
supported_capture_methods: supported_capture_methods.clone(),
|
||||
specific_features: Some(
|
||||
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
|
||||
api_models::feature_matrix::CardSpecificFeatures {
|
||||
three_ds: common_enums::FeatureStatus::NotSupported,
|
||||
no_three_ds: common_enums::FeatureStatus::Supported,
|
||||
supported_card_networks: supported_card_network.clone(),
|
||||
}
|
||||
}),
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
tsys_supported_payment_methods
|
||||
};
|
||||
|
||||
static ref TSYS_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
|
||||
display_name: "Tsys",
|
||||
description: "TSYS, a Global Payments company, is the payment stack for the future, powered by unmatched expertise.",
|
||||
connector_type: enums::PaymentConnectorCategory::BankAcquirer,
|
||||
};
|
||||
|
||||
static ref TSYS_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Tsys {
|
||||
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
|
||||
Some(&*TSYS_CONNECTOR_INFO)
|
||||
}
|
||||
|
||||
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
|
||||
Some(&*TSYS_SUPPORTED_PAYMENT_METHODS)
|
||||
}
|
||||
|
||||
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
|
||||
Some(&*TSYS_SUPPORTED_WEBHOOK_FLOWS)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user