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): [Adyen] Add support for PIX Payment Method #3236

Merged
merged 23 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2e88745
feat: implement pix for adyen
swangi-kumari Jan 2, 2024
288b04b
Merge branch 'main' into pix
swangi-kumari Jan 4, 2024
b09cbbf
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jan 4, 2024
f4f1c4d
fix: remove unnecessary comments
swangi-kumari Jan 4, 2024
9290384
Merge branch 'pix' of https://github.com/juspay/hyperswitch into pix
swangi-kumari Jan 4, 2024
0606275
Merge branch 'main' into pix
swangi-kumari Jan 5, 2024
83f9807
feat: pix recieving url in response
swangi-kumari Jan 5, 2024
554683e
Merge remote-tracking branch 'origin' into pix
swangi-kumari Jan 8, 2024
53807f9
Merge branch 'main' of https://github.com/juspay/hyperswitch into pix
swangi-kumari Jan 9, 2024
6de61d2
refactor: handle 3 cases in adyen transformer
swangi-kumari Jan 9, 2024
26fcb9f
refactor: redirection working
swangi-kumari Jan 9, 2024
2ea1a49
Merge branch 'main' into pix
swangi-kumari Jan 12, 2024
2d161fa
Merge branch 'main' into pix
swangi-kumari Jan 16, 2024
47f8ebf
refactor: create from impl
swangi-kumari Jan 16, 2024
8896530
refactor: display_to_timestamp works
swangi-kumari Jan 16, 2024
c9e88a7
refactor: wechatpay working
swangi-kumari Jan 17, 2024
eeb08ad
refactor: fixed bank_transfer
swangi-kumari Jan 17, 2024
c8e3460
refactor: fic clippy warnings
swangi-kumari Jan 17, 2024
3d15bbb
refactor: rename functions and add check for pix
swangi-kumari Jan 17, 2024
b42c412
refactor: remove unnecessary comments
swangi-kumari Jan 17, 2024
6beac53
refactor: convert display_to_timestamp in milisecond
swangi-kumari Jan 23, 2024
afbd060
refactor: create a funtion for get_timestamp_in_milliseconds
swangi-kumari Jan 24, 2024
77715da
refactor: fix
swangi-kumari Jan 24, 2024
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
27 changes: 26 additions & 1 deletion crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +1892,12 @@ pub enum NextActionData {
/// Contains url for Qr code image, this qr code has to be shown in sdk
QrCodeInformation {
#[schema(value_type = String)]
image_data_url: Url,
/// Hyperswitch generated image data source url
image_data_url: Option<Url>,
display_to_timestamp: Option<i64>,
#[schema(value_type = String)]
/// The url for Qr code given by the connector
qr_code_url: Option<Url>,
sai-harsha-vardhan marked this conversation as resolved.
Show resolved Hide resolved
},
/// Contains the download url and the reference number for transaction
DisplayVoucherInformation {
Expand All @@ -1907,6 +1911,26 @@ pub enum NextActionData {
},
}

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
// the enum order shouldn't be changed as this is being used during serialization and deserialization
pub enum QrCodeInformation {
QrCodeUrl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments stating that the enum order shouldn't be changed as this is being used during serialization and deserialization

image_data_url: Url,
qr_code_url: Url,
display_to_timestamp: Option<i64>,
},
QrDataUrl {
image_data_url: Url,
display_to_timestamp: Option<i64>,
},
QrCodeImageUrl {
qr_code_url: Url,
display_to_timestamp: Option<i64>,
},
}

#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct BankTransferNextStepsData {
/// The instructions for performing a bank transfer
Expand All @@ -1932,6 +1956,7 @@ pub struct VoucherNextStepData {
pub struct QrCodeNextStepsInstruction {
pub image_data_url: Url,
pub display_to_timestamp: Option<i64>,
pub qr_code_url: Option<Url>,
}

#[derive(Clone, Debug, serde::Deserialize)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,9 @@ pub enum StripeNextAction {
session_token: Option<payments::SessionToken>,
},
QrCodeInformation {
image_data_url: url::Url,
image_data_url: Option<url::Url>,
display_to_timestamp: Option<i64>,
qr_code_url: Option<url::Url>,
},
DisplayVoucherInformation {
voucher_details: payments::VoucherNextStepData,
Expand Down Expand Up @@ -830,9 +831,11 @@ pub(crate) fn into_stripe_next_action(
payments::NextActionData::QrCodeInformation {
image_data_url,
display_to_timestamp,
qr_code_url,
} => StripeNextAction::QrCodeInformation {
image_data_url,
display_to_timestamp,
qr_code_url,
},
payments::NextActionData::DisplayVoucherInformation { voucher_details } => {
StripeNextAction::DisplayVoucherInformation { voucher_details }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ pub enum StripeNextAction {
session_token: Option<payments::SessionToken>,
},
QrCodeInformation {
image_data_url: url::Url,
image_data_url: Option<url::Url>,
display_to_timestamp: Option<i64>,
qr_code_url: Option<url::Url>,
},
DisplayVoucherInformation {
voucher_details: payments::VoucherNextStepData,
Expand Down Expand Up @@ -420,9 +421,11 @@ pub(crate) fn into_stripe_next_action(
payments::NextActionData::QrCodeInformation {
image_data_url,
display_to_timestamp,
qr_code_url,
} => StripeNextAction::QrCodeInformation {
image_data_url,
display_to_timestamp,
qr_code_url,
},
payments::NextActionData::DisplayVoucherInformation { voucher_details } => {
StripeNextAction::DisplayVoucherInformation { voucher_details }
Expand Down
Loading
Loading