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): [JPMORGAN] add Payment flows for cards #6668

Merged
merged 12 commits into from
Dec 22, 2024
Merged
Changes from 10 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
2 changes: 2 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
@@ -6250,6 +6250,7 @@
"helcim",
"iatapay",
"itaubank",
"jpmorgan",
"klarna",
"mifinity",
"mollie",
@@ -18682,6 +18683,7 @@
"helcim",
"iatapay",
"itaubank",
"jpmorgan",
"klarna",
"mifinity",
"mollie",
2 changes: 2 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
@@ -8754,6 +8754,7 @@
"helcim",
"iatapay",
"itaubank",
"jpmorgan",
"klarna",
"mifinity",
"mollie",
@@ -22889,6 +22890,7 @@
"helcim",
"iatapay",
"itaubank",
"jpmorgan",
"klarna",
"mifinity",
"mollie",
1 change: 1 addition & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
@@ -223,6 +223,7 @@ iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url= "https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we including the entire URL here instead of just the base URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the secondary base url is different from the base url, it is actually used for retrieving the access token, it is a separate api call

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be including only the base URL here instead of the entire URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so where should we include the access token flow's url?

klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
5 changes: 5 additions & 0 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url="https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -286,6 +287,10 @@ debit.currency = "USD"
ali_pay.currency = "GBP,CNY"
we_chat_pay.currency = "GBP,CNY"

[pm.filters.jpmorgan]
debit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }
credit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }

[pm_filters.klarna]
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }

5 changes: 5 additions & 0 deletions config/deployments/production.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add pm filters in toml files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright

Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ iatapay.base_url = "https://iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://secure.api.itau/"
jpmorgan.base_url = "https://api-ms.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url="https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
klarna.base_url = "https://api{{klarna_region}}.klarna.com/"
mifinity.base_url = "https://secure.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -320,6 +321,10 @@ debit.currency = "USD"
ali_pay.currency = "GBP,CNY"
we_chat_pay.currency = "GBP,CNY"

[pm.filters.jpmorgan]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please verify the currencies supported

debit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }
credit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }

[pm_filters.klarna]
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }

5 changes: 5 additions & 0 deletions config/deployments/sandbox.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does jpmorgan use same base url in both sbx and prod env?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it uses different

Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url="https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -321,6 +322,10 @@ debit.currency = "USD"
ali_pay.currency = "GBP,CNY"
we_chat_pay.currency = "GBP,CNY"

[pm.filters.jpmorgan]
debit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }
credit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }

[pm_filters.klarna]
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }

5 changes: 5 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
@@ -240,6 +240,7 @@ iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url= "https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -489,6 +490,10 @@ paypal = { currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,N
credit = { currency = "USD" }
debit = { currency = "USD" }

[pm.filters.jpmorgan]
debit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }
credit = { country = "CA, EU, UK, US", currency = "CAD, EUR, GBP, USD" }

[pm_filters.klarna]
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,EUR,EUR,CAD,CZK,DKK,EUR,EUR,EUR,EUR,EUR,EUR,EUR,NZD,NOK,PLN,EUR,EUR,SEK,CHF,GBP,USD" }

1 change: 1 addition & 0 deletions config/docker_compose.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if jpmorgan is needs to be added in temp_locker_enable_config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to add that here

Original file line number Diff line number Diff line change
@@ -154,6 +154,7 @@ iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
inespay.base_url = "https://apiflow.inespay.com/san/v21"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
jpmorgan.secondary_base_url="https://id.payments.jpmorgan.com/am/oauth2/alpha/access_token"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
5 changes: 3 additions & 2 deletions crates/api_models/src/connector_enums.rs
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ pub enum Connector {
// Inespay,
Iatapay,
Itaubank,
//Jpmorgan,
Jpmorgan,
Klarna,
Mifinity,
Mollie,
@@ -173,6 +173,7 @@ impl Connector {
(Self::Airwallex, _)
| (Self::Deutschebank, _)
| (Self::Globalpay, _)
| (Self::Jpmorgan, _)
| (Self::Paypal, _)
| (Self::Payu, _)
| (Self::Trustpay, PaymentMethod::BankRedirect)
@@ -232,7 +233,7 @@ impl Connector {
| Self::Iatapay
// | Self::Inespay
| Self::Itaubank
//| Self::Jpmorgan
| Self::Jpmorgan
| Self::Klarna
| Self::Mifinity
| Self::Mollie
2 changes: 1 addition & 1 deletion crates/common_enums/src/connector_enums.rs
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ pub enum RoutableConnectors {
Iatapay,
// Inespay,
Itaubank,
//Jpmorgan,
Jpmorgan,
Klarna,
Mifinity,
Mollie,
2 changes: 2 additions & 0 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
@@ -193,6 +193,7 @@ pub struct ConnectorConfig {
pub gpayments: Option<ConnectorTomlConfig>,
pub helcim: Option<ConnectorTomlConfig>,
// pub inespay: Option<ConnectorTomlConfig>,
pub jpmorgan: Option<ConnectorTomlConfig>,
pub klarna: Option<ConnectorTomlConfig>,
pub mifinity: Option<ConnectorTomlConfig>,
pub mollie: Option<ConnectorTomlConfig>,
@@ -359,6 +360,7 @@ impl ConnectorConfig {
Connector::Gpayments => Ok(connector_data.gpayments),
Connector::Helcim => Ok(connector_data.helcim),
// Connector::Inespay => Ok(connector_data.inespay),
Connector::Jpmorgan => Ok(connector_data.jpmorgan),
Connector::Klarna => Ok(connector_data.klarna),
Connector::Mifinity => Ok(connector_data.mifinity),
Connector::Mollie => Ok(connector_data.mollie),
41 changes: 41 additions & 0 deletions crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
@@ -1731,6 +1731,47 @@ api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"

[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "American Express"
[[jpmorgan.credit]]
payment_method_type = "ChaseNet"
[[jpmorgan.credit]]
payment_method_type = "Diners Club"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "American Express"
[[jpmorgan.debit]]
payment_method_type = "ChaseNet"
[[jpmorgan.debit]]
payment_method_type = "Diners Club"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Client ID"
key1="Client Secret"

[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
40 changes: 40 additions & 0 deletions crates/connector_configs/toml/production.toml
Original file line number Diff line number Diff line change
@@ -1443,6 +1443,46 @@ api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"

[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "American Express"
[[jpmorgan.credit]]
payment_method_type = "ChaseNet"
[[jpmorgan.credit]]
payment_method_type = "Diners Club"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "American Express"
[[jpmorgan.debit]]
payment_method_type = "ChaseNet"
[[jpmorgan.debit]]
payment_method_type = "Diners Club"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Access Token"

[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
40 changes: 40 additions & 0 deletions crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
@@ -1681,6 +1681,46 @@ api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"

[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "American Express"
[[jpmorgan.credit]]
payment_method_type = "ChaseNet"
[[jpmorgan.credit]]
payment_method_type = "Diners Club"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "American Express"
[[jpmorgan.debit]]
payment_method_type = "ChaseNet"
[[jpmorgan.debit]]
payment_method_type = "Diners Club"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Access Token"

[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
Loading