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

Enhancement: airwallex EPS and SOFORT implementation #4310

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

Conversation

tusharpandeyzee
Copy link

@tusharpandeyzee tusharpandeyzee commented Apr 4, 2024

Type of Change

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

Description

#4309

This PR implements the linked issue, which is created based on this hiring challenge discussion

Additional Changes

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

Following files were changed:
crates/router/src/connector/airwallex/transformers.rs

No config change was done.

Motivation and Context

Implementing EPS and SOFORT bank redirect payment methods for the Airwallex payment processor which is supported by airwallex but unimplemented on hyperswitch.
Linked issue

How did you test it?

I tested this manually as I am new to rust and due to some time constraints. Will add proper unit tests further maybe.

For testing, I created a merchant account, api key, payment connector supporting bank redirect and finally a payment using the postman collection provied in the discussion doc. Attaching screenshots below.

Currently the implementation fails as the demo Airwallex account mentioned in the discussions page does not seem to support EPS and Sofort.
The following log supports my claim:

  2024-04-04T15:23:20.200229Z DEBUG diesel_models::query::generics: query: UPDATE "payment_attempt" SET "net_amount" = $1, "status" = $2, "error_message" = $3, "modified_at" = $4, "error_code" = $5, "error_reason" = $6, "amount_capturable" = $7, "updated_by" = $8 WHERE (("payment_attempt"."attempt_id" = $9) AND ("payment_attempt"."merchant_id" = $10)) -- binds: [100, Failure, Some("The payment method is not enabled. Please contact your account manager."), 2024-04-04 15:23:20.197973, Some("payment_method_not_allowed"), None, 100, "postgres_only", "pay_EbGirVJG8pSBAl3EfuG9_1", "merchant_1712118047"]

But the trasformer works fine and converts the input data into proper airwallex input JSON as below:

The following 2 lines were generated by the statement println!("{:#?}",serde_json::to_string(&payment_method)); for debugging purposes.

Transformed and serialized EPS payment_method data:

"{\"type\":\"eps\",\"eps\":{\"shopper_name\":\"John Doe\"}}"

Transformed and serialized Sofort payment_method data:

"{\"type\":\"sofort\",\"sofort\":{\"shopper_name\":\"John Doe\",\"country_code\":\"US\"}}"

Payment creation returned 200. Couldn't test further as demo account does not support it yet.

image

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
  • I added a CHANGELOG entry if applicable

@tusharpandeyzee tusharpandeyzee requested a review from a team as a code owner April 4, 2024 15:58
@tusharpandeyzee tusharpandeyzee changed the title airwallex eps and sofort implementation faeture: airwallex EPS and SOFORT implementation Apr 4, 2024
@tusharpandeyzee
Copy link
Author

This PR implements #4309

@tusharpandeyzee tusharpandeyzee changed the title faeture: airwallex EPS and SOFORT implementation Enhancement: airwallex EPS and SOFORT implementation Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant