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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1a53dc2a4a294db60c0a05a05d3057d4ed1c4e5
4
- data.tar.gz: 8c527ebd746f2d260190a0b2880fb3c4b30e7c50
3
+ metadata.gz: 2a2d8cc60475654e120600be9bd6d64de952ed37
4
+ data.tar.gz: c16e2cd033c97a060f456f332867bf3a09b11749
5
5
  SHA512:
6
- metadata.gz: 38ba2589368f8aac7c0c50aaca236e21dcb838e2c416547ca9bf58b35d3e636ab460fd8dbd6c72743b6549f9c76a9e974487b36fdf16c5c5d2c176e7a1a83406
7
- data.tar.gz: 9796f632ef880e92ff343bcb0433ad4aa5f44d83275d59623e6155cafba1c0f1a0a7b55611abb65043143ec585d9c6edcb0c86bf46a20ed93aefca046f2456c0
6
+ metadata.gz: 80ab6adb8185fb7f5cd4cef096bb598b6810013c7e54bb0c87f086d1d87cbc42bf20be02bd02df9cb37e7e3ca9bd0bea5b624c27b596cb299ad0639f5f1f335e
7
+ data.tar.gz: acb72515339b9cbee45f0c07b46cbeaf7e080cb13dd01fd24dd5c08f5c433e6fe4ab9080869d6e1fcd78636858cb25c5042a8777d22396873d1781251efbf47c
@@ -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
@@ -1,3 +1,7 @@
1
+ # v0.2.1 / 2015-10-14
2
+
3
+ Fill id and email from devise current_user automatically.
4
+
1
5
  # v0.2.0 / 2015-10-13
2
6
 
3
7
  Upgrade to support fakesite v0.2.0.
@@ -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.0"
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"
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Fakesite
2
2
  module Alipay
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  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.0
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-13 00:00:00.000000000 Z
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.0
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.0
26
+ version: 0.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: webmock
29
29
  requirement: !ruby/object:Gem::Requirement