yordex 0.0.6 → 0.0.7
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/yordex.rb +64 -50
- 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: 4d7a32fd30d1990d018a2cc4a9fa31cc5c0b3f44
|
|
4
|
+
data.tar.gz: ef445108a290bbffb9d4cec43a1156eaaae6d28d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6fd5d1b67f38a519a82ea93f6ca38c10871609c3722a10db33e23c85d585ac0368a091b240e51f0d4cdbbaa2d2298cc6adbc95ae3e71af83f259de15457ebd40
|
|
7
|
+
data.tar.gz: dbfd45c1c212e807ec7c289cd9b6fb093fb507e2bed60fc9bf2819ad412a5d5827c3625ac508470421be3d8dd6a99a7afc3c0cdfe5db372b2253f97ecc957fc7
|
data/lib/yordex.rb
CHANGED
|
@@ -75,55 +75,63 @@ class Yordex
|
|
|
75
75
|
return master_http(@@api_base+"/orders/#{order_id}", "get", {'Authorization'=>@@api_key})
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
def create_trader(
|
|
79
|
-
return master_http(@@api_base+"/traders", "post",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
def create_trader(partner_id, email, password, company_name, company_address_1, company_city, company_country_code, company_postal_code)
|
|
79
|
+
return master_http(@@api_base+"/traders", "post",
|
|
80
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json', 'Accept'=>'application/json'},
|
|
81
|
+
{
|
|
82
|
+
"partnerId"=>partner_id,
|
|
83
|
+
"user" =>{
|
|
84
|
+
"email"=>email,
|
|
85
|
+
"password"=>password
|
|
86
|
+
},
|
|
87
|
+
"companyTradingName"=>company_name,
|
|
88
|
+
"companyTradingAddress"=> {
|
|
89
|
+
"address1"=>company_address_1,
|
|
90
|
+
"city"=>company_city,
|
|
91
|
+
"countryCode"=>company_country_code,
|
|
92
|
+
"postalCode"=>company_postal_code
|
|
93
|
+
}
|
|
94
|
+
})
|
|
93
95
|
end
|
|
94
96
|
|
|
95
97
|
def update_trader(trader_id, company_name, address_1, city, country_code, postal_code)
|
|
96
|
-
return master_http(@@api_base+"/traders/"+trader_id, "put",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
return master_http(@@api_base+"/traders/"+trader_id, "put",
|
|
99
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json', 'Accept'=>'application/json'},
|
|
100
|
+
{
|
|
101
|
+
"companyTradingName"=>company_name,
|
|
102
|
+
"companyTradingAddress"=> {
|
|
103
|
+
"address1"=>address_1,
|
|
104
|
+
"city"=>city,
|
|
105
|
+
"countryCode"=>country_code,
|
|
106
|
+
"postalCode"=>postal_code
|
|
107
|
+
}
|
|
108
|
+
})
|
|
105
109
|
end
|
|
106
110
|
|
|
107
111
|
def create_order(buyer_id, seller_id, description, order_amount_in_cents, order_currency, terms)
|
|
108
|
-
return master_http(@@api_base+"/orders", "post",
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
return master_http(@@api_base+"/orders", "post",
|
|
113
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json'},
|
|
114
|
+
{
|
|
115
|
+
"buyerId"=>buyer_id,
|
|
116
|
+
"sellerId"=>seller_id,
|
|
117
|
+
"description"=>description,
|
|
118
|
+
"orderAmountInCents"=>order_amount_in_cents,
|
|
119
|
+
"orderCurrency"=>order_currency,
|
|
120
|
+
"terms"=>terms
|
|
121
|
+
})
|
|
116
122
|
end
|
|
117
123
|
|
|
118
124
|
def update_order(order_id, buyer_id, seller_id, description, order_amount_in_cents, order_currency, terms)
|
|
119
|
-
return master_http(@@api_base+"/orders/"+order_id, "put",
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
return master_http(@@api_base+"/orders/"+order_id, "put",
|
|
126
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json'},
|
|
127
|
+
{
|
|
128
|
+
"buyerId"=>buyer_id,
|
|
129
|
+
"sellerId"=>seller_id,
|
|
130
|
+
"description"=>description,
|
|
131
|
+
"orderAmountInCents"=>order_amount_in_cents,
|
|
132
|
+
"orderCurrency"=>order_currency,
|
|
133
|
+
"terms"=>terms
|
|
134
|
+
})
|
|
127
135
|
end
|
|
128
136
|
|
|
129
137
|
def open_order(order_id)
|
|
@@ -135,15 +143,19 @@ class Yordex
|
|
|
135
143
|
end
|
|
136
144
|
|
|
137
145
|
def approve_order(order_id)
|
|
138
|
-
return master_http(@@api_base+"/orders/"+order_id+"/approvals", "post",
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
return master_http(@@api_base+"/orders/"+order_id+"/approvals", "post",
|
|
147
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json'},
|
|
148
|
+
{
|
|
149
|
+
"approved"=>true
|
|
150
|
+
})
|
|
141
151
|
end
|
|
142
152
|
|
|
143
153
|
def reject_order(order_id)
|
|
144
|
-
return master_http(@@api_base+"/orders/"+order_id+"/approvals", "post",
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
return master_http(@@api_base+"/orders/"+order_id+"/approvals", "post",
|
|
155
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json'},
|
|
156
|
+
{
|
|
157
|
+
"approved"=>false
|
|
158
|
+
})
|
|
147
159
|
end
|
|
148
160
|
|
|
149
161
|
def request_advertisements(order_id)
|
|
@@ -163,10 +175,12 @@ class Yordex
|
|
|
163
175
|
end
|
|
164
176
|
|
|
165
177
|
def get_sso_token(uri="/orders/order-id", redirect_url="your-redirect-url")
|
|
166
|
-
return master_http(@@api_base+"/ssotokens", "post",
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
return master_http(@@api_base+"/ssotokens", "post",
|
|
179
|
+
{'Authorization'=>@@api_key, 'Content-type'=>'application/json'},
|
|
180
|
+
{
|
|
181
|
+
"uri"=>uri,
|
|
182
|
+
"redirectUrl"=>redirect_url
|
|
183
|
+
})
|
|
170
184
|
end
|
|
171
185
|
|
|
172
186
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yordex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Odendaal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-08-
|
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Yordex Ruby Gem
|
|
14
14
|
email: andrew@hsmoore.com
|