payjp 0.0.10 → 0.0.12
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: e04927ede4192a112eada01f9cbed0446c5be53239fa4e6a0ad0428e7bc5f223
|
4
|
+
data.tar.gz: 255cb29b0aaa221b636c2bac80e4076e3847581511d115593c7fd6e835f38f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dca21abfcb1d46a5da179129c6331cb0ed47c32601e1c144dc76d549a6d04a11294e198c2c8e0ab637c396620492a75a3e00aed74b0f6919c9a55aa694cd669
|
7
|
+
data.tar.gz: ffbeed6e352fe7ff832f375e335877c184e0b136cba6df6df97fe502ae56fd6c961092f3125c7286ffef8315f9579e25b9b2d8972945d3c51b5c1981150294e1
|
@@ -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 create_statement_urls(params = {}, opts = {})
|
6
|
+
response, opts = request(:post, create_statement_urls_url, params, opts)
|
7
|
+
response
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def create_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 "create_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.create_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.12
|
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: 2023-11-17 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
|