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

fix(connector): [ADYEN] Added WeChatPay Fix #7373

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Debarshi-Gupta
Copy link
Contributor

@Debarshi-Gupta Debarshi-Gupta commented Feb 25, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Fixed WeChatPay Payments Bug for Adyen

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Issue Link: #7374

How did you test it?

Postman Tests

-Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_j4jEUK5xoU3oOf7OtNJmG4mBK0T4CdF1rIdAKLRNb3jGtlKamMqkG6tp5Zftxap2' \
--data '{
    "amount": 300,
    "currency": "HKD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 300,
    "customer_id": "StripeCustomer",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "we_chat_pay",
    "payment_method_data": {
        "wallet": {
            "we_chat_pay_redirect": {}
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

-Response

{
    "payment_id": "pay_dYE5zjgKyfo8tF0IGt0h",
    "merchant_id": "postman_merchant_GHAction_0435f924-4b25-42e6-8556-b86169c78e20",
    "status": "requires_customer_action",
    "amount": 300,
    "net_amount": 300,
    "shipping_cost": null,
    "amount_capturable": 300,
    "amount_received": null,
    "connector": "adyen",
    "client_secret": "pay_dYE5zjgKyfo8tF0IGt0h_secret_b2JifJH2fCdS3g1rRNMM",
    "created": "2025-02-25T11:37:43.714Z",
    "currency": "HKD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": null,
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_dYE5zjgKyfo8tF0IGt0h/postman_merchant_GHAction_0435f924-4b25-42e6-8556-b86169c78e20/pay_dYE5zjgKyfo8tF0IGt0h_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "we_chat_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "StripeCustomer",
        "created_at": 1740483463,
        "expires": 1740487063,
        "secret": "epk_0c181f41e4034a959890c60c90f2fcce"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_93UEB0uXkJA8WBxQSJTR",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_05h2oGcy5ZCGV2ljiCfT",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-25T11:52:43.714Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-25T11:37:45.274Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null
}

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Debarshi-Gupta Debarshi-Gupta added A-connector-integration Area: Connector integration C-bug Category: Bug labels Feb 25, 2025
@Debarshi-Gupta Debarshi-Gupta self-assigned this Feb 25, 2025
@Debarshi-Gupta Debarshi-Gupta requested a review from a team as a code owner February 25, 2025 11:46
Copy link

semanticdiff-com bot commented Feb 25, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/connector/adyen/transformers.rs  21% smaller

@Debarshi-Gupta Debarshi-Gupta linked an issue Feb 25, 2025 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] WeChatPay for Adyen is resulting in failed payments
1 participant