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

BlueSnap: Default to not send amount on capture #3270

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

molbrown
Copy link
Contributor

Including an amount on capture can cause an issue if attempting to
capture full amount authorized and there are slight differences in
amount requested and amount actually authorized due to currency
exchange. BlueSnap will capture full amount authorized if no amount is
included in the capture request. Adds a flag for including the amount
only in the case of partial capture.

Continues ECS-454
Relates to ECS-430

Unit:
27 tests, 110 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
35 tests, 109 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

@molbrown molbrown requested a review from a team July 10, 2019 13:32
@curiousepic
Copy link
Contributor

curiousepic commented Jul 10, 2019

Unless we are defining the word differently, there doesn't currently seem to be a flag involved here. I was expecting a new option that activates the conditional for only including it in partial captures. I think we would want an actual flag, since AFAICT most adapters' capture methods seem to expect that an amount argument is present.

@molbrown molbrown force-pushed the ECS-454_bluesnap_amount branch from 5fa2d87 to dc52872 Compare July 10, 2019 18:35
@@ -95,7 +95,7 @@ def capture(money, authorization, options={})
commit(:capture, :put) do |doc|
add_authorization(doc, authorization)
add_order(doc, options)
add_amount(doc, money, options)
add_amount(doc, money, options) if options[:partial_amount] == true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@curiousepic I believe I addressed what you were talking about, let me know if I missed what you meant.

Copy link
Contributor

@curiousepic curiousepic Jul 10, 2019

Choose a reason for hiding this comment

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

Wow, I'm sorry, in fact I just misunderstood the original, it was fine, but it brings up a concern - the option name could be more explicit, since "amount" kinda implies it should be a the actual amount, rather than a boolean flag. Perhaps "partial_capture" or "capture_partial_amount", or even "include_capture_amount" (since it doesn't necessarily need to be partial)...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confusion is never a good sign. I think I like include_capture_amount since it is the most descriptive of what is happening here. I have re-named it so.

@molbrown molbrown force-pushed the ECS-454_bluesnap_amount branch from dc52872 to ba42c50 Compare July 10, 2019 19:15
Copy link
Contributor

@curiousepic curiousepic left a comment

Choose a reason for hiding this comment

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

👍

@molbrown molbrown force-pushed the ECS-454_bluesnap_amount branch from ba42c50 to 72709a7 Compare July 15, 2019 16:50
Including an amount on capture can cause an issue if attempting to
capture full amount authorized and there are slight differences in
amount requested and amount actually authorized due to currency
exchange. BlueSnap will capture full amount authorized if no amount is
included in the capture request. Adds a flag for including the amount
only in the case of partial capture.

Continues ECS-454
Relates to ECS-430

Unit:
27 tests, 110 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
35 tests, 109 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@molbrown molbrown force-pushed the ECS-454_bluesnap_amount branch from 72709a7 to c120007 Compare July 16, 2019 13:55
@molbrown molbrown merged commit c120007 into activemerchant:master Jul 16, 2019
@molbrown molbrown deleted the ECS-454_bluesnap_amount branch July 16, 2019 18:39
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