dannysmith_coolpay 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coolpay/connection.rb +6 -2
- data/lib/coolpay/payment.rb +3 -3
- data/lib/coolpay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c2cc7fbde21bc7945cf7f7c824452b9022d2a6a
|
4
|
+
data.tar.gz: 5a8e4b7c69e0ddf71d76b062da345e6a8926a4ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 754616045723fe681e3504a03d39031a33e1d5103ed02dc94feb2c04c1a3a400adaa9993c1e1cf87b3b6159c31d359cde9ef586e0b7350febc82d1db7efa3373
|
7
|
+
data.tar.gz: 1f91a1b05871c8dd12e420859825a19815bfd7565718fd19b2febc08ea07b27e01eca2d6d6a88563960e4be7493b0eb5835db6c66bf4087ea7cbd252d5935929
|
data/lib/coolpay/connection.rb
CHANGED
@@ -36,7 +36,7 @@ module Coolpay
|
|
36
36
|
if res.code == 201
|
37
37
|
Payment.new(
|
38
38
|
amount: res['payment']['amount'],
|
39
|
-
|
39
|
+
recipient: find_recipient_by_id(res['payment']['recipient_id']),
|
40
40
|
id: res['payment']['id'],
|
41
41
|
currency: res['payment']['currency'],
|
42
42
|
status: res['payment']['status']
|
@@ -50,7 +50,7 @@ module Coolpay
|
|
50
50
|
res['payments'].map{ |r| Payment.new(
|
51
51
|
id: r['id'],
|
52
52
|
amount: r['amount'],
|
53
|
-
|
53
|
+
recipient: find_recipient_by_id(r['recipient_id']),
|
54
54
|
status: r['status'],
|
55
55
|
currency: r['currency']
|
56
56
|
) }
|
@@ -59,6 +59,10 @@ module Coolpay
|
|
59
59
|
|
60
60
|
private
|
61
61
|
|
62
|
+
def find_recipient_by_id(id)
|
63
|
+
recipients.select{|r| r.id == id}[0]
|
64
|
+
end
|
65
|
+
|
62
66
|
def url(path)
|
63
67
|
"#{@api_endpoint_url}#{path}"
|
64
68
|
end
|
data/lib/coolpay/payment.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Coolpay
|
2
2
|
class Payment
|
3
|
-
attr_reader :id, :amount, :currency, :
|
4
|
-
def initialize(id:,amount:,currency:,
|
3
|
+
attr_reader :id, :amount, :currency, :recipient, :status
|
4
|
+
def initialize(id:,amount:,currency:,recipient:,status:)
|
5
5
|
@id = id
|
6
6
|
@amount = amount
|
7
7
|
@currency = currency
|
8
|
-
@
|
8
|
+
@recipient = recipient
|
9
9
|
@status = status
|
10
10
|
end
|
11
11
|
end
|
data/lib/coolpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dannysmith_coolpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|