chargify_api_ares 1.4.3 → 1.4.4
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/Gemfile.lock +1 -1
- data/HISTORY.md +4 -0
- data/chargify_api_ares.gemspec +2 -2
- data/examples/payments.rb +24 -0
- data/gemfiles/rails_3.gemfile.lock +1 -1
- data/gemfiles/rails_4.1.gemfile.lock +1 -1
- data/gemfiles/rails_4.gemfile.lock +1 -1
- data/lib/chargify_api_ares.rb +1 -0
- data/lib/chargify_api_ares/resources/allocation.rb +6 -0
- data/lib/chargify_api_ares/resources/payment.rb +7 -0
- data/lib/chargify_api_ares/resources/subscription.rb +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69aa3faec2b2f60e39558318a569ece38bb66187
|
4
|
+
data.tar.gz: cb7a28a0c2fc9e08987403d00a129f77fe95956e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef28b56c1a06782277d81435154ab1eb9e920b8dcc31c483d95024ae183e75e3b45b6b44c9a5b63be5a839f9426b81b4fed99b7157bed9eb555e9fdc163597f
|
7
|
+
data.tar.gz: e3b8d2728765d432d5ef3dde3378af5ab8bfc97b52e28d98b8899917b94d9d3fa99f8e8d86ecd3ab4993d607a4e5b8987160a480102478d40e446be24012276a
|
data/Gemfile.lock
CHANGED
data/HISTORY.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.4.4 / Jun 3 2016
|
2
|
+
|
3
|
+
* Adds support for External Payments [PR 128](https://github.com/chargify/chargify_api_ares/pull/128)
|
4
|
+
|
1
5
|
## 1.4.3 / Jan 5 2016
|
2
6
|
|
3
7
|
* Force json format for bulk allocations endpoints [PR 126](https://github.com/chargify/chargify_api_ares/pull/126) by @ryansch
|
data/chargify_api_ares.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.7'
|
5
5
|
|
6
6
|
s.name = 'chargify_api_ares'
|
7
|
-
s.version = '1.4.
|
8
|
-
s.date = '2016-
|
7
|
+
s.version = '1.4.4'
|
8
|
+
s.date = '2016-06-03'
|
9
9
|
s.summary = 'A Chargify API wrapper for Ruby using ActiveResource'
|
10
10
|
s.description = ''
|
11
11
|
s.authors = ["Chargify Development Team"]
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
2
|
+
|
3
|
+
require "chargify_api_ares"
|
4
|
+
|
5
|
+
Chargify.configure do |c|
|
6
|
+
c.subdomain = ENV['CHARGIFY_SUBDOMAIN']
|
7
|
+
c.api_key = ENV['CHARGIFY_API_KEY']
|
8
|
+
end
|
9
|
+
|
10
|
+
# Find a Chargify Subscription
|
11
|
+
sub = Chargify::Subscription.find_by_customer_reference 'abc-123-def-456'
|
12
|
+
|
13
|
+
# Record an external payment on the Chargify Subscription
|
14
|
+
pmt = sub.payment(
|
15
|
+
amount_in_cents: 2500,
|
16
|
+
memo: "Pre-payment for..."
|
17
|
+
)
|
18
|
+
|
19
|
+
# Or, create the external payment directly:
|
20
|
+
pmt = Chargify::Payment.create(
|
21
|
+
subscription_id: sub.id,
|
22
|
+
amount_in_cents: 2500,
|
23
|
+
memo: "Pre-payment for..."
|
24
|
+
)
|
data/lib/chargify_api_ares.rb
CHANGED
@@ -12,6 +12,7 @@ require 'chargify_api_ares/resources/customer_metadata'
|
|
12
12
|
require 'chargify_api_ares/resources/customer'
|
13
13
|
require 'chargify_api_ares/resources/event'
|
14
14
|
require 'chargify_api_ares/resources/migration'
|
15
|
+
require 'chargify_api_ares/resources/payment'
|
15
16
|
require 'chargify_api_ares/resources/payment_profile'
|
16
17
|
require 'chargify_api_ares/resources/product'
|
17
18
|
require 'chargify_api_ares/resources/product_family'
|
@@ -36,5 +36,11 @@ module Chargify
|
|
36
36
|
connection.format = orig_format
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
# Needed to avoid ActiveResource using Chargify::Payment
|
41
|
+
# when there is a Payment inside an Allocation.
|
42
|
+
# This Payment is an output-only attribute of an Allocation.
|
43
|
+
class Payment < Base
|
44
|
+
end
|
39
45
|
end
|
40
46
|
end
|
@@ -74,6 +74,14 @@ module Chargify
|
|
74
74
|
Chargify::Charge.create(attrs.merge(:subscription_id => self.id))
|
75
75
|
end
|
76
76
|
|
77
|
+
# Record an external payment on an existing subscription.
|
78
|
+
# This DOES NOT charge the customer's credit card.
|
79
|
+
# For more information, please see the API docs available
|
80
|
+
# at: https://docs.chargify.com/api-payments
|
81
|
+
def payment(attrs = {})
|
82
|
+
Chargify::Payment.create(attrs.merge(:subscription_id => self.id))
|
83
|
+
end
|
84
|
+
|
77
85
|
def credit(attrs = {})
|
78
86
|
attrs, options = extract_uniqueness_token(attrs)
|
79
87
|
process_capturing_errors do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargify_api_ares
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chargify Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- examples/metafields.rb
|
177
177
|
- examples/metered_components.rb
|
178
178
|
- examples/migrations.rb
|
179
|
+
- examples/payments.rb
|
179
180
|
- examples/products.rb
|
180
181
|
- examples/renewal_preview.rb
|
181
182
|
- examples/subscriptions.rb
|
@@ -202,6 +203,7 @@ files:
|
|
202
203
|
- lib/chargify_api_ares/resources/event.rb
|
203
204
|
- lib/chargify_api_ares/resources/invoice.rb
|
204
205
|
- lib/chargify_api_ares/resources/migration.rb
|
206
|
+
- lib/chargify_api_ares/resources/payment.rb
|
205
207
|
- lib/chargify_api_ares/resources/payment_profile.rb
|
206
208
|
- lib/chargify_api_ares/resources/product.rb
|
207
209
|
- lib/chargify_api_ares/resources/product_family.rb
|