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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yordex.rb +64 -50
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb659d725ec6f1f42807775c8e322c4dadaee663
4
- data.tar.gz: 85af0ecaf64ce5a3551634be6206ef16dbb9b15e
3
+ metadata.gz: 4d7a32fd30d1990d018a2cc4a9fa31cc5c0b3f44
4
+ data.tar.gz: ef445108a290bbffb9d4cec43a1156eaaae6d28d
5
5
  SHA512:
6
- metadata.gz: fc431909b2bef2771f4ba5dec443b49b89094203113d3b2e440468613f88004ef7a4b68640b0e1f26166addabc0d95a70f07a5a4c1591b7476cde18ae1081ee2
7
- data.tar.gz: beec5c7ff646c8d924d7954529596c1bd290f9c5ac31770136d27728e11ec43d3aa3269448bd6161cdd2f7d8f63d01737a85b2e02ee854b0365b62e814cef329
6
+ metadata.gz: 6fd5d1b67f38a519a82ea93f6ca38c10871609c3722a10db33e23c85d585ac0368a091b240e51f0d4cdbbaa2d2298cc6adbc95ae3e71af83f259de15457ebd40
7
+ data.tar.gz: dbfd45c1c212e807ec7c289cd9b6fb093fb507e2bed60fc9bf2819ad412a5d5827c3625ac508470421be3d8dd6a99a7afc3c0cdfe5db372b2253f97ecc957fc7
@@ -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(trader_id, email, password, company_name, company_address_1, company_city, company_country_code, company_postal_code)
79
- return master_http(@@api_base+"/traders", "post", {'Authorization'=>@@api_key, 'Content-type'=>'application/json', 'Accept'=>'application/json'}, {
80
- "traderId"=>trader_id,
81
- "user" =>{
82
- "email"=>email,
83
- "password"=>password
84
- },
85
- "companyTradingName"=>company_name,
86
- "companyTradingAddress"=> {
87
- "address1"=>company_address_1,
88
- "city"=>company_city,
89
- "countryCode"=>company_country_code,
90
- "postalCode"=>company_postal_code
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json', 'Accept'=>'application/json'}, {
97
- "companyTradingName"=>company_name,
98
- "companyTradingAddress"=> {
99
- "address1"=>address_1,
100
- "city"=>city,
101
- "countryCode"=>country_code,
102
- "postalCode"=>postal_code
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json'}, {
109
- "buyerId"=>buyer_id,
110
- "sellerId"=>seller_id,
111
- "description"=>description,
112
- "orderAmountInCents"=>order_amount_in_cents,
113
- "orderCurrency"=>order_currency,
114
- "terms"=>terms
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json'}, {
120
- "buyerId"=>buyer_id,
121
- "sellerId"=>seller_id,
122
- "description"=>description,
123
- "orderAmountInCents"=>order_amount_in_cents,
124
- "orderCurrency"=>order_currency,
125
- "terms"=>terms
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json'}, {
139
- "approved"=>true
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json'}, {
145
- "approved"=>false
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", {'Authorization'=>@@api_key, 'Content-type'=>'application/json'}, {
167
- "uri"=>uri,
168
- "redirectUrl"=>redirect_url
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.6
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-14 00:00:00.000000000 Z
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