promise_pay 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/promise_pay/session.rb +8 -8
- data/lib/promise_pay/version.rb +1 -1
- data/spec/promise_pay/session_spec.rb +4 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4373889188b8b2e732056ea576cac6f99f6555a3
|
4
|
+
data.tar.gz: 1c6d260ac346d047c2c5268cf627651b8b874bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ebd242425d43e05f54da87d5a8cc0662f48db1b80c30a03aaa7b0d4ef5ba0dc728d219e9c949dab44cc978c35c52d285372ee1f15fb2bf0707ef902dc83da6e
|
7
|
+
data.tar.gz: bf7ae8865690dfa07f2f59fd3f7cd7618db48595215eae4455acbd913fe5b6c2cf0ae37b1ee5caa26d1d8214e5a3eee18d9b2b09a111d7753d6f7de5dfc44b94
|
data/lib/promise_pay/session.rb
CHANGED
@@ -6,7 +6,6 @@ module PromisePay
|
|
6
6
|
|
7
7
|
attr_reader :token
|
8
8
|
attr_accessor :current_user_id
|
9
|
-
attr_accessor :currency
|
10
9
|
attr_accessor :item_name
|
11
10
|
attr_accessor :amount
|
12
11
|
attr_accessor :seller_lastname
|
@@ -20,11 +19,11 @@ module PromisePay
|
|
20
19
|
attr_accessor :external_buyer_id
|
21
20
|
attr_accessor :fee_ids
|
22
21
|
attr_accessor :payment_type_id
|
23
|
-
attr_accessor :
|
22
|
+
attr_accessor :seller_country
|
23
|
+
attr_accessor :buyer_country
|
24
24
|
|
25
25
|
def initialize(options = {})
|
26
26
|
@current_user_id = options.fetch :current_user_id, nil
|
27
|
-
@currency = options.fetch :currency, nil
|
28
27
|
@item_name = options.fetch :item_name, nil
|
29
28
|
@amount = options.fetch :amount, nil
|
30
29
|
@seller_lastname = options.fetch :seller_lastname, nil
|
@@ -38,7 +37,8 @@ module PromisePay
|
|
38
37
|
@external_buyer_id = options.fetch :external_buyer_id, nil
|
39
38
|
@fee_ids = options.fetch :fee_ids, nil
|
40
39
|
@payment_type_id = options.fetch :payment_type_id, nil
|
41
|
-
@
|
40
|
+
@seller_country = options.fetch :seller_country, nil
|
41
|
+
@buyer_country = options.fetch :buyer_country, nil
|
42
42
|
end
|
43
43
|
|
44
44
|
def request_token
|
@@ -60,7 +60,6 @@ module PromisePay
|
|
60
60
|
def query_string
|
61
61
|
{
|
62
62
|
current_user_id: current_user_id,
|
63
|
-
currency: currency,
|
64
63
|
item_name: item_name,
|
65
64
|
amount: amount,
|
66
65
|
seller_lastname: seller_lastname,
|
@@ -74,7 +73,8 @@ module PromisePay
|
|
74
73
|
external_buyer_id: external_buyer_id,
|
75
74
|
fee_ids: fee_ids,
|
76
75
|
payment_type_id: payment_type_id,
|
77
|
-
|
76
|
+
seller_country: seller_country,
|
77
|
+
buyer_country: buyer_country
|
78
78
|
}.reject { |k,v| v.nil? }.to_param
|
79
79
|
end
|
80
80
|
|
@@ -89,7 +89,6 @@ module PromisePay
|
|
89
89
|
def required_params
|
90
90
|
[
|
91
91
|
:current_user_id,
|
92
|
-
:currency,
|
93
92
|
:item_name,
|
94
93
|
:amount,
|
95
94
|
:seller_firstname,
|
@@ -101,7 +100,8 @@ module PromisePay
|
|
101
100
|
:external_buyer_id,
|
102
101
|
:fee_ids,
|
103
102
|
:payment_type_id,
|
104
|
-
:
|
103
|
+
:seller_country,
|
104
|
+
:buyer_country
|
105
105
|
]
|
106
106
|
end
|
107
107
|
end
|
data/lib/promise_pay/version.rb
CHANGED
@@ -3,7 +3,6 @@ require "spec_helper"
|
|
3
3
|
describe PromisePay::Session do
|
4
4
|
valid_params = {
|
5
5
|
current_user_id: "1",
|
6
|
-
currency: "USD",
|
7
6
|
item_name: "ItemName",
|
8
7
|
amount: "10",
|
9
8
|
seller_firstname: "Alex",
|
@@ -17,7 +16,8 @@ describe PromisePay::Session do
|
|
17
16
|
external_buyer_id: "2",
|
18
17
|
fee_ids: "3bfc26e3-093d-4f75-ac06-d2023294882b",
|
19
18
|
payment_type_id: "1",
|
20
|
-
|
19
|
+
buyer_country: "AUS",
|
20
|
+
seller_country: "USA"
|
21
21
|
}
|
22
22
|
|
23
23
|
let(:request) { double("RestClient::Request", execute: sample_response) }
|
@@ -51,7 +51,6 @@ describe PromisePay::Session do
|
|
51
51
|
required_params =
|
52
52
|
[
|
53
53
|
:current_user_id,
|
54
|
-
:currency,
|
55
54
|
:item_name,
|
56
55
|
:amount,
|
57
56
|
:seller_firstname,
|
@@ -63,7 +62,8 @@ describe PromisePay::Session do
|
|
63
62
|
:external_buyer_id,
|
64
63
|
:fee_ids,
|
65
64
|
:payment_type_id,
|
66
|
-
:
|
65
|
+
:buyer_country,
|
66
|
+
:seller_country
|
67
67
|
]
|
68
68
|
|
69
69
|
required_params.each do |param|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promise_pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Norton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.0.14
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: PromisePay gem
|
@@ -137,3 +137,4 @@ test_files:
|
|
137
137
|
- spec/support/fixtures/token_generation.json
|
138
138
|
- spec/support/fixtures/user/find.json
|
139
139
|
- spec/support/fixtures/user/find_all.json
|
140
|
+
has_rdoc:
|