Skip to content

Commit 434e7a7

Browse files
Anurag-05-progAnurag SinghAnurag Singh
authored
feat(connector): [Barclaycard] Add Google Pay Payment Method (#8786)
Co-authored-by: Anurag Singh <[email protected]> Co-authored-by: Anurag Singh <[email protected]>
1 parent c1d982e commit 434e7a7

File tree

13 files changed

+437
-51
lines changed

13 files changed

+437
-51
lines changed

config/config.example.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
690690
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
691691
paze = { currency = "USD,SEK" }
692692

693+
[pm_filters.barclaycard]
694+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
695+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
696+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
697+
693698
[pm_filters.globepay]
694699
ali_pay = { country = "GB",currency = "GBP" }
695700
we_chat_pay = { country = "GB",currency = "GBP" }

config/deployments/integration_test.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
496496
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
497497
paze = { currency = "USD,SEK" }
498498

499+
[pm_filters.barclaycard]
500+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
501+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
502+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
503+
499504
[pm_filters.itaubank]
500505
pix = { country = "BR", currency = "BRL" }
501506

config/deployments/production.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
430430
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
431431
paze = { currency = "USD,SEK" }
432432

433+
[pm_filters.barclaycard]
434+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
435+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
436+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
437+
433438
[pm_filters.itaubank]
434439
pix = { country = "BR", currency = "BRL" }
435440

config/deployments/sandbox.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
439439
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
440440
paze = { currency = "USD,SEK" }
441441

442+
[pm_filters.barclaycard]
443+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
444+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
445+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
446+
442447
[pm_filters.nexixpay]
443448
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
444449
debit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU,AU,BR,US", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }

config/development.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
598598
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
599599
paze = { currency = "USD,SEK" }
600600

601+
[pm_filters.barclaycard]
602+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
603+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
604+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
605+
601606

602607
[pm_filters.globepay]
603608
ali_pay = { country = "GB",currency = "GBP,CNY" }

config/docker_compose.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN
633633
samsung_pay = { currency = "USD,GBP,EUR,SEK" }
634634
paze = { currency = "USD,SEK" }
635635

636+
[pm_filters.barclaycard]
637+
credit = { currency = "USD,GBP,EUR,PLN,SEK" }
638+
debit = { currency = "USD,GBP,EUR,PLN,SEK" }
639+
google_pay = { currency = "ARS, AUD, CAD, CLP, COP, EUR, HKD, INR, KWD, MYR, MXN, NZD, PEN, QAR, SAR, SGD, ZAR, UAH, AED, GBP, USD, PLN, SEK" }
640+
636641
[pm_filters.globepay]
637642
ali_pay = { country = "GB",currency = "GBP,CNY" }
638643
we_chat_pay = { country = "GB",currency = "GBP,CNY" }

crates/connector_configs/toml/development.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,11 +1026,83 @@ options=["visa","masterCard","amex","discover"]
10261026
payment_method_type = "CartesBancaires"
10271027
[[barclaycard.debit]]
10281028
payment_method_type = "UnionPay"
1029+
[[barclaycard.wallet]]
1030+
payment_method_type = "google_pay"
10291031
[barclaycard.connector_auth.SignatureKey]
10301032
api_key="Key"
10311033
key1="Merchant ID"
10321034
api_secret="Shared Secret"
10331035

1036+
[[barclaycard.metadata.google_pay]]
1037+
name = "merchant_name"
1038+
label = "Google Pay Merchant Name"
1039+
placeholder = "Enter Google Pay Merchant Name"
1040+
required = true
1041+
type = "Text"
1042+
[[barclaycard.metadata.google_pay]]
1043+
name = "merchant_id"
1044+
label = "Google Pay Merchant Id"
1045+
placeholder = "Enter Google Pay Merchant Id"
1046+
required = true
1047+
type = "Text"
1048+
[[barclaycard.metadata.google_pay]]
1049+
name = "gateway_merchant_id"
1050+
label = "Google Pay Merchant Key"
1051+
placeholder = "Enter Google Pay Merchant Key"
1052+
required = true
1053+
type = "Text"
1054+
[[barclaycard.metadata.google_pay]]
1055+
name = "allowed_auth_methods"
1056+
label = "Allowed Auth Methods"
1057+
placeholder = "Enter Allowed Auth Methods"
1058+
required = true
1059+
type = "MultiSelect"
1060+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1061+
1062+
[[barclaycard.connector_wallets_details.google_pay]]
1063+
name = "merchant_name"
1064+
label = "Google Pay Merchant Name"
1065+
placeholder = "Enter Google Pay Merchant Name"
1066+
required = true
1067+
type = "Text"
1068+
[[barclaycard.connector_wallets_details.google_pay]]
1069+
name = "merchant_id"
1070+
label = "Google Pay Merchant Id"
1071+
placeholder = "Enter Google Pay Merchant Id"
1072+
required = true
1073+
type = "Text"
1074+
[[barclaycard.connector_wallets_details.google_pay]]
1075+
name = "gateway_merchant_id"
1076+
label = "Google Pay Merchant Key"
1077+
placeholder = "Enter Google Pay Merchant Key"
1078+
required = true
1079+
type = "Text"
1080+
[[barclaycard.connector_wallets_details.google_pay]]
1081+
name = "public_key"
1082+
label = "Google Pay Public Key"
1083+
placeholder = "Enter Google Pay Public Key"
1084+
required = true
1085+
type = "Text"
1086+
[[barclaycard.connector_wallets_details.google_pay]]
1087+
name = "private_key"
1088+
label = "Google Pay Private Key"
1089+
placeholder = "Enter Google Pay Private Key"
1090+
required = true
1091+
type = "Text"
1092+
[[barclaycard.connector_wallets_details.google_pay]]
1093+
name = "recipient_id"
1094+
label = "Recipient Id"
1095+
placeholder = "Enter Recipient Id"
1096+
required = true
1097+
type = "Text"
1098+
[[barclaycard.connector_wallets_details.google_pay]]
1099+
name = "allowed_auth_methods"
1100+
label = "Allowed Auth Methods"
1101+
placeholder = "Enter Allowed Auth Methods"
1102+
required = true
1103+
type = "MultiSelect"
1104+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1105+
10341106
[bitpay]
10351107
[[bitpay.crypto]]
10361108
payment_method_type = "crypto_currency"

crates/connector_configs/toml/production.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,83 @@ payment_method_type = "DinersClub"
10281028
payment_method_type = "CartesBancaires"
10291029
[[barclaycard.debit]]
10301030
payment_method_type = "UnionPay"
1031+
[[barclaycard.wallet]]
1032+
payment_method_type = "google_pay"
10311033
[barclaycard.connector_auth.SignatureKey]
10321034
api_key = "Key"
10331035
key1 = "Merchant ID"
10341036
api_secret = "Shared Secret"
10351037

1038+
[[barclaycard.metadata.google_pay]]
1039+
name = "merchant_name"
1040+
label = "Google Pay Merchant Name"
1041+
placeholder = "Enter Google Pay Merchant Name"
1042+
required = true
1043+
type = "Text"
1044+
[[barclaycard.metadata.google_pay]]
1045+
name = "merchant_id"
1046+
label = "Google Pay Merchant Id"
1047+
placeholder = "Enter Google Pay Merchant Id"
1048+
required = true
1049+
type = "Text"
1050+
[[barclaycard.metadata.google_pay]]
1051+
name = "gateway_merchant_id"
1052+
label = "Google Pay Merchant Key"
1053+
placeholder = "Enter Google Pay Merchant Key"
1054+
required = true
1055+
type = "Text"
1056+
[[barclaycard.metadata.google_pay]]
1057+
name = "allowed_auth_methods"
1058+
label = "Allowed Auth Methods"
1059+
placeholder = "Enter Allowed Auth Methods"
1060+
required = true
1061+
type = "MultiSelect"
1062+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1063+
1064+
[[barclaycard.connector_wallets_details.google_pay]]
1065+
name = "merchant_name"
1066+
label = "Google Pay Merchant Name"
1067+
placeholder = "Enter Google Pay Merchant Name"
1068+
required = true
1069+
type = "Text"
1070+
[[barclaycard.connector_wallets_details.google_pay]]
1071+
name = "merchant_id"
1072+
label = "Google Pay Merchant Id"
1073+
placeholder = "Enter Google Pay Merchant Id"
1074+
required = true
1075+
type = "Text"
1076+
[[barclaycard.connector_wallets_details.google_pay]]
1077+
name = "gateway_merchant_id"
1078+
label = "Google Pay Merchant Key"
1079+
placeholder = "Enter Google Pay Merchant Key"
1080+
required = true
1081+
type = "Text"
1082+
[[barclaycard.connector_wallets_details.google_pay]]
1083+
name = "public_key"
1084+
label = "Google Pay Public Key"
1085+
placeholder = "Enter Google Pay Public Key"
1086+
required = true
1087+
type = "Text"
1088+
[[barclaycard.connector_wallets_details.google_pay]]
1089+
name = "private_key"
1090+
label = "Google Pay Private Key"
1091+
placeholder = "Enter Google Pay Private Key"
1092+
required = true
1093+
type = "Text"
1094+
[[barclaycard.connector_wallets_details.google_pay]]
1095+
name = "recipient_id"
1096+
label = "Recipient Id"
1097+
placeholder = "Enter Recipient Id"
1098+
required = true
1099+
type = "Text"
1100+
[[barclaycard.connector_wallets_details.google_pay]]
1101+
name = "allowed_auth_methods"
1102+
label = "Allowed Auth Methods"
1103+
placeholder = "Enter Allowed Auth Methods"
1104+
required = true
1105+
type = "MultiSelect"
1106+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1107+
10361108
[cashtocode]
10371109
[[cashtocode.reward]]
10381110
payment_method_type = "classic"

crates/connector_configs/toml/sandbox.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,11 +1026,83 @@ payment_method_type = "DinersClub"
10261026
payment_method_type = "CartesBancaires"
10271027
[[barclaycard.debit]]
10281028
payment_method_type = "UnionPay"
1029+
[[barclaycard.wallet]]
1030+
payment_method_type = "google_pay"
10291031
[barclaycard.connector_auth.SignatureKey]
10301032
api_key = "Key"
10311033
key1 = "Merchant ID"
10321034
api_secret = "Shared Secret"
10331035

1036+
[[barclaycard.metadata.google_pay]]
1037+
name = "merchant_name"
1038+
label = "Google Pay Merchant Name"
1039+
placeholder = "Enter Google Pay Merchant Name"
1040+
required = true
1041+
type = "Text"
1042+
[[barclaycard.metadata.google_pay]]
1043+
name = "merchant_id"
1044+
label = "Google Pay Merchant Id"
1045+
placeholder = "Enter Google Pay Merchant Id"
1046+
required = true
1047+
type = "Text"
1048+
[[barclaycard.metadata.google_pay]]
1049+
name = "gateway_merchant_id"
1050+
label = "Google Pay Merchant Key"
1051+
placeholder = "Enter Google Pay Merchant Key"
1052+
required = true
1053+
type = "Text"
1054+
[[barclaycard.metadata.google_pay]]
1055+
name = "allowed_auth_methods"
1056+
label = "Allowed Auth Methods"
1057+
placeholder = "Enter Allowed Auth Methods"
1058+
required = true
1059+
type = "MultiSelect"
1060+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1061+
1062+
[[barclaycard.connector_wallets_details.google_pay]]
1063+
name = "merchant_name"
1064+
label = "Google Pay Merchant Name"
1065+
placeholder = "Enter Google Pay Merchant Name"
1066+
required = true
1067+
type = "Text"
1068+
[[barclaycard.connector_wallets_details.google_pay]]
1069+
name = "merchant_id"
1070+
label = "Google Pay Merchant Id"
1071+
placeholder = "Enter Google Pay Merchant Id"
1072+
required = true
1073+
type = "Text"
1074+
[[barclaycard.connector_wallets_details.google_pay]]
1075+
name = "gateway_merchant_id"
1076+
label = "Google Pay Merchant Key"
1077+
placeholder = "Enter Google Pay Merchant Key"
1078+
required = true
1079+
type = "Text"
1080+
[[barclaycard.connector_wallets_details.google_pay]]
1081+
name = "public_key"
1082+
label = "Google Pay Public Key"
1083+
placeholder = "Enter Google Pay Public Key"
1084+
required = true
1085+
type = "Text"
1086+
[[barclaycard.connector_wallets_details.google_pay]]
1087+
name = "private_key"
1088+
label = "Google Pay Private Key"
1089+
placeholder = "Enter Google Pay Private Key"
1090+
required = true
1091+
type = "Text"
1092+
[[barclaycard.connector_wallets_details.google_pay]]
1093+
name = "recipient_id"
1094+
label = "Recipient Id"
1095+
placeholder = "Enter Recipient Id"
1096+
required = true
1097+
type = "Text"
1098+
[[barclaycard.connector_wallets_details.google_pay]]
1099+
name = "allowed_auth_methods"
1100+
label = "Allowed Auth Methods"
1101+
placeholder = "Enter Allowed Auth Methods"
1102+
required = true
1103+
type = "MultiSelect"
1104+
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
1105+
10341106
[bitpay]
10351107
[[bitpay.crypto]]
10361108
payment_method_type = "crypto_currency"

crates/hyperswitch_connectors/src/connectors/barclaycard.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,19 +1003,30 @@ static BARCLAYCARD_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods>
10031003
PaymentMethodDetails {
10041004
mandates: enums::FeatureStatus::NotSupported,
10051005
refunds: enums::FeatureStatus::Supported,
1006-
supported_capture_methods,
1006+
supported_capture_methods: supported_capture_methods.clone(),
10071007
specific_features: Some(
10081008
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
10091009
api_models::feature_matrix::CardSpecificFeatures {
10101010
three_ds: common_enums::FeatureStatus::NotSupported,
10111011
no_three_ds: common_enums::FeatureStatus::Supported,
1012-
supported_card_networks: supported_card_network,
1012+
supported_card_networks: supported_card_network.clone(),
10131013
}
10141014
}),
10151015
),
10161016
},
10171017
);
10181018

1019+
barclaycard_supported_payment_methods.add(
1020+
enums::PaymentMethod::Wallet,
1021+
enums::PaymentMethodType::GooglePay,
1022+
PaymentMethodDetails {
1023+
mandates: enums::FeatureStatus::NotSupported,
1024+
refunds: enums::FeatureStatus::Supported,
1025+
supported_capture_methods,
1026+
specific_features: None,
1027+
},
1028+
);
1029+
10191030
barclaycard_supported_payment_methods
10201031
});
10211032

0 commit comments

Comments
 (0)