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

Bambora Asia-Pacific: Adds Store #3147

Closed

Conversation

molbrown
Copy link
Contributor

ECS-159

Unit:
8 tests, 50 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
17 tests, 32 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

@molbrown molbrown force-pushed the ECS-159_Bambora_store branch from 861b6d3 to 672d8fe Compare February 21, 2019 21:38
@molbrown molbrown requested a review from a team February 21, 2019 21:38
@@ -82,6 +82,26 @@ def void(money, authorization, options={})
end
end

def verify(credit_card, options={})
MultiResponse.run(:use_first_response) do |r|
r.process { purchase(200, credit_card, options) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume 200 is it the minimum? If not, try 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to, but I could not get 100 or 0 to work. Voids only work on purchases, not auths, and it won't accept a $0 purchase. It seems that 100 is an amount that generates an error for tests ("declined_message"=>"Refer Card Issuer"), though that did not seem apparent in the docs. https://dev-apac.bambora.com/checkout/guides/get-up-and-running/test-your-setup

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 I wonder if an un-voided auth is preferable...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was having the same thought, it would be lame if the void fails, then there are random $2 purchases 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to a 0 un-voided auth.

Copy link
Contributor

@curiousepic curiousepic Feb 22, 2019

Choose a reason for hiding this comment

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

@molbrown Sorry for leaving this out initially, but there may be reasons that un-voided auths are undesirable as well. It should be fine if they are automatically canceled after a short time, but I can't tell if this is the case from their Docs. Any insight on 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.

I have contacted Bambora support about this, and have decided to remove verify from this commit and proceed without it. It will be added in once there is more information about how to best implement.

@molbrown molbrown force-pushed the ECS-159_Bambora_store branch from 672d8fe to 05f3ad6 Compare February 21, 2019 23:44
@curiousepic
Copy link
Contributor

curiousepic commented Feb 22, 2019

Not a big deal but it might be nice to pull out the endpoint determination (sipp or dts) into a method and set them as a variable in the urls instead of splitting and duplicating relevant actions into an if/else. Up to you.


response = @gateway.purchase(500, store_response.authorization, @options)
assert_success response
assert_equal '', response.message
Copy link
Contributor

@curiousepic curiousepic Feb 22, 2019

Choose a reason for hiding this comment

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

This is a little weird. We usually set the response's message to something like "Success" on success; let's add that to message_from.

@molbrown molbrown force-pushed the ECS-159_Bambora_store branch 2 times, most recently from f285968 to b74907c Compare February 25, 2019 20:11
@molbrown
Copy link
Contributor Author

Updated with some re-factoring around the endpoint determination, removes verify, adds Succeeded to message_from.

@molbrown molbrown requested a review from curiousepic February 25, 2019 20:15
@molbrown molbrown force-pushed the ECS-159_Bambora_store branch from b74907c to 06dd8ab Compare February 25, 2019 20:18
@molbrown molbrown changed the title Bambora Asia-Pacific: Adds Store and Verify Bambora Asia-Pacific: Adds Store Feb 25, 2019
end
end
end
end
xml.target!
end

def define_endpoint(action)
action == 'TokeniseCreditCard' ? '/sipp' : '/dts'
end
Copy link
Member

Choose a reason for hiding this comment

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

This won't hold up approval, just something to consider. I think I would name the function endpoint and avoid including the beginning forward slash in the return values - it was not immediately apparent when reviewing the URL's where it was or how it was included.

def endpoint(action)
  action == 'TokeniseCreditCard' ? 'sipp' : 'dts'
end

# Example usage
response = parse(ssl_post("#{commit_url}/#{endpoint(action)}.asmx", new_submit_xml(action, &block), headers))

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ECS-159

Unit:
7 tests, 47 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
15 tests, 30 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@molbrown molbrown force-pushed the ECS-159_Bambora_store branch from 06dd8ab to 2bb5b0f Compare February 25, 2019 20:50
@molbrown molbrown requested a review from jknipp February 25, 2019 21:52
Copy link
Member

@jknipp jknipp left a comment

Choose a reason for hiding this comment

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

👍 LGTM

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.

👍 Looks good.

@molbrown molbrown closed this in bbee8bc Feb 26, 2019
whitby3001 pushed a commit to whitby3001/active_merchant that referenced this pull request Sep 3, 2019
ECS-159

Unit:
7 tests, 47 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote:
15 tests, 30 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Closes activemerchant#3147
@molbrown molbrown deleted the ECS-159_Bambora_store branch July 1, 2020 18:41
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.

3 participants