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

Braintree Blue: Refactor line_items field #3100

Conversation

curiousepic
Copy link
Contributor

Removed hilariously redundant code.

Unit:
57 tests, 150 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
68 tests, 384 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Removed hilariously redundant code.

Unit:
57 tests, 150 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
68 tests, 384 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@curiousepic curiousepic requested a review from a team January 3, 2019 21:31
@@ -621,17 +621,7 @@ def create_transaction_parameters(money, credit_card_or_vault_id, options)
parameters[:discount_amount] = options[:discount_amount] if options[:discount_amount]
parameters[:ships_from_postal_code] = options[:ships_from_postal_code] if options[:ships_from_postal_code]

if options[:line_items]
items = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that line_items ever comes in as something other than an array? That's really the only reason I could see for keeping this. If not, 👍

Copy link
Contributor Author

@curiousepic curiousepic Jan 3, 2019

Choose a reason for hiding this comment

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

It's probably unlikely, but if it's not, it will cause a descriptive gateway error rather than an AM error, so I'm ok with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most other adapters follow this pattern instead.

whitby3001 pushed a commit to whitby3001/active_merchant that referenced this pull request Sep 3, 2019
Removed hilariously redundant code.

Closes activemerchant#3100

Unit:
57 tests, 150 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
68 tests, 384 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% 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