Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): [Opayo] Add script generated template code #1295

Merged
merged 20 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ nexinets.base_url = "https://apitest.payengine.de/v1"
nmi.base_url = "https://secure.nmi.com/"
noon.base_url = "https://api-test.noonpayments.com/"
nuvei.base_url = "https://ppp-test.nuvei.com/"
opayo.base_url = "https://pi-test.sagepay.com/"
opennode.base_url = "https://dev-api.opennode.com"
payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
Expand Down
2 changes: 2 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ cards = [
"nmi",
"noon",
"nuvei",
"opayo",
"opennode",
"payeezy",
"payme",
Expand Down Expand Up @@ -131,6 +132,7 @@ nexinets.base_url = "https://apitest.payengine.de/v1"
nmi.base_url = "https://secure.nmi.com/"
noon.base_url = "https://api-test.noonpayments.com/"
nuvei.base_url = "https://ppp-test.nuvei.com/"
opayo.base_url = "https://pi-test.sagepay.com/"
opennode.base_url = "https://dev-api.opennode.com"
payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
Expand Down
2 changes: 2 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ nexinets.base_url = "https://apitest.payengine.de/v1"
nmi.base_url = "https://secure.nmi.com/"
noon.base_url = "https://api-test.noonpayments.com/"
nuvei.base_url = "https://ppp-test.nuvei.com/"
opayo.base_url = "https://pi-test.sagepay.com/"
opennode.base_url = "https://dev-api.opennode.com"
payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
Expand Down Expand Up @@ -139,6 +140,7 @@ cards = [
"nmi",
"noon",
"nuvei",
"opayo",
"opennode",
"payeezy",
"payme",
Expand Down
5 changes: 0 additions & 5 deletions connector-template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ impl
data: data.clone(),
http_code: res.status_code,
})
.change_context(errors::ConnectorError::ResponseHandlingFailed)
}

fn get_error_response(&self, res: Response) -> CustomResult<ErrorResponse,errors::ConnectorError> {
Expand Down Expand Up @@ -245,7 +244,6 @@ impl
data: data.clone(),
http_code: res.status_code,
})
.change_context(errors::ConnectorError::ResponseHandlingFailed)
}

fn get_error_response(
Expand Down Expand Up @@ -322,7 +320,6 @@ impl
data: data.clone(),
http_code: res.status_code,
})
.change_context(errors::ConnectorError::ResponseHandlingFailed)
}

fn get_error_response(
Expand Down Expand Up @@ -391,7 +388,6 @@ impl
data: data.clone(),
http_code: res.status_code,
})
.change_context(errors::ConnectorError::ResponseHandlingFailed)
}

fn get_error_response(&self, res: Response) -> CustomResult<ErrorResponse,errors::ConnectorError> {
Expand Down Expand Up @@ -440,7 +436,6 @@ impl
data: data.clone(),
http_code: res.status_code,
})
.change_context(errors::ConnectorError::ResponseHandlingFailed)
}

fn get_error_response(&self, res: Response) -> CustomResult<ErrorResponse,errors::ConnectorError> {
Expand Down
1 change: 1 addition & 0 deletions connector-template/test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::str::FromStr;
use masking::Secret;
use router::types::{self, api, storage::enums};

Expand Down
4 changes: 3 additions & 1 deletion crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ pub enum Connector {
#[serde(rename = "pretendpay")]
#[strum(serialize = "pretendpay")]
DummyConnector3,
Opennode,
Bambora,
Dlocal,
Fiserv,
Expand All @@ -626,6 +625,8 @@ pub enum Connector {
Nmi,
Noon,
Nuvei,
// Opayo, added as template code for future usage
Opennode,
// Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
Payme,
Paypal,
Expand Down Expand Up @@ -711,6 +712,7 @@ pub enum RoutableConnectors {
Nmi,
Noon,
Nuvei,
// Opayo, added as template code for future usage
Opennode,
// Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
Payme,
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/configs/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ pub struct Connectors {
pub nmi: ConnectorParams,
pub noon: ConnectorParams,
pub nuvei: ConnectorParams,
pub opayo: ConnectorParams,
pub opennode: ConnectorParams,
pub payeezy: ConnectorParams,
pub payme: ConnectorParams,
Expand Down
5 changes: 3 additions & 2 deletions crates/router/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod nexinets;
pub mod nmi;
pub mod noon;
pub mod nuvei;
pub mod opayo;
pub mod opennode;
pub mod payeezy;
pub mod payme;
Expand All @@ -46,7 +47,7 @@ pub use self::{
cashtocode::Cashtocode, checkout::Checkout, coinbase::Coinbase, cybersource::Cybersource,
dlocal::Dlocal, fiserv::Fiserv, forte::Forte, globalpay::Globalpay, iatapay::Iatapay,
klarna::Klarna, mollie::Mollie, multisafepay::Multisafepay, nexinets::Nexinets, nmi::Nmi,
noon::Noon, nuvei::Nuvei, opennode::Opennode, payeezy::Payeezy, payme::Payme, paypal::Paypal,
payu::Payu, rapyd::Rapyd, shift4::Shift4, stripe::Stripe, trustpay::Trustpay,
noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode, payeezy::Payeezy, payme::Payme,
paypal::Paypal, payu::Payu, rapyd::Rapyd, shift4::Shift4, stripe::Stripe, trustpay::Trustpay,
worldline::Worldline, worldpay::Worldpay, zen::Zen,
};
Loading