payjp 0.0.10 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby-publish.yml +24 -0
- data/.github/workflows/test.yml +2 -2
- data/.gitignore +0 -0
- data/.rubocop.yml +0 -0
- data/.rubocop_todo.yml +0 -0
- data/CONTRIBUTORS +0 -0
- data/Gemfile +0 -0
- data/History.txt +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/lib/payjp/account.rb +0 -0
- data/lib/payjp/api_operations/create.rb +0 -0
- data/lib/payjp/api_operations/delete.rb +0 -0
- data/lib/payjp/api_operations/list.rb +0 -0
- data/lib/payjp/api_operations/request.rb +0 -0
- data/lib/payjp/api_operations/update.rb +0 -0
- data/lib/payjp/api_resource.rb +0 -0
- data/lib/payjp/card.rb +0 -0
- data/lib/payjp/charge.rb +0 -0
- data/lib/payjp/customer.rb +0 -0
- data/lib/payjp/errors/api_connection_error.rb +0 -0
- data/lib/payjp/errors/api_error.rb +0 -0
- data/lib/payjp/errors/authentication_error.rb +0 -0
- data/lib/payjp/errors/card_error.rb +0 -0
- data/lib/payjp/errors/invalid_request_error.rb +0 -0
- data/lib/payjp/errors/payjp_error.rb +0 -0
- data/lib/payjp/event.rb +0 -0
- data/lib/payjp/list_object.rb +0 -0
- data/lib/payjp/payjp_object.rb +0 -0
- data/lib/payjp/plan.rb +0 -0
- data/lib/payjp/statement.rb +16 -0
- data/lib/payjp/subscription.rb +0 -0
- data/lib/payjp/tenant.rb +0 -0
- data/lib/payjp/token.rb +0 -0
- data/lib/payjp/transfer.rb +0 -0
- data/lib/payjp/util.rb +1 -0
- data/lib/payjp/version.rb +1 -1
- data/lib/payjp.rb +1 -0
- data/payjp.gemspec +0 -0
- data/test/payjp/account_test.rb +0 -0
- data/test/payjp/api_resource_test.rb +0 -0
- data/test/payjp/charge_test.rb +0 -0
- data/test/payjp/customer_card_test.rb +0 -0
- data/test/payjp/customer_test.rb +0 -0
- data/test/payjp/event_test.rb +0 -0
- data/test/payjp/list_object_test.rb +0 -0
- data/test/payjp/metadata_test.rb +0 -0
- data/test/payjp/payjp_object_test.rb +0 -0
- data/test/payjp/plan_test.rb +0 -0
- data/test/payjp/statement_test.rb +33 -0
- data/test/payjp/subscription_test.rb +0 -0
- data/test/payjp/tenant_test.rb +0 -0
- data/test/payjp/token_test.rb +0 -0
- data/test/payjp/transfer_test.rb +0 -0
- data/test/payjp/util_test.rb +0 -0
- data/test/test_data.rb +47 -1
- data/test/test_helper.rb +0 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0270ff64998ad57112bcf113594f8db36b931f1d1dd468dbd3bae4e1c16eb70
|
4
|
+
data.tar.gz: c0e32cbbb9b0ee609c4ff0e30f2621367d61a74276f819a2abfdf754bf4e62a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c45bd79ebfc04ac60497e4c7b844f060eb5acf6148fde65d27dd97d64dd81bd6712b4be4d98f9f1e072ca313d1afbcc1491a69d367b3b393571a811226c568c5
|
7
|
+
data.tar.gz: 9aaf07bc44d9002f5957bf73df57c5778700d7b0932968cafb22bba89e189e55ab0d83c5e5c3e4fab4891eef2b668098c851c034fa9f171c82bcf10c7f11530f
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Publish Ruby Package
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [published]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
deploy:
|
9
|
+
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v3
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: '2.7'
|
18
|
+
bundler-cache: true
|
19
|
+
- name: Build and publish
|
20
|
+
env:
|
21
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
22
|
+
run: |
|
23
|
+
bundle exec rake build
|
24
|
+
bundle exec gem push pkg/payjp-*.gem
|
data/.github/workflows/test.yml
CHANGED
@@ -5,12 +5,12 @@ on: push
|
|
5
5
|
jobs:
|
6
6
|
build-test:
|
7
7
|
|
8
|
-
runs-on: ubuntu-
|
8
|
+
runs-on: ubuntu-20.04
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
11
|
ruby-version: [2.0.0, 2.1, 2.2, 2.3.0, 2.7.0, jruby-9.2.17.0]
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v3
|
14
14
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
data/.gitignore
CHANGED
File without changes
|
data/.rubocop.yml
CHANGED
File without changes
|
data/.rubocop_todo.yml
CHANGED
File without changes
|
data/CONTRIBUTORS
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/History.txt
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/lib/payjp/account.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/payjp/api_resource.rb
CHANGED
File without changes
|
data/lib/payjp/card.rb
CHANGED
File without changes
|
data/lib/payjp/charge.rb
CHANGED
File without changes
|
data/lib/payjp/customer.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/payjp/event.rb
CHANGED
File without changes
|
data/lib/payjp/list_object.rb
CHANGED
File without changes
|
data/lib/payjp/payjp_object.rb
CHANGED
File without changes
|
data/lib/payjp/plan.rb
CHANGED
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Payjp
|
2
|
+
class Statement < APIResource
|
3
|
+
include Payjp::APIOperations::List
|
4
|
+
|
5
|
+
def statement_urls(params = {}, opts = {})
|
6
|
+
response, opts = request(:post, statement_urls_url, params, opts)
|
7
|
+
response
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def statement_urls_url
|
13
|
+
url + '/statement_urls'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/payjp/subscription.rb
CHANGED
File without changes
|
data/lib/payjp/tenant.rb
CHANGED
File without changes
|
data/lib/payjp/token.rb
CHANGED
File without changes
|
data/lib/payjp/transfer.rb
CHANGED
File without changes
|
data/lib/payjp/util.rb
CHANGED
data/lib/payjp/version.rb
CHANGED
data/lib/payjp.rb
CHANGED
data/payjp.gemspec
CHANGED
File without changes
|
data/test/payjp/account_test.rb
CHANGED
File without changes
|
File without changes
|
data/test/payjp/charge_test.rb
CHANGED
File without changes
|
File without changes
|
data/test/payjp/customer_test.rb
CHANGED
File without changes
|
data/test/payjp/event_test.rb
CHANGED
File without changes
|
File without changes
|
data/test/payjp/metadata_test.rb
CHANGED
File without changes
|
File without changes
|
data/test/payjp/plan_test.rb
CHANGED
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
|
3
|
+
module Payjp
|
4
|
+
class StatementTest < Test::Unit::TestCase
|
5
|
+
should "statement should be listable" do
|
6
|
+
@mock.expects(:get).once.returns(test_response(test_statement_array))
|
7
|
+
statements = Payjp::Statement.all.data
|
8
|
+
assert statements.is_a? Array
|
9
|
+
assert statements[0].is_a? Payjp::Statement
|
10
|
+
end
|
11
|
+
|
12
|
+
should "be retrievable" do
|
13
|
+
@mock.expects(:get).once.returns(test_response(test_statement))
|
14
|
+
statement = Payjp::Statement.retrieve('st_test')
|
15
|
+
assert statement.is_a? Payjp::Statement
|
16
|
+
assert_equal 'st_test', statement.id
|
17
|
+
assert_equal 'statement', statement.object
|
18
|
+
assert statement.to_hash.has_key?(:items)
|
19
|
+
assert statement.items[0].to_hash.has_key?(:amount)
|
20
|
+
assert statement.items[0].to_hash.has_key?(:name)
|
21
|
+
assert statement.items[0].to_hash.has_key?(:subject)
|
22
|
+
assert statement.items[0].to_hash.has_key?(:tax_rate)
|
23
|
+
end
|
24
|
+
|
25
|
+
should "statement_urls should be callable" do
|
26
|
+
@mock.expects(:get).never
|
27
|
+
@mock.expects(:post).once.returns(test_response({ :object => "statement_url", :url => 'https://pay.jp/_/statements/8f9ec721bc734dbcxxxxxxxxxxxxxxxx', :expires => 1476676539 }))
|
28
|
+
c = Payjp::Statement.new('st_test')
|
29
|
+
response = c.statement_urls()
|
30
|
+
assert_equal response[:url], 'https://pay.jp/_/statements/8f9ec721bc734dbcxxxxxxxxxxxxxxxx'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
File without changes
|
data/test/payjp/tenant_test.rb
CHANGED
File without changes
|
data/test/payjp/token_test.rb
CHANGED
File without changes
|
data/test/payjp/transfer_test.rb
CHANGED
File without changes
|
data/test/payjp/util_test.rb
CHANGED
File without changes
|
data/test/test_data.rb
CHANGED
@@ -235,7 +235,9 @@ module Payjp
|
|
235
235
|
:charge_gross => 1000,
|
236
236
|
:net => 1000,
|
237
237
|
:refund_amount => 0,
|
238
|
-
:refund_count => 0
|
238
|
+
:refund_count => 0,
|
239
|
+
:dispute_amount => 0,
|
240
|
+
:dispute_count => 0
|
239
241
|
},
|
240
242
|
:metadata => {}
|
241
243
|
}.merge(params)
|
@@ -325,5 +327,49 @@ module Payjp
|
|
325
327
|
}
|
326
328
|
}
|
327
329
|
end
|
330
|
+
|
331
|
+
def test_statement(params = {})
|
332
|
+
{
|
333
|
+
:created => 1695620296,
|
334
|
+
:id => "st_test",
|
335
|
+
:items => [
|
336
|
+
{
|
337
|
+
:amount => 282358654,
|
338
|
+
:name => "売上",
|
339
|
+
:subject => "gross_sales",
|
340
|
+
:tax_rate => "0.00"
|
341
|
+
},
|
342
|
+
{
|
343
|
+
:amount => -65699624,
|
344
|
+
:name => "返金",
|
345
|
+
:subject => "gross_refund",
|
346
|
+
:tax_rate => "0.00"
|
347
|
+
},
|
348
|
+
{
|
349
|
+
:amount => -7054912,
|
350
|
+
:name => "決済手数料",
|
351
|
+
:subject => "fee",
|
352
|
+
:tax_rate => "0.10"
|
353
|
+
},
|
354
|
+
{
|
355
|
+
:amount => 1644315,
|
356
|
+
:name => "返金による手数料返還",
|
357
|
+
:subject => "refund_fee_offset",
|
358
|
+
:tax_rate => "0.10"
|
359
|
+
}
|
360
|
+
],
|
361
|
+
:object => "statement",
|
362
|
+
:title => nil
|
363
|
+
}.merge(params)
|
364
|
+
end
|
365
|
+
|
366
|
+
def test_statement_array
|
367
|
+
{
|
368
|
+
:count => 2,
|
369
|
+
:data => [test_statement, test_statement],
|
370
|
+
:object => 'list',
|
371
|
+
:url => '/v1/statements'
|
372
|
+
}
|
373
|
+
end
|
328
374
|
end
|
329
375
|
end
|
data/test/test_helper.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payjp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PAY.JP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -107,6 +107,7 @@ executables: []
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
+
- ".github/workflows/ruby-publish.yml"
|
110
111
|
- ".github/workflows/test.yml"
|
111
112
|
- ".gitignore"
|
112
113
|
- ".rubocop.yml"
|
@@ -138,6 +139,7 @@ files:
|
|
138
139
|
- lib/payjp/list_object.rb
|
139
140
|
- lib/payjp/payjp_object.rb
|
140
141
|
- lib/payjp/plan.rb
|
142
|
+
- lib/payjp/statement.rb
|
141
143
|
- lib/payjp/subscription.rb
|
142
144
|
- lib/payjp/tenant.rb
|
143
145
|
- lib/payjp/token.rb
|
@@ -155,6 +157,7 @@ files:
|
|
155
157
|
- test/payjp/metadata_test.rb
|
156
158
|
- test/payjp/payjp_object_test.rb
|
157
159
|
- test/payjp/plan_test.rb
|
160
|
+
- test/payjp/statement_test.rb
|
158
161
|
- test/payjp/subscription_test.rb
|
159
162
|
- test/payjp/tenant_test.rb
|
160
163
|
- test/payjp/token_test.rb
|
@@ -182,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
185
|
- !ruby/object:Gem::Version
|
183
186
|
version: '0'
|
184
187
|
requirements: []
|
185
|
-
rubygems_version: 3.1.
|
188
|
+
rubygems_version: 3.1.6
|
186
189
|
signing_key:
|
187
190
|
specification_version: 4
|
188
191
|
summary: Ruby bindings for the Payjp API
|
@@ -197,6 +200,7 @@ test_files:
|
|
197
200
|
- test/payjp/metadata_test.rb
|
198
201
|
- test/payjp/payjp_object_test.rb
|
199
202
|
- test/payjp/plan_test.rb
|
203
|
+
- test/payjp/statement_test.rb
|
200
204
|
- test/payjp/subscription_test.rb
|
201
205
|
- test/payjp/tenant_test.rb
|
202
206
|
- test/payjp/token_test.rb
|