-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DEPRECATED: CybersourceREST - Refund | Credit #4696
DEPRECATED: CybersourceREST - Refund | Credit #4696
Conversation
CybersourceRest: adding gateway Summary: ------------------------------ Adding CybersourceRest gateway with authorize and purchase calls. GWI-474 Remote Test: ------------------------------ Finished in 3.6855 seconds. 6 tests, 17 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Unit Tests: ------------------------------ Finished in 35.528692 seconds. 5441 tests, 77085 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed RuboCop: ------------------------------ 760 files inspected, no offenses detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @sinourain
💡 I can see that the '/pts/v2/'
is repeated in each request, maybe we could remove it for each request and add it in the url function
Every commit call would be similar to
commit('/credits', post)
and in the url function concat /pts/v2/
def url(action)
"#{(test? ? test_url : live_url)}/pts/v2/#{action}"
end
also if you concider this update, you need to update this line in the get_http_signature
function
"(request-target)": "#{http_method} /pts/v2/#{resource}",
def refund(money, options = {}) | ||
post = build_refund_request(money, options) | ||
|
||
yield post if block_given? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Comment:
Unless this a copy-paste mistake, do you have a purpose for that yield
?, on authorize/purchase it had one but not sure here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was wrong copy / paste this approach and it is only necessary for the purchase/authorization methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sinourain left some comments,
def refund(money, options = {}) | ||
post = build_refund_request(money, options) | ||
|
||
yield post if block_given? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Comment:
Unless this a copy-paste mistake, do you have a purpose for that yield
?, on authorize/purchase it had one but not sure here ...
def credit(money, payment, options = {}) | ||
post = build_credit_request(money, payment, options) | ||
|
||
yield post if block_given? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Comment:
Same comment here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was wrong copy / paste this approach and it is only necessary for the purchase/authorization methods
add_code(post, options) | ||
add_credit_card(post, payment) | ||
add_amount(post, amount) | ||
add_address(post, payment, options[:billing_address], options, :billTo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Comment:
Seems that add_merchant_description
is missing here ... comparing the actual implementation against the old one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
assert_equal 'PENDING', response.message | ||
assert response.params['id'].present? | ||
assert_nil response.params['_links']['capture'] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Comment:
Maybe is a good idea to test not just the happy path:
- maybe checking how to handle error handling in case of a double refund
- doing partial refunds and values above the initial transaction
- credits on invalid credit cards
- etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Description ------------------------- This integration support the following payment operations: - Refund - Credit Unit test ------------------------- Finished in 37.39707 seconds. 5452 tests, 77126 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Remote test ------------------------- 145.79 tests/s, 2062.35 assertions/s Rubocop ------------------------- 760 files inspected, no offenses detected GWI-471
86556a2
to
e6ce0bf
Compare
72ba52f
to
729026a
Compare
I created a new PR because I made this based in my personal folk repository |
IMPORTANT NOTE: I will create a new PR because I made this based in my personal folk repository
Description
This integration support the following payment operations:
Unit test
Finished in 29.776044 seconds.
5452 tests, 77126 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote test
183.10 tests/s, 2590.20 assertions/s
Rubocop
760 files inspected, no offenses detected
GWI-471