payjp_mock 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/payjp_mock.rb +2 -1
- data/lib/payjp_mock/ext.rb +3 -0
- data/lib/payjp_mock/ext/hash.rb +7 -5
- data/lib/payjp_mock/ext/integer.rb +8 -6
- data/lib/payjp_mock/request_builder.rb +1 -5
- data/lib/payjp_mock/response/resource/base.rb +1 -3
- data/lib/payjp_mock/response/resource/subscription.rb +2 -0
- data/lib/payjp_mock/response/resource/transfer.rb +2 -0
- data/lib/payjp_mock/version.rb +1 -1
- data/lib/payjp_mock/webmock_wrapper.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 781df7ed343c3d3d363d3c94cb1f6c27946b93d2
|
4
|
+
data.tar.gz: b90ae66c681c1b4650d1668f8d89c54da3cdd608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4213de616fc6ba5d3b6420171700e4c9426011921720f64b472de97843213794b5c6f2d82253d39ef91e8c6abb16fc3dd21d32eb48b8d77174d6a7b61f5e6c2
|
7
|
+
data.tar.gz: fbd868f91ab569b0fc8dc168ede3eef25b494fbcf42b9e132a0c1a2d9c474d7d7df5a03bc36648fd4f318c54b7726ba4e41cf2f123ff25f39e88b9a41e25b618
|
data/README.md
CHANGED
@@ -40,7 +40,7 @@ specify do
|
|
40
40
|
payjp_stub(:charges, :create)
|
41
41
|
Payjp::Charge.create(amount: 3500, card: 'tok_xxxxx', currency: 'jpy')
|
42
42
|
|
43
|
-
# Stubbing nested
|
43
|
+
# Stubbing nested resource operations such as customer's card list retrival
|
44
44
|
payjp_stub(:customer, :retrival)
|
45
45
|
customer = Payjp::Customer.retrieve('cus_xxxxx')
|
46
46
|
|
data/lib/payjp_mock.rb
CHANGED
@@ -2,9 +2,10 @@ module PayjpMock
|
|
2
2
|
end
|
3
3
|
|
4
4
|
require 'payjp_mock/ext'
|
5
|
+
require 'payjp_mock/util'
|
6
|
+
|
5
7
|
require 'payjp_mock/request'
|
6
8
|
require 'payjp_mock/request_builder'
|
7
9
|
require 'payjp_mock/response'
|
8
|
-
require 'payjp_mock/util'
|
9
10
|
require 'payjp_mock/webmock_wrapper'
|
10
11
|
require 'payjp_mock/version'
|
data/lib/payjp_mock/ext.rb
CHANGED
data/lib/payjp_mock/ext/hash.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
1
|
+
module PayjpMock::Ext
|
2
|
+
module Hash
|
3
|
+
refine ::Hash do
|
4
|
+
def symbolize_keys
|
5
|
+
each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
6
|
+
end
|
7
|
+
end
|
4
8
|
end
|
5
9
|
end
|
6
|
-
|
7
|
-
Hash.send(:include, HashExtension)
|
@@ -1,8 +1,10 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
1
|
+
module PayjpMock::Ext
|
2
|
+
module Integer
|
3
|
+
refine ::Integer do
|
4
|
+
def days
|
5
|
+
self * 24 * 60 * 60
|
6
|
+
end
|
7
|
+
alias :day :days
|
8
|
+
end
|
4
9
|
end
|
5
|
-
alias :day :days
|
6
10
|
end
|
7
|
-
|
8
|
-
Integer.send(:include, IntegerExtension)
|
@@ -1,11 +1,7 @@
|
|
1
|
-
require 'payjp_mock/ext/hash'
|
2
|
-
require 'payjp_mock/request'
|
3
|
-
require 'payjp_mock/response'
|
4
|
-
require 'payjp_mock/util'
|
5
|
-
|
6
1
|
module PayjpMock
|
7
2
|
class RequestBuilder
|
8
3
|
include Util
|
4
|
+
using Ext::Hash
|
9
5
|
|
10
6
|
def initialize(resource, operation, error)
|
11
7
|
@resource = resource.is_a?(Hash) ? resource.symbolize_keys : resource.to_sym
|
data/lib/payjp_mock/version.rb
CHANGED