processout 1.0.2 → 1.0.3

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: aaca840d5540ab7057070b885acf62871d133a67
4
- data.tar.gz: 9f02aeac4a8d84dad73af7e0c0e26b1570cbf829
3
+ metadata.gz: e4a75126feaa5016d2f3d95f7a575e7fd227a896
4
+ data.tar.gz: 8fa76a68941a9bc80f47f5cc99299441d889a75d
5
5
  SHA512:
6
- metadata.gz: cf9f397160fc764a1f47814b0f42a45c4c748ce5248c85f9fec3d9784f62aae073e18fd016a9e60cbcd0bab44a3f9fee094b6ca9f38aea44deda677756eecfa6
7
- data.tar.gz: ee33b803ea05c3a1c1562f76662d492f165686bea36423fb34d7db979e2db4eba08c63f79af8e05098381ff0a873fc4c9e5165460f27f7f9ae7a7b9c8980ed23
6
+ metadata.gz: b34d327e6b993e51d5ec6188b4acba030fa7fc92a138a6b22aeb67b70ee5170e19f1d8f592675b0b64146d66bcf330700644e10adc172c58a44e2f5e01d88ac3
7
+ data.tar.gz: 9120bb5df77af02de188f82080400b9762e35ddc77483e37b792e5d2707cc0b0fe900f6afa66ce64758df91d38ea77f8262e4b375a1ce4761f3acaeea8d526ad
@@ -73,22 +73,22 @@ module ProcessOut
73
73
  # +data+:: +Hash+ of data coming from the API
74
74
  def fill_with_data(data)
75
75
  if data.include? "id"
76
- @id = data["id"]
76
+ self.id = data["id"]
77
77
  end
78
78
  if data.include? "project"
79
- @project = data["project"]
79
+ self.project = data["project"]
80
80
  end
81
81
  if data.include? "title"
82
- @title = data["title"]
82
+ self.title = data["title"]
83
83
  end
84
84
  if data.include? "content"
85
- @content = data["content"]
85
+ self.content = data["content"]
86
86
  end
87
87
  if data.include? "level"
88
- @level = data["level"]
88
+ self.level = data["level"]
89
89
  end
90
90
  if data.include? "created_at"
91
- @created_at = data["created_at"]
91
+ self.created_at = data["created_at"]
92
92
  end
93
93
 
94
94
  self
@@ -129,43 +129,43 @@ module ProcessOut
129
129
  # +data+:: +Hash+ of data coming from the API
130
130
  def fill_with_data(data)
131
131
  if data.include? "id"
132
- @id = data["id"]
132
+ self.id = data["id"]
133
133
  end
134
134
  if data.include? "project"
135
- @project = data["project"]
135
+ self.project = data["project"]
136
136
  end
137
137
  if data.include? "customer"
138
- @customer = data["customer"]
138
+ self.customer = data["customer"]
139
139
  end
140
140
  if data.include? "token"
141
- @token = data["token"]
141
+ self.token = data["token"]
142
142
  end
143
143
  if data.include? "url"
144
- @url = data["url"]
144
+ self.url = data["url"]
145
145
  end
146
146
  if data.include? "authorized"
147
- @authorized = data["authorized"]
147
+ self.authorized = data["authorized"]
148
148
  end
149
149
  if data.include? "name"
150
- @name = data["name"]
150
+ self.name = data["name"]
151
151
  end
152
152
  if data.include? "currency"
153
- @currency = data["currency"]
153
+ self.currency = data["currency"]
154
154
  end
155
155
  if data.include? "return_url"
156
- @return_url = data["return_url"]
156
+ self.return_url = data["return_url"]
157
157
  end
158
158
  if data.include? "cancel_url"
159
- @cancel_url = data["cancel_url"]
159
+ self.cancel_url = data["cancel_url"]
160
160
  end
161
161
  if data.include? "custom"
162
- @custom = data["custom"]
162
+ self.custom = data["custom"]
163
163
  end
164
164
  if data.include? "sandbox"
165
- @sandbox = data["sandbox"]
165
+ self.sandbox = data["sandbox"]
166
166
  end
167
167
  if data.include? "created_at"
168
- @created_at = data["created_at"]
168
+ self.created_at = data["created_at"]
169
169
  end
170
170
 
171
171
  self
@@ -115,43 +115,43 @@ module ProcessOut
115
115
  # +data+:: +Hash+ of data coming from the API
116
116
  def fill_with_data(data)
117
117
  if data.include? "id"
118
- @id = data["id"]
118
+ self.id = data["id"]
119
119
  end
120
120
  if data.include? "project"
121
- @project = data["project"]
121
+ self.project = data["project"]
122
122
  end
123
123
  if data.include? "brand"
124
- @brand = data["brand"]
124
+ self.brand = data["brand"]
125
125
  end
126
126
  if data.include? "type"
127
- @type = data["type"]
127
+ self.type = data["type"]
128
128
  end
129
129
  if data.include? "bank_name"
130
- @bank_name = data["bank_name"]
130
+ self.bank_name = data["bank_name"]
131
131
  end
132
132
  if data.include? "level"
133
- @level = data["level"]
133
+ self.level = data["level"]
134
134
  end
135
135
  if data.include? "iin"
136
- @iin = data["iin"]
136
+ self.iin = data["iin"]
137
137
  end
138
138
  if data.include? "last_4_digits"
139
- @last_4_digits = data["last_4_digits"]
139
+ self.last_4_digits = data["last_4_digits"]
140
140
  end
141
141
  if data.include? "exp_month"
142
- @exp_month = data["exp_month"]
142
+ self.exp_month = data["exp_month"]
143
143
  end
144
144
  if data.include? "exp_year"
145
- @exp_year = data["exp_year"]
145
+ self.exp_year = data["exp_year"]
146
146
  end
147
147
  if data.include? "metadata"
148
- @metadata = data["metadata"]
148
+ self.metadata = data["metadata"]
149
149
  end
150
150
  if data.include? "sandbox"
151
- @sandbox = data["sandbox"]
151
+ self.sandbox = data["sandbox"]
152
152
  end
153
153
  if data.include? "created_at"
154
- @created_at = data["created_at"]
154
+ self.created_at = data["created_at"]
155
155
  end
156
156
 
157
157
  self
@@ -115,43 +115,43 @@ module ProcessOut
115
115
  # +data+:: +Hash+ of data coming from the API
116
116
  def fill_with_data(data)
117
117
  if data.include? "id"
118
- @id = data["id"]
118
+ self.id = data["id"]
119
119
  end
120
120
  if data.include? "project"
121
- @project = data["project"]
121
+ self.project = data["project"]
122
122
  end
123
123
  if data.include? "name"
124
- @name = data["name"]
124
+ self.name = data["name"]
125
125
  end
126
126
  if data.include? "amount_off"
127
- @amount_off = data["amount_off"]
127
+ self.amount_off = data["amount_off"]
128
128
  end
129
129
  if data.include? "percent_off"
130
- @percent_off = data["percent_off"]
130
+ self.percent_off = data["percent_off"]
131
131
  end
132
132
  if data.include? "currency"
133
- @currency = data["currency"]
133
+ self.currency = data["currency"]
134
134
  end
135
135
  if data.include? "max_redemptions"
136
- @max_redemptions = data["max_redemptions"]
136
+ self.max_redemptions = data["max_redemptions"]
137
137
  end
138
138
  if data.include? "expires_at"
139
- @expires_at = data["expires_at"]
139
+ self.expires_at = data["expires_at"]
140
140
  end
141
141
  if data.include? "metadata"
142
- @metadata = data["metadata"]
142
+ self.metadata = data["metadata"]
143
143
  end
144
144
  if data.include? "iteration_count"
145
- @iteration_count = data["iteration_count"]
145
+ self.iteration_count = data["iteration_count"]
146
146
  end
147
147
  if data.include? "redeemed_number"
148
- @redeemed_number = data["redeemed_number"]
148
+ self.redeemed_number = data["redeemed_number"]
149
149
  end
150
150
  if data.include? "sandbox"
151
- @sandbox = data["sandbox"]
151
+ self.sandbox = data["sandbox"]
152
152
  end
153
153
  if data.include? "created_at"
154
- @created_at = data["created_at"]
154
+ self.created_at = data["created_at"]
155
155
  end
156
156
 
157
157
  self
@@ -139,55 +139,55 @@ module ProcessOut
139
139
  # +data+:: +Hash+ of data coming from the API
140
140
  def fill_with_data(data)
141
141
  if data.include? "id"
142
- @id = data["id"]
142
+ self.id = data["id"]
143
143
  end
144
144
  if data.include? "project"
145
- @project = data["project"]
145
+ self.project = data["project"]
146
146
  end
147
147
  if data.include? "email"
148
- @email = data["email"]
148
+ self.email = data["email"]
149
149
  end
150
150
  if data.include? "first_name"
151
- @first_name = data["first_name"]
151
+ self.first_name = data["first_name"]
152
152
  end
153
153
  if data.include? "last_name"
154
- @last_name = data["last_name"]
154
+ self.last_name = data["last_name"]
155
155
  end
156
156
  if data.include? "address1"
157
- @address1 = data["address1"]
157
+ self.address1 = data["address1"]
158
158
  end
159
159
  if data.include? "address2"
160
- @address2 = data["address2"]
160
+ self.address2 = data["address2"]
161
161
  end
162
162
  if data.include? "city"
163
- @city = data["city"]
163
+ self.city = data["city"]
164
164
  end
165
165
  if data.include? "state"
166
- @state = data["state"]
166
+ self.state = data["state"]
167
167
  end
168
168
  if data.include? "zip"
169
- @zip = data["zip"]
169
+ self.zip = data["zip"]
170
170
  end
171
171
  if data.include? "country_code"
172
- @country_code = data["country_code"]
172
+ self.country_code = data["country_code"]
173
173
  end
174
174
  if data.include? "balance"
175
- @balance = data["balance"]
175
+ self.balance = data["balance"]
176
176
  end
177
177
  if data.include? "currency"
178
- @currency = data["currency"]
178
+ self.currency = data["currency"]
179
179
  end
180
180
  if data.include? "metadata"
181
- @metadata = data["metadata"]
181
+ self.metadata = data["metadata"]
182
182
  end
183
183
  if data.include? "has_pin"
184
- @has_pin = data["has_pin"]
184
+ self.has_pin = data["has_pin"]
185
185
  end
186
186
  if data.include? "sandbox"
187
- @sandbox = data["sandbox"]
187
+ self.sandbox = data["sandbox"]
188
188
  end
189
189
  if data.include? "created_at"
190
- @created_at = data["created_at"]
190
+ self.created_at = data["created_at"]
191
191
  end
192
192
 
193
193
  self
@@ -42,10 +42,10 @@ module ProcessOut
42
42
  # +data+:: +Hash+ of data coming from the API
43
43
  def fill_with_data(data)
44
44
  if data.include? "type"
45
- @type = data["type"]
45
+ self.type = data["type"]
46
46
  end
47
47
  if data.include? "value"
48
- @value = data["value"]
48
+ self.value = data["value"]
49
49
  end
50
50
 
51
51
  self
@@ -105,31 +105,31 @@ module ProcessOut
105
105
  # +data+:: +Hash+ of data coming from the API
106
106
  def fill_with_data(data)
107
107
  if data.include? "id"
108
- @id = data["id"]
108
+ self.id = data["id"]
109
109
  end
110
110
  if data.include? "project"
111
- @project = data["project"]
111
+ self.project = data["project"]
112
112
  end
113
113
  if data.include? "subscription"
114
- @subscription = data["subscription"]
114
+ self.subscription = data["subscription"]
115
115
  end
116
116
  if data.include? "coupon"
117
- @coupon = data["coupon"]
117
+ self.coupon = data["coupon"]
118
118
  end
119
119
  if data.include? "amount"
120
- @amount = data["amount"]
120
+ self.amount = data["amount"]
121
121
  end
122
122
  if data.include? "expires_at"
123
- @expires_at = data["expires_at"]
123
+ self.expires_at = data["expires_at"]
124
124
  end
125
125
  if data.include? "metadata"
126
- @metadata = data["metadata"]
126
+ self.metadata = data["metadata"]
127
127
  end
128
128
  if data.include? "sandbox"
129
- @sandbox = data["sandbox"]
129
+ self.sandbox = data["sandbox"]
130
130
  end
131
131
  if data.include? "created_at"
132
- @created_at = data["created_at"]
132
+ self.created_at = data["created_at"]
133
133
  end
134
134
 
135
135
  self
@@ -74,22 +74,22 @@ module ProcessOut
74
74
  # +data+:: +Hash+ of data coming from the API
75
75
  def fill_with_data(data)
76
76
  if data.include? "id"
77
- @id = data["id"]
77
+ self.id = data["id"]
78
78
  end
79
79
  if data.include? "project"
80
- @project = data["project"]
80
+ self.project = data["project"]
81
81
  end
82
82
  if data.include? "name"
83
- @name = data["name"]
83
+ self.name = data["name"]
84
84
  end
85
85
  if data.include? "data"
86
- @data = data["data"]
86
+ self.data = data["data"]
87
87
  end
88
88
  if data.include? "sandbox"
89
- @sandbox = data["sandbox"]
89
+ self.sandbox = data["sandbox"]
90
90
  end
91
91
  if data.include? "fired_at"
92
- @fired_at = data["fired_at"]
92
+ self.fired_at = data["fired_at"]
93
93
  end
94
94
 
95
95
  self
@@ -78,28 +78,28 @@ module ProcessOut
78
78
  # +data+:: +Hash+ of data coming from the API
79
79
  def fill_with_data(data)
80
80
  if data.include? "id"
81
- @id = data["id"]
81
+ self.id = data["id"]
82
82
  end
83
83
  if data.include? "name"
84
- @name = data["name"]
84
+ self.name = data["name"]
85
85
  end
86
86
  if data.include? "display_name"
87
- @display_name = data["display_name"]
87
+ self.display_name = data["display_name"]
88
88
  end
89
89
  if data.include? "logo_url"
90
- @logo_url = data["logo_url"]
90
+ self.logo_url = data["logo_url"]
91
91
  end
92
92
  if data.include? "url"
93
- @url = data["url"]
93
+ self.url = data["url"]
94
94
  end
95
95
  if data.include? "flows"
96
- @flows = data["flows"]
96
+ self.flows = data["flows"]
97
97
  end
98
98
  if data.include? "tags"
99
- @tags = data["tags"]
99
+ self.tags = data["tags"]
100
100
  end
101
101
  if data.include? "description"
102
- @description = data["description"]
102
+ self.description = data["description"]
103
103
  end
104
104
 
105
105
  self
@@ -74,19 +74,19 @@ module ProcessOut
74
74
  # +data+:: +Hash+ of data coming from the API
75
75
  def fill_with_data(data)
76
76
  if data.include? "id"
77
- @id = data["id"]
77
+ self.id = data["id"]
78
78
  end
79
79
  if data.include? "project"
80
- @project = data["project"]
80
+ self.project = data["project"]
81
81
  end
82
82
  if data.include? "gateway"
83
- @gateway = data["gateway"]
83
+ self.gateway = data["gateway"]
84
84
  end
85
85
  if data.include? "enabled"
86
- @enabled = data["enabled"]
86
+ self.enabled = data["enabled"]
87
87
  end
88
88
  if data.include? "public_keys"
89
- @public_keys = data["public_keys"]
89
+ self.public_keys = data["public_keys"]
90
90
  end
91
91
 
92
92
  self
@@ -154,52 +154,52 @@ module ProcessOut
154
154
  # +data+:: +Hash+ of data coming from the API
155
155
  def fill_with_data(data)
156
156
  if data.include? "id"
157
- @id = data["id"]
157
+ self.id = data["id"]
158
158
  end
159
159
  if data.include? "project"
160
- @project = data["project"]
160
+ self.project = data["project"]
161
161
  end
162
162
  if data.include? "transaction"
163
- @transaction = data["transaction"]
163
+ self.transaction = data["transaction"]
164
164
  end
165
165
  if data.include? "customer"
166
- @customer = data["customer"]
166
+ self.customer = data["customer"]
167
167
  end
168
168
  if data.include? "subscription"
169
- @subscription = data["subscription"]
169
+ self.subscription = data["subscription"]
170
170
  end
171
171
  if data.include? "url"
172
- @url = data["url"]
172
+ self.url = data["url"]
173
173
  end
174
174
  if data.include? "name"
175
- @name = data["name"]
175
+ self.name = data["name"]
176
176
  end
177
177
  if data.include? "amount"
178
- @amount = data["amount"]
178
+ self.amount = data["amount"]
179
179
  end
180
180
  if data.include? "currency"
181
- @currency = data["currency"]
181
+ self.currency = data["currency"]
182
182
  end
183
183
  if data.include? "metadata"
184
- @metadata = data["metadata"]
184
+ self.metadata = data["metadata"]
185
185
  end
186
186
  if data.include? "request_email"
187
- @request_email = data["request_email"]
187
+ self.request_email = data["request_email"]
188
188
  end
189
189
  if data.include? "request_shipping"
190
- @request_shipping = data["request_shipping"]
190
+ self.request_shipping = data["request_shipping"]
191
191
  end
192
192
  if data.include? "return_url"
193
- @return_url = data["return_url"]
193
+ self.return_url = data["return_url"]
194
194
  end
195
195
  if data.include? "cancel_url"
196
- @cancel_url = data["cancel_url"]
196
+ self.cancel_url = data["cancel_url"]
197
197
  end
198
198
  if data.include? "sandbox"
199
- @sandbox = data["sandbox"]
199
+ self.sandbox = data["sandbox"]
200
200
  end
201
201
  if data.include? "created_at"
202
- @created_at = data["created_at"]
202
+ self.created_at = data["created_at"]
203
203
  end
204
204
 
205
205
  self
@@ -25,7 +25,7 @@ module ProcessOut
25
25
  # ComputeData computes the data to be sent in the request
26
26
  def compute_data(data, options)
27
27
  unless options.nil?
28
- data["expand"] = options.fetch(:expand, "")
28
+ data["expand"] = options.fetch(:expand, [])
29
29
  data["filter"] = options.fetch(:filter, "")
30
30
  data["limit"] = options.fetch(:limit, "")
31
31
  data["page"] = options.fetch(:page, "")
@@ -54,7 +54,7 @@ module ProcessOut
54
54
  def post(path, data, options)
55
55
  uri = URI(@client.host + path)
56
56
  req = Net::HTTP::Post.new(uri)
57
- req.body = data.to_json
57
+ req.body = self.compute_data(data, options).to_json
58
58
  self.apply_headers(req, options)
59
59
 
60
60
  Net::HTTP.start(uri.hostname, uri.port,
@@ -68,7 +68,7 @@ module ProcessOut
68
68
  def put(path, data, options)
69
69
  uri = URI(@client.host + path)
70
70
  req = Net::HTTP::Put.new(uri)
71
- req.body = data.to_json
71
+ req.body = self.compute_data(data, options).to_json
72
72
  self.apply_headers(req, options)
73
73
 
74
74
  Net::HTTP.start(uri.hostname, uri.port,
@@ -81,8 +81,8 @@ module ProcessOut
81
81
  # DELETE sends a delete request to the API
82
82
  def delete(path, data, options)
83
83
  uri = URI(@client.host + path)
84
+ uri.query = URI.encode_www_form(self.compute_data(data, options))
84
85
  req = Net::HTTP::Delete.new(uri)
85
- req.body = data.to_json
86
86
  self.apply_headers(req, options)
87
87
 
88
88
  Net::HTTP.start(uri.hostname, uri.port,
@@ -109,40 +109,40 @@ module ProcessOut
109
109
  # +data+:: +Hash+ of data coming from the API
110
110
  def fill_with_data(data)
111
111
  if data.include? "id"
112
- @id = data["id"]
112
+ self.id = data["id"]
113
113
  end
114
114
  if data.include? "project"
115
- @project = data["project"]
115
+ self.project = data["project"]
116
116
  end
117
117
  if data.include? "name"
118
- @name = data["name"]
118
+ self.name = data["name"]
119
119
  end
120
120
  if data.include? "amount"
121
- @amount = data["amount"]
121
+ self.amount = data["amount"]
122
122
  end
123
123
  if data.include? "currency"
124
- @currency = data["currency"]
124
+ self.currency = data["currency"]
125
125
  end
126
126
  if data.include? "metadata"
127
- @metadata = data["metadata"]
127
+ self.metadata = data["metadata"]
128
128
  end
129
129
  if data.include? "interval"
130
- @interval = data["interval"]
130
+ self.interval = data["interval"]
131
131
  end
132
132
  if data.include? "trial_period"
133
- @trial_period = data["trial_period"]
133
+ self.trial_period = data["trial_period"]
134
134
  end
135
135
  if data.include? "return_url"
136
- @return_url = data["return_url"]
136
+ self.return_url = data["return_url"]
137
137
  end
138
138
  if data.include? "cancel_url"
139
- @cancel_url = data["cancel_url"]
139
+ self.cancel_url = data["cancel_url"]
140
140
  end
141
141
  if data.include? "sandbox"
142
- @sandbox = data["sandbox"]
142
+ self.sandbox = data["sandbox"]
143
143
  end
144
144
  if data.include? "created_at"
145
- @created_at = data["created_at"]
145
+ self.created_at = data["created_at"]
146
146
  end
147
147
 
148
148
  self
@@ -115,43 +115,43 @@ module ProcessOut
115
115
  # +data+:: +Hash+ of data coming from the API
116
116
  def fill_with_data(data)
117
117
  if data.include? "id"
118
- @id = data["id"]
118
+ self.id = data["id"]
119
119
  end
120
120
  if data.include? "project"
121
- @project = data["project"]
121
+ self.project = data["project"]
122
122
  end
123
123
  if data.include? "url"
124
- @url = data["url"]
124
+ self.url = data["url"]
125
125
  end
126
126
  if data.include? "name"
127
- @name = data["name"]
127
+ self.name = data["name"]
128
128
  end
129
129
  if data.include? "amount"
130
- @amount = data["amount"]
130
+ self.amount = data["amount"]
131
131
  end
132
132
  if data.include? "currency"
133
- @currency = data["currency"]
133
+ self.currency = data["currency"]
134
134
  end
135
135
  if data.include? "metadata"
136
- @metadata = data["metadata"]
136
+ self.metadata = data["metadata"]
137
137
  end
138
138
  if data.include? "request_email"
139
- @request_email = data["request_email"]
139
+ self.request_email = data["request_email"]
140
140
  end
141
141
  if data.include? "request_shipping"
142
- @request_shipping = data["request_shipping"]
142
+ self.request_shipping = data["request_shipping"]
143
143
  end
144
144
  if data.include? "return_url"
145
- @return_url = data["return_url"]
145
+ self.return_url = data["return_url"]
146
146
  end
147
147
  if data.include? "cancel_url"
148
- @cancel_url = data["cancel_url"]
148
+ self.cancel_url = data["cancel_url"]
149
149
  end
150
150
  if data.include? "sandbox"
151
- @sandbox = data["sandbox"]
151
+ self.sandbox = data["sandbox"]
152
152
  end
153
153
  if data.include? "created_at"
154
- @created_at = data["created_at"]
154
+ self.created_at = data["created_at"]
155
155
  end
156
156
 
157
157
  self
@@ -60,19 +60,19 @@ module ProcessOut
60
60
  # +data+:: +Hash+ of data coming from the API
61
61
  def fill_with_data(data)
62
62
  if data.include? "id"
63
- @id = data["id"]
63
+ self.id = data["id"]
64
64
  end
65
65
  if data.include? "name"
66
- @name = data["name"]
66
+ self.name = data["name"]
67
67
  end
68
68
  if data.include? "logo_url"
69
- @logo_url = data["logo_url"]
69
+ self.logo_url = data["logo_url"]
70
70
  end
71
71
  if data.include? "email"
72
- @email = data["email"]
72
+ self.email = data["email"]
73
73
  end
74
74
  if data.include? "created_at"
75
- @created_at = data["created_at"]
75
+ self.created_at = data["created_at"]
76
76
  end
77
77
 
78
78
  self
@@ -85,28 +85,28 @@ module ProcessOut
85
85
  # +data+:: +Hash+ of data coming from the API
86
86
  def fill_with_data(data)
87
87
  if data.include? "id"
88
- @id = data["id"]
88
+ self.id = data["id"]
89
89
  end
90
90
  if data.include? "transaction"
91
- @transaction = data["transaction"]
91
+ self.transaction = data["transaction"]
92
92
  end
93
93
  if data.include? "reason"
94
- @reason = data["reason"]
94
+ self.reason = data["reason"]
95
95
  end
96
96
  if data.include? "information"
97
- @information = data["information"]
97
+ self.information = data["information"]
98
98
  end
99
99
  if data.include? "amount"
100
- @amount = data["amount"]
100
+ self.amount = data["amount"]
101
101
  end
102
102
  if data.include? "metadata"
103
- @metadata = data["metadata"]
103
+ self.metadata = data["metadata"]
104
104
  end
105
105
  if data.include? "sandbox"
106
- @sandbox = data["sandbox"]
106
+ self.sandbox = data["sandbox"]
107
107
  end
108
108
  if data.include? "created_at"
109
- @created_at = data["created_at"]
109
+ self.created_at = data["created_at"]
110
110
  end
111
111
 
112
112
  self
@@ -202,76 +202,76 @@ module ProcessOut
202
202
  # +data+:: +Hash+ of data coming from the API
203
203
  def fill_with_data(data)
204
204
  if data.include? "id"
205
- @id = data["id"]
205
+ self.id = data["id"]
206
206
  end
207
207
  if data.include? "project"
208
- @project = data["project"]
208
+ self.project = data["project"]
209
209
  end
210
210
  if data.include? "plan"
211
- @plan = data["plan"]
211
+ self.plan = data["plan"]
212
212
  end
213
213
  if data.include? "customer"
214
- @customer = data["customer"]
214
+ self.customer = data["customer"]
215
215
  end
216
216
  if data.include? "token"
217
- @token = data["token"]
217
+ self.token = data["token"]
218
218
  end
219
219
  if data.include? "url"
220
- @url = data["url"]
220
+ self.url = data["url"]
221
221
  end
222
222
  if data.include? "name"
223
- @name = data["name"]
223
+ self.name = data["name"]
224
224
  end
225
225
  if data.include? "amount"
226
- @amount = data["amount"]
226
+ self.amount = data["amount"]
227
227
  end
228
228
  if data.include? "currency"
229
- @currency = data["currency"]
229
+ self.currency = data["currency"]
230
230
  end
231
231
  if data.include? "metadata"
232
- @metadata = data["metadata"]
232
+ self.metadata = data["metadata"]
233
233
  end
234
234
  if data.include? "interval"
235
- @interval = data["interval"]
235
+ self.interval = data["interval"]
236
236
  end
237
237
  if data.include? "trial_end_at"
238
- @trial_end_at = data["trial_end_at"]
238
+ self.trial_end_at = data["trial_end_at"]
239
239
  end
240
240
  if data.include? "activated"
241
- @activated = data["activated"]
241
+ self.activated = data["activated"]
242
242
  end
243
243
  if data.include? "active"
244
- @active = data["active"]
244
+ self.active = data["active"]
245
245
  end
246
246
  if data.include? "canceled"
247
- @canceled = data["canceled"]
247
+ self.canceled = data["canceled"]
248
248
  end
249
249
  if data.include? "cancellation_reason"
250
- @cancellation_reason = data["cancellation_reason"]
250
+ self.cancellation_reason = data["cancellation_reason"]
251
251
  end
252
252
  if data.include? "pending_cancellation"
253
- @pending_cancellation = data["pending_cancellation"]
253
+ self.pending_cancellation = data["pending_cancellation"]
254
254
  end
255
255
  if data.include? "cancel_at"
256
- @cancel_at = data["cancel_at"]
256
+ self.cancel_at = data["cancel_at"]
257
257
  end
258
258
  if data.include? "return_url"
259
- @return_url = data["return_url"]
259
+ self.return_url = data["return_url"]
260
260
  end
261
261
  if data.include? "cancel_url"
262
- @cancel_url = data["cancel_url"]
262
+ self.cancel_url = data["cancel_url"]
263
263
  end
264
264
  if data.include? "sandbox"
265
- @sandbox = data["sandbox"]
265
+ self.sandbox = data["sandbox"]
266
266
  end
267
267
  if data.include? "created_at"
268
- @created_at = data["created_at"]
268
+ self.created_at = data["created_at"]
269
269
  end
270
270
  if data.include? "activated_at"
271
- @activated_at = data["activated_at"]
271
+ self.activated_at = data["activated_at"]
272
272
  end
273
273
  if data.include? "iterate_at"
274
- @iterate_at = data["iterate_at"]
274
+ self.iterate_at = data["iterate_at"]
275
275
  end
276
276
 
277
277
  self
@@ -80,22 +80,22 @@ module ProcessOut
80
80
  # +data+:: +Hash+ of data coming from the API
81
81
  def fill_with_data(data)
82
82
  if data.include? "id"
83
- @id = data["id"]
83
+ self.id = data["id"]
84
84
  end
85
85
  if data.include? "customer"
86
- @customer = data["customer"]
86
+ self.customer = data["customer"]
87
87
  end
88
88
  if data.include? "card"
89
- @card = data["card"]
89
+ self.card = data["card"]
90
90
  end
91
91
  if data.include? "metadata"
92
- @metadata = data["metadata"]
92
+ self.metadata = data["metadata"]
93
93
  end
94
94
  if data.include? "is_subscription_only"
95
- @is_subscription_only = data["is_subscription_only"]
95
+ self.is_subscription_only = data["is_subscription_only"]
96
96
  end
97
97
  if data.include? "created_at"
98
- @created_at = data["created_at"]
98
+ self.created_at = data["created_at"]
99
99
  end
100
100
 
101
101
  self
@@ -167,55 +167,55 @@ module ProcessOut
167
167
  # +data+:: +Hash+ of data coming from the API
168
168
  def fill_with_data(data)
169
169
  if data.include? "id"
170
- @id = data["id"]
170
+ self.id = data["id"]
171
171
  end
172
172
  if data.include? "project"
173
- @project = data["project"]
173
+ self.project = data["project"]
174
174
  end
175
175
  if data.include? "customer"
176
- @customer = data["customer"]
176
+ self.customer = data["customer"]
177
177
  end
178
178
  if data.include? "subscription"
179
- @subscription = data["subscription"]
179
+ self.subscription = data["subscription"]
180
180
  end
181
181
  if data.include? "token"
182
- @token = data["token"]
182
+ self.token = data["token"]
183
183
  end
184
184
  if data.include? "card"
185
- @card = data["card"]
185
+ self.card = data["card"]
186
186
  end
187
187
  if data.include? "name"
188
- @name = data["name"]
188
+ self.name = data["name"]
189
189
  end
190
190
  if data.include? "authorized_amount"
191
- @authorized_amount = data["authorized_amount"]
191
+ self.authorized_amount = data["authorized_amount"]
192
192
  end
193
193
  if data.include? "captured_amount"
194
- @captured_amount = data["captured_amount"]
194
+ self.captured_amount = data["captured_amount"]
195
195
  end
196
196
  if data.include? "currency"
197
- @currency = data["currency"]
197
+ self.currency = data["currency"]
198
198
  end
199
199
  if data.include? "status"
200
- @status = data["status"]
200
+ self.status = data["status"]
201
201
  end
202
202
  if data.include? "authorized"
203
- @authorized = data["authorized"]
203
+ self.authorized = data["authorized"]
204
204
  end
205
205
  if data.include? "captured"
206
- @captured = data["captured"]
206
+ self.captured = data["captured"]
207
207
  end
208
208
  if data.include? "processout_fee"
209
- @processout_fee = data["processout_fee"]
209
+ self.processout_fee = data["processout_fee"]
210
210
  end
211
211
  if data.include? "metadata"
212
- @metadata = data["metadata"]
212
+ self.metadata = data["metadata"]
213
213
  end
214
214
  if data.include? "sandbox"
215
- @sandbox = data["sandbox"]
215
+ self.sandbox = data["sandbox"]
216
216
  end
217
217
  if data.include? "created_at"
218
- @created_at = data["created_at"]
218
+ self.created_at = data["created_at"]
219
219
  end
220
220
 
221
221
  self
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -116,40 +116,40 @@ module ProcessOut
116
116
  # +data+:: +Hash+ of data coming from the API
117
117
  def fill_with_data(data)
118
118
  if data.include? "id"
119
- @id = data["id"]
119
+ self.id = data["id"]
120
120
  end
121
121
  if data.include? "project"
122
- @project = data["project"]
122
+ self.project = data["project"]
123
123
  end
124
124
  if data.include? "event"
125
- @event = data["event"]
125
+ self.event = data["event"]
126
126
  end
127
127
  if data.include? "request_url"
128
- @request_url = data["request_url"]
128
+ self.request_url = data["request_url"]
129
129
  end
130
130
  if data.include? "request_method"
131
- @request_method = data["request_method"]
131
+ self.request_method = data["request_method"]
132
132
  end
133
133
  if data.include? "response_body"
134
- @response_body = data["response_body"]
134
+ self.response_body = data["response_body"]
135
135
  end
136
136
  if data.include? "response_code"
137
- @response_code = data["response_code"]
137
+ self.response_code = data["response_code"]
138
138
  end
139
139
  if data.include? "response_headers"
140
- @response_headers = data["response_headers"]
140
+ self.response_headers = data["response_headers"]
141
141
  end
142
142
  if data.include? "response_time_ms"
143
- @response_time_ms = data["response_time_ms"]
143
+ self.response_time_ms = data["response_time_ms"]
144
144
  end
145
145
  if data.include? "status"
146
- @status = data["status"]
146
+ self.status = data["status"]
147
147
  end
148
148
  if data.include? "created_at"
149
- @created_at = data["created_at"]
149
+ self.created_at = data["created_at"]
150
150
  end
151
151
  if data.include? "release_at"
152
- @release_at = data["release_at"]
152
+ self.release_at = data["release_at"]
153
153
  end
154
154
 
155
155
  self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: processout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel HUEZ