[PinPayments] capture function with test cases - #147
Open
ravirocx wants to merge 25 commits into
Open
Conversation
`authorize/3` takes 3 parameters `amount`, `card` and `opts` addded documentations for `authorize/3` for merchants.
`def authorize(amount, card, opts) when is_binary(card) do`
…functions fucntions.
Codecov Report
@@ Coverage Diff @@
## pinpay #147 +/- ##
==========================================
+ Coverage 60.04% 66.07% +6.03%
==========================================
Files 15 15
Lines 498 510 +12
==========================================
+ Hits 299 337 +38
+ Misses 199 173 -26
Continue to review full report at Codecov.
|
oyeb
requested changes
Apr 9, 2018
| month: 12, | ||
| verification_code: "999", | ||
| brand: "VISA"} | ||
| iex> money = Money.new(10000, :USD) |
Contributor
There was a problem hiding this comment.
The doc says this example captures $10 but your Money struct indicates a capture of Ten Thousand dollars.
| |> respond | ||
| end | ||
|
|
||
| defp commit_short(method, url, opts) do |
Contributor
There was a problem hiding this comment.
Instead of a new function commit_short you should pattern match on the method, and keep the same function name: commit
| """ | ||
| @spec capture(String.t(), Money.t(), keyword) :: {:ok | :error, Response} | ||
| def capture(payment_id, amount, opts) do | ||
| url = @test_url <> "charges/" <> payment_id <> "/capture" |
Contributor
There was a problem hiding this comment.
It might be more readable if we use string interpolation here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PinPayments
capture/3
Implemented capture function:
Docs
Added docs for capture/3.
Tests
Added integration tests for capture/3, using ExVCR.