billimatic-client 0.8.0 → 0.9.0
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 +8 -8
- data/Gemfile.lock +1 -1
- data/README.md +22 -0
- data/lib/billimatic.rb +1 -0
- data/lib/billimatic/entities/payment_information.rb +12 -0
- data/lib/billimatic/entities/subscription.rb +2 -0
- data/lib/billimatic/resources/subscription.rb +18 -0
- data/lib/billimatic/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGUyM2ZjNDY5NjVhODlmMTRiMGExMDkyY2EyYTY0ZmJiN2E4NzE0MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODZkZDMxMTRkNWZkNzJjZTk5YzRlODE5NTM4NGQ5YzFiYzNlMmEwMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGNmOTNlNWU0MDY0ZTE0MGNjZmQ2NDZlYTVhNDc3ODA4MGIyNmYxMGY2Y2I4
|
10
|
+
ZmIxNzFlYTZhMWEyMzBlMDFmZDgxNWFkNjZhZWIwMzBkMzM0ZDNmOWFlOWUz
|
11
|
+
Njk2MWVhODIyOTU5NmU2YmZiNzczYjc3MTJkMzI3MDNkYmRiYWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Mzc3ZmUwMDk5ZGJmMjJjOGJkM2M3ODczNjA3NzMwZGYxOWVlY2RiN2FhODcz
|
14
|
+
MTFjNDE2YmJlZmEzYjUzYjllMGY5MWY3NDM3MGM3NzNjNWU2MTliZjM3YTQ2
|
15
|
+
OWVmM2U1ODhhYWRlNjgzODNkMDIwOTMzN2NlMDkyNjRlNGY2NWI=
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -218,6 +218,28 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
|
|
218
218
|
<code>client.subscriptions.change_plan(token: token, new_plan_id: id)</code>
|
219
219
|
</td>
|
220
220
|
</tr>
|
221
|
+
<tr>
|
222
|
+
<td><code>PATCH</code></td>
|
223
|
+
<td>
|
224
|
+
<a href="https://app.billimatic.com.br/docs/api#!/payment_gateway/API_V1_Subscription_PaymentGateway_retry_patch_0" target="_blank">
|
225
|
+
/api/v1/subscriptions/:token/:invoice_id/retry
|
226
|
+
</a>
|
227
|
+
</td>
|
228
|
+
<td>
|
229
|
+
<code>client.subscriptions.retry_charge(attributes_hash, token: token, invoice_id: id)</code>
|
230
|
+
</td>
|
231
|
+
</tr>
|
232
|
+
<tr>
|
233
|
+
<td><code>PATCH</code></td>
|
234
|
+
<td>
|
235
|
+
<a href="https://app.billimatic.com.br/docs/api#!/payment_informations/API_V1_Subscription_PaymentInformations_update_patch_0" target="_blank">
|
236
|
+
/api/v1/subscriptions/:token/update_payment_information
|
237
|
+
</a>
|
238
|
+
</td>
|
239
|
+
<td>
|
240
|
+
<code>client.subscriptions.update_payment_information(attributes_hash, token: token)</code>
|
241
|
+
</td>
|
242
|
+
</tr>
|
221
243
|
<tr>
|
222
244
|
<td><code>PATCH</code></td>
|
223
245
|
<td>
|
data/lib/billimatic.rb
CHANGED
@@ -24,6 +24,7 @@ require 'billimatic/entities/organization'
|
|
24
24
|
require 'billimatic/entities/contract'
|
25
25
|
require 'billimatic/entities/invoice'
|
26
26
|
require 'billimatic/entities/invoice_rule'
|
27
|
+
require 'billimatic/entities/payment_information'
|
27
28
|
require 'billimatic/entities/subscription'
|
28
29
|
require 'billimatic/entities/webhook'
|
29
30
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Billimatic
|
2
|
+
module Entities
|
3
|
+
class PaymentInformation < Base
|
4
|
+
attribute :id, Integer
|
5
|
+
attribute :payment_method, String
|
6
|
+
attribute :cobrato_card_id, Integer
|
7
|
+
attribute :card_expiration_month, Integer
|
8
|
+
attribute :card_expiration_year, Integer
|
9
|
+
attribute :created_at, DateTime
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -26,6 +26,24 @@ module Billimatic
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def retry_charge(params, token:, invoice_id:)
|
30
|
+
http.patch(
|
31
|
+
"#{resource_base_path}/#{token}/#{invoice_id}/retry",
|
32
|
+
body: { subscription: params }
|
33
|
+
) do |response|
|
34
|
+
respond_with_entity response
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def update_payment_information(params, token:)
|
39
|
+
http.patch(
|
40
|
+
"#{resource_base_path}/#{token}/update_payment_information",
|
41
|
+
body: { subscription: params }
|
42
|
+
) do |response|
|
43
|
+
respond_with_entity response
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
29
47
|
def cancel(token:)
|
30
48
|
http.patch("#{resource_base_path}/#{token}/cancel") do |response|
|
31
49
|
respond_with_entity response
|
data/lib/billimatic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: billimatic-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Tassinari de Oliveira
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: typhoeus
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- lib/billimatic/entities/invoice.rb
|
231
231
|
- lib/billimatic/entities/invoice_rule.rb
|
232
232
|
- lib/billimatic/entities/organization.rb
|
233
|
+
- lib/billimatic/entities/payment_information.rb
|
233
234
|
- lib/billimatic/entities/plan.rb
|
234
235
|
- lib/billimatic/entities/plan_feature.rb
|
235
236
|
- lib/billimatic/entities/product.rb
|