Skip to content

Commit

Permalink
feat(connector): [Adyen] add dispute flows for adyen connector (#5514)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranKBR authored Aug 23, 2024
1 parent a9c9d9b commit ad9f91b
Show file tree
Hide file tree
Showing 16 changed files with 801 additions and 126 deletions.
3 changes: 2 additions & 1 deletion config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ hash_key = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
[connectors]
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://checkout-test.adyen.com/"
adyen.secondary_base_url = "https://pal-test.adyen.com/"
adyen.payout_base_url = "https://pal-test.adyen.com/"
adyen.dispute_base_url = "https://ca-test.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-test.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
Expand Down
3 changes: 2 additions & 1 deletion config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ przelewy24.stripe.banks = "alior_bank,bank_millennium,bank_nowy_bfg_sa,bank_peka
[connectors]
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://checkout-test.adyen.com/"
adyen.secondary_base_url = "https://pal-test.adyen.com/"
adyen.payout_base_url = "https://pal-test.adyen.com/"
adyen.dispute_base_url = "https://ca-test.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-test.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
Expand Down
3 changes: 2 additions & 1 deletion config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ payout_connector_list = "stripe,wise"
[connectors]
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://{{merchant_endpoint_prefix}}-checkout-live.adyenpayments.com/checkout/"
adyen.secondary_base_url = "https://{{merchant_endpoint_prefix}}-pal-live.adyenpayments.com/"
adyen.payout_base_url = "https://{{merchant_endpoint_prefix}}-pal-live.adyenpayments.com/"
adyen.dispute_base_url = "https://{{merchant_endpoint_prefix}}-ca-live.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-live.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
Expand Down
3 changes: 2 additions & 1 deletion config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ payout_connector_list = "stripe,wise"
[connectors]
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://checkout-test.adyen.com/"
adyen.secondary_base_url = "https://pal-test.adyen.com/"
adyen.payout_base_url = "https://pal-test.adyen.com/"
adyen.dispute_base_url = "https://ca-test.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-test.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
Expand Down
3 changes: 2 additions & 1 deletion config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ checksum_auth_key = "54455354"
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://checkout-test.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-test.adyen.com/"
adyen.secondary_base_url = "https://pal-test.adyen.com/"
adyen.payout_base_url = "https://pal-test.adyen.com/"
adyen.dispute_base_url = "https://ca-test.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
Expand Down
3 changes: 2 additions & 1 deletion config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ hash_key = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
aci.base_url = "https://eu-test.oppwa.com/"
adyen.base_url = "https://checkout-test.adyen.com/"
adyenplatform.base_url = "https://balanceplatform-api-test.adyen.com/"
adyen.secondary_base_url = "https://pal-test.adyen.com/"
adyen.payout_base_url = "https://pal-test.adyen.com/"
adyen.dispute_base_url = "https://ca-test.adyen.com/"
airwallex.base_url = "https://api-demo.airwallex.com/"
applepay.base_url = "https://apple-pay-gateway.apple.com/"
authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
Expand Down
22 changes: 21 additions & 1 deletion crates/hyperswitch_domain_models/src/router_request_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,42 +667,62 @@ pub struct SubmitEvidenceRequestData {
pub connector_dispute_id: String,
pub access_activity_log: Option<String>,
pub billing_address: Option<String>,
//cancellation policy
pub cancellation_policy: Option<Vec<u8>>,
pub cancellation_policy_file_type: Option<String>,
pub cancellation_policy_provider_file_id: Option<String>,
pub cancellation_policy_disclosure: Option<String>,
pub cancellation_rebuttal: Option<String>,
//customer communication
pub customer_communication: Option<Vec<u8>>,
pub customer_communication_file_type: Option<String>,
pub customer_communication_provider_file_id: Option<String>,
pub customer_email_address: Option<String>,
pub customer_name: Option<String>,
pub customer_purchase_ip: Option<String>,
//customer signature
pub customer_signature: Option<Vec<u8>>,
pub customer_signature_file_type: Option<String>,
pub customer_signature_provider_file_id: Option<String>,
//product description
pub product_description: Option<String>,
//receipts
pub receipt: Option<Vec<u8>>,
pub receipt_file_type: Option<String>,
pub receipt_provider_file_id: Option<String>,
//refund policy
pub refund_policy: Option<Vec<u8>>,
pub refund_policy_file_type: Option<String>,
pub refund_policy_provider_file_id: Option<String>,
pub refund_policy_disclosure: Option<String>,
pub refund_refusal_explanation: Option<String>,
//service docs
pub service_date: Option<String>,
pub service_documentation: Option<Vec<u8>>,
pub service_documentation_file_type: Option<String>,
pub service_documentation_provider_file_id: Option<String>,
//shipping details docs
pub shipping_address: Option<String>,
pub shipping_carrier: Option<String>,
pub shipping_date: Option<String>,
pub shipping_documentation: Option<Vec<u8>>,
pub shipping_documentation_file_type: Option<String>,
pub shipping_documentation_provider_file_id: Option<String>,
pub shipping_tracking_number: Option<String>,
//invoice details
pub invoice_showing_distinct_transactions: Option<Vec<u8>>,
pub invoice_showing_distinct_transactions_file_type: Option<String>,
pub invoice_showing_distinct_transactions_provider_file_id: Option<String>,
//subscription details
pub recurring_transaction_agreement: Option<Vec<u8>>,
pub recurring_transaction_agreement_file_type: Option<String>,
pub recurring_transaction_agreement_provider_file_id: Option<String>,
//uncategorized details
pub uncategorized_file: Option<Vec<u8>>,
pub uncategorized_file_type: Option<String>,
pub uncategorized_file_provider_file_id: Option<String>,
pub uncategorized_text: Option<String>,
}

#[derive(Clone, Debug)]
pub struct RetrieveFileRequestData {
pub provider_file_id: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ pub struct DefendDisputeResponse {
pub dispute_status: api_models::enums::DisputeStatus,
pub connector_status: Option<String>,
}

pub struct FileInfo {
pub file_data: Option<Vec<u8>>,
pub provider_file_id: Option<String>,
pub file_type: Option<String>,
}
17 changes: 13 additions & 4 deletions crates/hyperswitch_interfaces/src/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ use serde::Deserialize;
#[serde(default)]
pub struct Connectors {
pub aci: ConnectorParams,
#[cfg(feature = "payouts")]
pub adyen: ConnectorParamsWithSecondaryBaseUrl,
pub adyen: AdyenParamsWithThreeBaseUrls,
pub adyenplatform: ConnectorParams,
#[cfg(not(feature = "payouts"))]
pub adyen: ConnectorParams,
pub airwallex: ConnectorParams,
pub applepay: ConnectorParams,
pub authorizedotnet: ConnectorParams,
Expand Down Expand Up @@ -143,6 +140,18 @@ pub struct ConnectorParamsWithFileUploadUrl {
pub base_url_file_upload: String,
}

/// struct ConnectorParamsWithThreeBaseUrls
#[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)]
#[serde(default)]
pub struct AdyenParamsWithThreeBaseUrls {
/// base url
pub base_url: String,
/// secondary base url
#[cfg(feature = "payouts")]
pub payout_base_url: String,
/// third base url
pub dispute_base_url: String,
}
/// struct ConnectorParamsWithSecondaryBaseUrl
#[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)]
#[serde(default)]
Expand Down
Loading

0 comments on commit ad9f91b

Please sign in to comment.