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): [BANKOFAMERICA] Implement 3DS flow for cards #3343

Merged
merged 6 commits into from
Jan 16, 2024

Conversation

deepanshu-iiitu
Copy link
Contributor

@deepanshu-iiitu deepanshu-iiitu commented Jan 12, 2024

Type of Change

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

Description

Implement 3DS flow for cards

Legend: 
UB: User Browser
M: Merchant
HS: Hyperswitch
CS: Bankofamerica/Cybersource Connector

3DS FLOW DIAGRAM

Additional Changes

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

Motivation and Context

#3342

How did you test it?

QA Testing

Screenshot 2024-01-12 at 5 35 04 PM
Screenshot 2024-01-12 at 5 33 54 PM
Screenshot 2024-01-12 at 5 33 10 PM

Screenshot 2024-01-12 at 5 33 28 PM

  • Test Non-3DS flows to confirm they are not affected
  • Test 3DS transactions

All the possible 3DS test cases and test cards are available here: https://developer.cybersource.com/content/dam/docs/cybs/en-us/payer-authentication/developer/all/rest/payer-auth.pdf

3DS Payment Curl:
curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: API_KEY_HERE' \ --data-raw '{ "amount": 1404, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "CustomerX", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "340000000001098", "card_exp_month": "12", "card_exp_year": "30", "card_holder_name": "joseph", "card_cvc": "123" } }, "billing": { "address": { "line1": "sdv", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "46282", "country": "US", "first_name": "joseph", "last_name": "ewcjwd" }, "phone": { "number": "8056594427", "country_code": "+97" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "count_tickets": "1", "transaction_number": 2233 }, "business_label": "food", "business_country": "US" }'

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

@deepanshu-iiitu deepanshu-iiitu added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jan 12, 2024
@deepanshu-iiitu deepanshu-iiitu self-assigned this Jan 12, 2024
@deepanshu-iiitu deepanshu-iiitu requested review from a team as code owners January 12, 2024 11:58
@deepanshu-iiitu deepanshu-iiitu linked an issue Jan 12, 2024 that may be closed by this pull request
2 tasks
SamraatBansal
SamraatBansal previously approved these changes Jan 12, 2024
srujanchikke
srujanchikke previously approved these changes Jan 16, 2024
srujanchikke
srujanchikke previously approved these changes Jan 16, 2024
SamraatBansal
SamraatBansal previously approved these changes Jan 16, 2024
crates/router/src/core/payments.rs Outdated Show resolved Hide resolved
@@ -786,6 +786,15 @@ pub enum RedirectForm {
Html {
html_data: String,
},
BankOfAmericaAuthSetup {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use CybersourceAuthSetup & CybersourceConsumerAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +461 to +462
let email = item.router_data.request.get_email()?;
let bill_to = build_bill_to(item.router_data.get_billing()?, email)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this to be added in dynamic fields? since this is for 3ds?

Copy link
Contributor Author

@deepanshu-iiitu deepanshu-iiitu Jan 16, 2024

Choose a reason for hiding this comment

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

These fields are required in authorize call (even for 3ds). If we not pass these fields the connector is throwing missing field error.

Screenshot 2024-01-16 at 4 56 02 PM

@likhinbopanna likhinbopanna added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit d533c98 Jan 16, 2024
9 checks passed
@likhinbopanna likhinbopanna deleted the boa-3ds branch January 16, 2024 12:45
pixincreate added a commit that referenced this pull request Jan 17, 2024
* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.01.17.0
  feat(connector): [BANKOFAMERICA] Implement 3DS flow for cards (#3343)
  ci(s3): fetch connector creds from s3 for added security (#3323)
  feat(recon): add recon APIs (#3345)
  fix(payment_link): added expires_on in payment response (#3332)
  fix(connector_onboarding): Check if connector exists for the merchant account and add reset tracking id API (#3229)
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-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] [Bankofamerica] Add 3DS flow for cards
6 participants