infusionsoft 1.1.9 → 1.2.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 +4 -4
- data/.travis.yml +2 -3
- data/README.md +3 -3
- data/lib/infusionsoft/client/invoice.rb +32 -0
- data/lib/infusionsoft/version.rb +1 -1
- data/test/client/invoice_test.rb +21 -0
- data/test/vcr_cassettes/invoice_add_recurring_order.yml +55 -0
- data/test/vcr_cassettes/invoice_add_subscription.yml +55 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d0bf53243fc89d01af35d4197fa256c3585507d
|
4
|
+
data.tar.gz: 2db7db139663c393dd99cce6e6a87d8fabaf54eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97bd42c843cd05f5bf7b747ee4400727e61fdba74546230d104a7b02d5bec7b28d68aab961744e744c962f7eb61ff388d3aa606e04e5565d106a7fbbfff67e8d
|
7
|
+
data.tar.gz: 31ebb238bd1d52f38dd64c21c08e054782af92fdd1f5aa85015dbb30803fed0658a94e4ca9ff503bc217e99545a2a099b37f6a08988ee0f61bbf729d11441940
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,8 @@ A Ruby wrapper for the Infusionsoft API
|
|
20
20
|
|
21
21
|
## <a name="setup">Setup & Configuration</a>
|
22
22
|
1. **Rails 2.3** - add `config.gem 'infusionsoft'` **Rails >= 3** - add `'infusionsoft'` to your `Gemfile`
|
23
|
-
2.
|
23
|
+
2. Enable the API on your Infusionsoft account (if you haven't already) and generate your API Key: [See Infusionsoft Doc](http://ug.infusionsoft.com/article/AA-00442/0/How-do-I-enable-the-Infusionsoft-API-and-generate-an-API-Key.html)
|
24
|
+
3. Then create an initializer in `config\initializers` called infusionsoft.rb and the following
|
24
25
|
|
25
26
|
<b></b>
|
26
27
|
|
@@ -78,8 +79,7 @@ features.
|
|
78
79
|
## <a name="rubies">Supported Rubies</a>
|
79
80
|
This library aims to support the following Ruby implementations:
|
80
81
|
|
81
|
-
* Ruby
|
82
|
-
* Ruby >= 1.9
|
82
|
+
* Ruby >= 2.0
|
83
83
|
* [JRuby](http://www.jruby.org/)
|
84
84
|
* [Rubinius](http://rubini.us/)
|
85
85
|
* [Ruby Enterprise Edition](http://www.rubyenterpriseedition.com/)
|
@@ -72,11 +72,43 @@ module Infusionsoft
|
|
72
72
|
def invoice_add_recurring_order(contact_id, allow_duplicate, cprogram_id,
|
73
73
|
merchant_account_id, credit_card_id, affiliate_id,
|
74
74
|
days_till_charge)
|
75
|
+
|
76
|
+
api_logger.warn "[DEPRECATION WARNING]: The invoice_add_subscription method more fully complies with Infusionsoft's published API documents. User is advised to review Infusionsoft's API and this gem's documentation for changes in parameters."
|
77
|
+
|
75
78
|
response = get('InvoiceService.addRecurringOrder', contact_id,
|
76
79
|
allow_duplicate, cprogram_id, merchant_account_id, credit_card_id,
|
77
80
|
affiliate_id, days_till_charge)
|
78
81
|
end
|
79
82
|
|
83
|
+
|
84
|
+
|
85
|
+
################### This is a replacement method for invoice_add_recurring_order
|
86
|
+
# in order to fully support and comply with the Infusionsoft API documentation.
|
87
|
+
#
|
88
|
+
#
|
89
|
+
# @param [Integer] contact_id
|
90
|
+
# @param [Boolean] allow_duplicate
|
91
|
+
# @param [Integer] cprogram_id the subscription id
|
92
|
+
# @param [Integer] qty
|
93
|
+
# @param [Float] price
|
94
|
+
# @param [Boolean] allow_tax
|
95
|
+
# @param [Integer] merchant_account_id
|
96
|
+
# @param [Integer] credit_card_id
|
97
|
+
# @param [Integer] affiliate_id
|
98
|
+
# @param [Integer] days_till_charge number of days you want to wait till it's charged
|
99
|
+
|
100
|
+
def invoice_add_subscription(contact_id, allow_duplicate, cprogram_id,
|
101
|
+
qty, price, allow_tax,
|
102
|
+
merchant_account_id, credit_card_id, affiliate_id,
|
103
|
+
days_till_charge)
|
104
|
+
response = get('InvoiceService.addRecurringOrder', contact_id,
|
105
|
+
allow_duplicate, cprogram_id, qty, price, allow_tax, merchant_account_id, credit_card_id,
|
106
|
+
affiliate_id, days_till_charge)
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
80
112
|
# This modifies the commissions being earned on a particular subscription.
|
81
113
|
# This does not affect previously generated invoices for this subscription.
|
82
114
|
#
|
data/lib/infusionsoft/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative('../test_helper')
|
2
|
+
|
3
|
+
class InvoiceTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_invoice_add_recurring_order
|
6
|
+
VCR.use_cassette('invoice_add_recurring_order') do
|
7
|
+
result = Infusionsoft.invoice_add_recurring_order(4095, true, 19, 4, 9957, 0, 0)
|
8
|
+
|
9
|
+
assert_instance_of Fixnum, result
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_invoice_add_subscription
|
14
|
+
VCR.use_cassette('invoice_add_subscription') do
|
15
|
+
result = Infusionsoft.invoice_add_subscription(4095, true, 19, 1, 27.0, false, 4, 9957, 0, 0)
|
16
|
+
|
17
|
+
assert_instance_of Fixnum, result
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://jj1641.infusionsoft.com/api/xmlrpc
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '<?xml version="1.0" ?><methodCall><methodName>InvoiceService.addRecurringOrder</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>9999</i4></value></param><param><value><boolean>1</boolean></value></param><param><value><i4>99</i4></value></param><param><value><i4>9</i4></value></param><param><value><i4>9999</i4></value></param><param><value><i4>0</i4></value></param><param><value><i4>0</i4></value></param></params></methodCall>
|
9
|
+
|
10
|
+
'
|
11
|
+
headers:
|
12
|
+
User-Agent:
|
13
|
+
- Infusionsoft-1.1.9 (RubyGem)
|
14
|
+
Content-Type:
|
15
|
+
- text/xml; charset=utf-8
|
16
|
+
Content-Length:
|
17
|
+
- '498'
|
18
|
+
Connection:
|
19
|
+
- keep-alive
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- "*/*"
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache, no-store
|
31
|
+
Content-Type:
|
32
|
+
- text/xml;charset=UTF-8
|
33
|
+
Date:
|
34
|
+
- Tue, 02 May 2017 05:19:58 GMT
|
35
|
+
Expires:
|
36
|
+
- Tue, 02 May 2017 05:19:58 GMT
|
37
|
+
Pragma:
|
38
|
+
- no-cache
|
39
|
+
Server:
|
40
|
+
- Apache-Coyote/1.1
|
41
|
+
Set-Cookie:
|
42
|
+
- app-lb=!cUikj+k8HKXBdH1+PjA2WRnGtDEWJbE7XZ9YL6pt5yl0LGmznUJFvHlFJzYyIt6AFSc/BsMiohUVlS1XrBv5bqVlULoWq6qFxOlhbGK6CzXZtrUrJz8dZERhP/ef7JfEdsO6E+ARnUn2v/9Hd3nRaWwaBWTl7k4=;
|
43
|
+
path=/; Httponly; Secure
|
44
|
+
Vary:
|
45
|
+
- Accept-Encoding
|
46
|
+
X-Frame-Options:
|
47
|
+
- SAMEORIGIN
|
48
|
+
Transfer-Encoding:
|
49
|
+
- chunked
|
50
|
+
body:
|
51
|
+
encoding: ASCII-8BIT
|
52
|
+
string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>9999</i4></value></param></params></methodResponse>
|
53
|
+
http_version:
|
54
|
+
recorded_at: Tue, 02 May 2017 05:19:59 GMT
|
55
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://jj1641.infusionsoft.com/api/xmlrpc
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '<?xml version="1.0" ?><methodCall><methodName>InvoiceService.addRecurringOrder</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>9999</i4></value></param><param><value><boolean>1</boolean></value></param><param><value><i4>99</i4></value></param><param><value><i4>1</i4></value></param><param><value><double>27.0</double></value></param><param><value><boolean>0</boolean></value></param><param><value><i4>9</i4></value></param><param><value><i4>9999</i4></value></param><param><value><i4>0</i4></value></param><param><value><i4>0</i4></value></param></params></methodCall>
|
9
|
+
|
10
|
+
'
|
11
|
+
headers:
|
12
|
+
User-Agent:
|
13
|
+
- Infusionsoft-1.1.9 (RubyGem)
|
14
|
+
Content-Type:
|
15
|
+
- text/xml; charset=utf-8
|
16
|
+
Content-Length:
|
17
|
+
- '639'
|
18
|
+
Connection:
|
19
|
+
- keep-alive
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- "*/*"
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache, no-store
|
31
|
+
Content-Type:
|
32
|
+
- text/xml;charset=UTF-8
|
33
|
+
Date:
|
34
|
+
- Tue, 02 May 2017 05:10:07 GMT
|
35
|
+
Expires:
|
36
|
+
- Tue, 02 May 2017 05:10:07 GMT
|
37
|
+
Pragma:
|
38
|
+
- no-cache
|
39
|
+
Server:
|
40
|
+
- Apache-Coyote/1.1
|
41
|
+
Set-Cookie:
|
42
|
+
- app-lb=!ETsv4rM6FKdOg2R+PjA2WRnGtDEWJYEgTX9VcfOrT9pRJfJ9gtNVbF/QowPzaPUCvzImMyGJpOQVb1+LfGogVlbLZUmJZLHpU57EP9prAVn06cOhYo+eDAudMRGqKuJXDzX8VLc4bBMlQDcLpoV4aibJNtuIR4I=;
|
43
|
+
path=/; Httponly; Secure
|
44
|
+
Vary:
|
45
|
+
- Accept-Encoding
|
46
|
+
X-Frame-Options:
|
47
|
+
- SAMEORIGIN
|
48
|
+
Transfer-Encoding:
|
49
|
+
- chunked
|
50
|
+
body:
|
51
|
+
encoding: ASCII-8BIT
|
52
|
+
string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>9999</i4></value></param></params></methodResponse>
|
53
|
+
http_version:
|
54
|
+
recorded_at: Tue, 02 May 2017 05:10:07 GMT
|
55
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infusionsoft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Leavitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- test/client/contact_test.rb
|
63
63
|
- test/client/data_test.rb
|
64
64
|
- test/client/email_test.rb
|
65
|
+
- test/client/invoice_test.rb
|
65
66
|
- test/exceptions_test.rb
|
66
67
|
- test/test_helper.rb
|
67
68
|
- test/vcr_cassettes/add_to_group.yml
|
@@ -94,6 +95,8 @@ files:
|
|
94
95
|
- test/vcr_cassettes/email_send_template.yml
|
95
96
|
- test/vcr_cassettes/email_update_template.yml
|
96
97
|
- test/vcr_cassettes/find_by_email.yml
|
98
|
+
- test/vcr_cassettes/invoice_add_recurring_order.yml
|
99
|
+
- test/vcr_cassettes/invoice_add_subscription.yml
|
97
100
|
- test/vcr_cassettes/remove_from_group.yml
|
98
101
|
homepage: https://github.com/nateleavitt/infusionsoft
|
99
102
|
licenses: []
|
@@ -114,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
117
|
version: 1.3.6
|
115
118
|
requirements: []
|
116
119
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.5.2
|
118
121
|
signing_key:
|
119
122
|
specification_version: 4
|
120
123
|
summary: Ruby wrapper for the Infusionsoft API
|