Skip to content

Include additional scrub on store call #5447

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

naashton
Copy link
Contributor

This adds an additional scrub for pan when the transaction is a store

@naashton naashton requested a review from Copilot April 17, 2025 14:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds additional scrubbing for the "pan" field on store transactions.

  • Introduces a new test to verify transcript scrubbing for store calls.
  • Updates the transcript scrub method in the DataTrans gateway to filter the "pan" field.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/remote/gateways/remote_datatrans_test.rb Adds a test for additional scrubbing on store calls.
lib/active_merchant/billing/gateways/datatrans.rb Updates scrub method to include filtering of the "pan" field.
Comments suppressed due to low confidence (1)

lib/active_merchant/billing/gateways/datatrans.rb:106

  • The regex replacement uses an undefined second capture group (\2). Consider removing \2 from the replacement string or updating the regex to capture a second group if intended.
gsub(%r(("pan\":\")\d+), '\1[FILTERED]\2')

Copy link
Contributor

@rachelkirk rachelkirk left a comment

Choose a reason for hiding this comment

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

I see that the test covers credit card number and cvv and not pan specifically, but looked in store method to see how request is formatted. LGTM! 🚢

@naashton naashton force-pushed the datatrans_scrub_store branch from 2007eb1 to 34d4b89 Compare April 17, 2025 17:11
@naashton naashton merged commit 4ddbcb8 into activemerchant:master Apr 17, 2025
5 checks passed
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.

2 participants