Skip to content

Commit

Permalink
Merge pull request #34 from payjp/feature/add-balance-statement-urls
Browse files Browse the repository at this point in the history
add statement_urls method
  • Loading branch information
niheeeee authored May 14, 2024
2 parents dc7b73b + 54278a9 commit 0d00b0a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/payjp/balance.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
module Payjp
class Balance < APIResource
include Payjp::APIOperations::List

def statement_urls(params = {}, opts = {})
response, opts = request(:post, statement_urls_url, params, opts)
response
end

private

def statement_urls_url
url + '/statement_urls'
end
end
end
2 changes: 1 addition & 1 deletion lib/payjp/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Payjp
VERSION = '0.0.14'
VERSION = '0.0.15'
end
8 changes: 8 additions & 0 deletions test/payjp/balance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@ class BalanceTest < Test::Unit::TestCase
balance.delete
end
end

should "statement_urls should be callable" do
@mock.expects(:get).never
@mock.expects(:post).once.returns(test_response({ :object => "statement_url", :url => 'https://pay.jp/_/statements/8f9ec721bc734dbcxxxxxxxxxxxxxxxx', :expires => 1476676539 }))
c = Payjp::Statement.new('st_test')
response = c.statement_urls()
assert_equal response[:url], 'https://pay.jp/_/statements/8f9ec721bc734dbcxxxxxxxxxxxxxxxx'
end
end
end

0 comments on commit 0d00b0a

Please sign in to comment.