-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(mca): Added recipient connector call for open banking connectors #3758
Changes from 31 commits
f9848a0
708774f
5315345
1886c11
41666a0
e6a8754
8b78b91
6ae507e
d7839fe
1bbd8c3
7ba1295
516e1f8
6df183d
aba43fb
0265a1f
601dc3b
a9608ef
83c98ec
5c1fd4d
bc5e523
b3d291c
cf62cbf
a7ec74a
237148e
1296af5
15bf83a
91cb50f
0a2e266
4cff58f
bc6ec0b
2cf744a
f1affe5
d177e87
791ba58
f41a4c4
1adb8d2
72dc3f9
cc1fba3
6d50f73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -652,6 +652,51 @@ pub struct MerchantConnectorCreate { | |
|
||
#[schema(value_type = Option<ConnectorStatus>, example = "inactive")] | ||
pub status: Option<api_enums::ConnectorStatus>, | ||
|
||
/// In case the merchant needs to store any additional sensitive data | ||
#[schema(value_type = Option<AdditionalMerchantData>)] | ||
pub additional_merchant_data: Option<pii::SecretSerdeValue>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're parsing this in the flow anyways, why can't this just be a concrete type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expecting it to have multiple variants with with complex nested structs underneath, hence thought of keeping it as a json. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's in the API, it's better for it to be a concrete type since any structural validations will be handled by the API layer itself and you won't have to manually parse it and throw errors. |
||
} | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)] | ||
pub enum RecipientIdType { | ||
#[schema(value_type= String)] | ||
ConnectorId(Secret<String>), | ||
#[schema(value_type= String)] | ||
LockerId(Secret<String>), | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum AdditionalMerchantData { | ||
OpenBankingRecipientData(MerchantRecipientData), | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)] | ||
pub enum MerchantAccountData { | ||
Iban { | ||
#[schema(value_type= String)] | ||
iban: Secret<String>, | ||
name: String, | ||
connector_recipient_id: Option<RecipientIdType>, | ||
}, | ||
Bacs { | ||
#[schema(value_type= String)] | ||
account_number: Secret<String>, | ||
#[schema(value_type= String)] | ||
sort_code: Secret<String>, | ||
name: String, | ||
connector_recipient_id: Option<RecipientIdType>, | ||
}, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)] | ||
pub enum MerchantRecipientData { | ||
#[schema(value_type= Option<String>)] | ||
ConnectorRecipientId(Secret<String>), | ||
#[schema(value_type= Option<String>)] | ||
WalletId(Secret<String>), | ||
AccountData(MerchantAccountData), | ||
} | ||
|
||
// Different patterns of authentication. | ||
|
@@ -805,6 +850,9 @@ pub struct MerchantConnectorResponse { | |
|
||
#[schema(value_type = ConnectorStatus, example = "inactive")] | ||
pub status: api_enums::ConnectorStatus, | ||
|
||
#[schema(value_type = Option<AdditionalMerchantData>)] | ||
pub additional_merchant_data: Option<pii::SecretSerdeValue>, | ||
} | ||
|
||
/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc." | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,7 @@ pub enum RoutableConnectors { | |
Worldline, | ||
Worldpay, | ||
Zen, | ||
Plaid, | ||
Zsl, | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also send back the additional data (along with masked bank details if applicable) during retrieval of the merchant connector account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API picks up and sends whatever it finds in the DB, we're already sending back the data.