Skip to content

Commit 8d4adc5

Browse files
feat(connector): [ProphetPay] Implement Card Redirect PaymentMethodType and flows for Authorize, CompleteAuthorize, Psync, Refund, Rsync and Void (#2641)
Co-authored-by: Arjun Karthik <[email protected]>
1 parent e8de3a7 commit 8d4adc5

File tree

29 files changed

+722
-151
lines changed

29 files changed

+722
-151
lines changed

config/config.example.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ ach = { currency = "USD" }
417417
[pm_filters.stripe]
418418
cashapp = {country = "US", currency = "USD"}
419419

420+
[pm_filters.prophetpay]
421+
card_redirect = { currency = "USD" }
422+
420423
[connector_customer]
421424
connector_list = "gocardless,stax,stripe"
422425
payout_connector_list = "wise"

config/development.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ credit = { currency = "USD" }
355355
debit = { currency = "USD" }
356356
ach = { currency = "USD" }
357357

358+
[pm_filters.prophetpay]
359+
card_redirect = { currency = "USD" }
360+
358361
[pm_filters.trustpay]
359362
credit = { not_available_flows = { capture_method = "manual" } }
360363
debit = { not_available_flows = { capture_method = "manual" } }

config/docker_compose.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ red_pagos = { country = "UY", currency = "UYU" }
285285
[pm_filters.stripe]
286286
cashapp = {country = "US", currency = "USD"}
287287

288+
[pm_filters.prophetpay]
289+
card_redirect = { currency = "USD" }
290+
288291
[pm_filters.stax]
289292
credit = { currency = "USD" }
290293
debit = { currency = "USD" }

crates/api_models/src/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub enum Connector {
108108
Paypal,
109109
Payu,
110110
Powertranz,
111-
// Prophetpay, added as a template code for future usage
111+
Prophetpay,
112112
Rapyd,
113113
Shift4,
114114
Square,
@@ -229,7 +229,7 @@ pub enum RoutableConnectors {
229229
Paypal,
230230
Payu,
231231
Powertranz,
232-
// Prophetpay, added as a template code for future usage
232+
Prophetpay,
233233
Rapyd,
234234
Shift4,
235235
Square,

crates/api_models/src/payments.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ pub enum CardRedirectData {
704704
Knet {},
705705
Benefit {},
706706
MomoAtm {},
707+
CardRedirect {},
707708
}
708709

709710
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
@@ -868,6 +869,7 @@ impl GetPaymentMethodType for CardRedirectData {
868869
Self::Knet {} => api_enums::PaymentMethodType::Knet,
869870
Self::Benefit {} => api_enums::PaymentMethodType::Benefit,
870871
Self::MomoAtm {} => api_enums::PaymentMethodType::MomoAtm,
872+
Self::CardRedirect {} => api_enums::PaymentMethodType::CardRedirect,
871873
}
872874
}
873875
}

crates/api_models/src/routing.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ impl From<RoutableConnectorChoice> for ast::ConnectorChoice {
337337
RoutableConnectors::Paypal => euclid_enums::Connector::Paypal,
338338
RoutableConnectors::Payu => euclid_enums::Connector::Payu,
339339
RoutableConnectors::Powertranz => euclid_enums::Connector::Powertranz,
340+
RoutableConnectors::Prophetpay => euclid_enums::Connector::Prophetpay,
340341
RoutableConnectors::Rapyd => euclid_enums::Connector::Rapyd,
341342
RoutableConnectors::Shift4 => euclid_enums::Connector::Shift4,
342343
RoutableConnectors::Square => euclid_enums::Connector::Square,

crates/common_enums/src/enums.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ pub enum PaymentMethodType {
990990
BcaBankTransfer,
991991
BniVa,
992992
BriVa,
993+
CardRedirect,
993994
CimbVa,
994995
#[serde(rename = "classic")]
995996
ClassicReward,

crates/common_enums/src/transformers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,7 @@ impl From<PaymentMethodType> for PaymentMethod {
18071807
PaymentMethodType::Bizum => Self::BankRedirect,
18081808
PaymentMethodType::Blik => Self::BankRedirect,
18091809
PaymentMethodType::Alfamart => Self::Voucher,
1810+
PaymentMethodType::CardRedirect => Self::CardRedirect,
18101811
PaymentMethodType::CimbVa => Self::BankTransfer,
18111812
PaymentMethodType::ClassicReward => Self::Reward,
18121813
PaymentMethodType::Credit => Self::Card,

crates/common_utils/src/consts.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ pub const DEFAULT_PRODUCT_IMG: &str = "https://i.imgur.com/On3VtKF.png";
4141

4242
/// Default Merchant Logo Link
4343
pub const DEFAULT_MERCHANT_LOGO: &str = "https://i.imgur.com/RfxPFQo.png";
44+
45+
/// Redirect url for Prophetpay
46+
pub const PROPHETPAY_REDIRECT_URL: &str = "https://ccm-thirdparty.cps.golf/hp/tokenize/";
47+
48+
/// Variable which store the card token for Prophetpay
49+
pub const PROPHETPAY_TOKEN: &str = "cctoken";

crates/euclid/src/enums.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub enum Connector {
117117
Paypal,
118118
Payu,
119119
Powertranz,
120+
Prophetpay,
120121
Rapyd,
121122
Shift4,
122123
Square,

0 commit comments

Comments
 (0)