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

refactor(connector): [Braintree] Mask PII data #3759

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Feb 21, 2024

Type of Change

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

Description

Mask pii information passed and received in the connector request and response for Braintree.

Test Case

Check if sensitive fields within connector request and response is masked in the click house for Braintree
Test for both graphQL and the normal version

Sanity test

  1. Payment create - 3ds card
curl --location 'http:https://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data-raw '{
  "amount": 2000,
  "currency": "GBP",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "customer_id": "StripeCustomer",
  "email": "[email protected]",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+65",
  "description": "Its my first payment request",
  "authentication_type": "three_ds",
  "return_url": "https://google.com",

  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "browser_info": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "color_depth": 24,
    "screen_height": 723,
    "screen_width": 1536,
    "time_zone": 0,
    "java_enabled": true,
    "java_script_enabled": true,
    "ip_address": "127.0.0.1"
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "payment_method": "card",
  "payment_method_data": {
    "card": {
      "card_number": "5123456789012346",
      "card_exp_month": "10",
      "card_exp_year": "30",
      "card_holder_name": "Joseph Doe",
      "card_cvc": "123"
    }
  }
}'

response

ClientTokenResponse(ClientTokenResponse { data: ClientTokenData { create_client_token: ClientToken { client_token: *** alloc::string::String *** } } })
router::connector::braintree: connector_response: TokenResponse(TokenResponse { data: TokenizeCreditCard { tokenize_credit_card: TokenizeCreditCardData { payment_method: TokenizePaymentMethodData { id: *** alloc::string::String *** } } } })

In logs check for
topic = "hyperswitch-outgoing-connector-events"

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

@AkshayaFoiger AkshayaFoiger requested a review from a team as a code owner February 21, 2024 15:12
@AkshayaFoiger AkshayaFoiger self-assigned this Feb 22, 2024
@AkshayaFoiger AkshayaFoiger added A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Feb 22, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 27, 2024
Merged via the queue into main with commit 3e87d44 Feb 27, 2024
14 of 18 checks passed
@Gnanasundari24 Gnanasundari24 deleted the connector-data-masking/braintree-both branch February 27, 2024 11:11
pixincreate added a commit that referenced this pull request Feb 28, 2024
…stman-runner

* 'main' of github.com:juspay/hyperswitch: (22 commits)
  chore(version): 2024.02.28.0
  chore(postman): update Postman collection files
  fix(connector): [AUTHORIZEDOTNET] Fix status mapping (#3845)
  refactor(router): added logs health and deep health (#3780)
  feat(roles): Change list roles, get role and authorization info api to respond with groups (#3837)
  fix(core): validate amount_to_capture in payment update (#3830)
  refactor(connector): [Square] change error message from NotSupported to NotImplemented (#2875)
  feat(router): add connector mit related columns to the payment methods table (#3764)
  ci(postman): refactor NMI postman collection (#3805)
  refactor(connector): [Braintree] Mask PII data (#3759)
  refactor(connector): [Forte] Mask PII data (#3824)
  refactor(compatibility): added compatibility layer request logs (#3774)
  refactor(payment_methods): introduce `locker_id` column in `payment_methods` table (#3760)
  feat(connector): mask pii information in connector request and response for stripe, aci, adyen, airwallex  and authorizedotnet (#3678)
  chore(version): 2024.02.27.0
  fix(core): do not construct request if it is already available (#3826)
  refactor: incorporate `hyperswitch_interface` into router (#3669)
  feat: add unique constraint restriction for KV (#3723)
  feat(connector): [Payme] Add Void flow to Payme (#3817)
  refactor(connector): [Cybersource] Mask PII data  (#3786)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] : [Braintree] mask pii information in connector request and response
4 participants