fakesite-alipay 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -9
- data/CHANGELOG.md +4 -0
- data/fakesite-alipay.gemspec +1 -1
- data/lib/fakesite/alipay/base.rb +16 -2
- data/lib/fakesite/alipay/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2d8cc60475654e120600be9bd6d64de952ed37
|
4
|
+
data.tar.gz: c16e2cd033c97a060f456f332867bf3a09b11749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ab6adb8185fb7f5cd4cef096bb598b6810013c7e54bb0c87f086d1d87cbc42bf20be02bd02df9cb37e7e3ca9bd0bea5b624c27b596cb299ad0639f5f1f335e
|
7
|
+
data.tar.gz: acb72515339b9cbee45f0c07b46cbeaf7e080cb13dd01fd24dd5c08f5c433e6fe4ab9080869d6e1fcd78636858cb25c5042a8777d22396873d1781251efbf47c
|
data/.travis.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.2.2
|
4
|
-
before_install: gem install bundler
|
5
|
-
branches:
|
6
|
-
only:
|
7
|
-
- master
|
8
|
-
env:
|
9
|
-
- COVERALLS=1
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.2.2
|
4
|
+
before_install: gem install bundler
|
5
|
+
branches:
|
6
|
+
only:
|
7
|
+
- master
|
8
|
+
env:
|
9
|
+
- COVERALLS=1
|
data/CHANGELOG.md
CHANGED
data/fakesite-alipay.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "fakesite", ">= 0.2.
|
20
|
+
spec.add_dependency "fakesite", ">= 0.2.1"
|
21
21
|
spec.add_dependency "webmock"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.10"
|
data/lib/fakesite/alipay/base.rb
CHANGED
@@ -8,8 +8,8 @@ module Fakesite
|
|
8
8
|
"trade_status" => 'TRADE_SUCCESS',
|
9
9
|
"trade_no" => Time.now.to_i.to_s,
|
10
10
|
"notify_id" => Time.now.to_i.to_s,
|
11
|
-
"buyer_email" =>
|
12
|
-
"buyer_id" =>
|
11
|
+
"buyer_email" => buyer_email,
|
12
|
+
"buyer_id" => buyer_id,
|
13
13
|
"exterface" => "create_direct_pay_by_user",
|
14
14
|
"notify_time" => (Time.now.utc + 28800).strftime("%Y-%m-%d %H:%M:%S")
|
15
15
|
}
|
@@ -22,6 +22,14 @@ module Fakesite
|
|
22
22
|
return params
|
23
23
|
end
|
24
24
|
|
25
|
+
def buyer_email
|
26
|
+
get_value(user, :email)
|
27
|
+
end
|
28
|
+
|
29
|
+
def buyer_id
|
30
|
+
get_value(user, :id)
|
31
|
+
end
|
32
|
+
|
25
33
|
def self.match(external_uri)
|
26
34
|
external_uri.host == Host
|
27
35
|
end
|
@@ -31,6 +39,12 @@ module Fakesite
|
|
31
39
|
.with(:query => hash_including({:service => 'notify_verify'}))
|
32
40
|
.to_return(:status => 200, :body => "true")
|
33
41
|
end
|
42
|
+
|
43
|
+
protected
|
44
|
+
|
45
|
+
def get_value(obj, attr_name)
|
46
|
+
!obj.nil? && obj.respond_to?(attr_name) ? obj.send(attr_name) : nil
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
36
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakesite-alipay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chen Yi-Cyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fakesite
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: webmock
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|