infusionsoft 1.2.1 → 1.2.2

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
- SHA1:
3
- metadata.gz: 592cdc892f6d093c9fc679136396f408c21d99e3
4
- data.tar.gz: 327311f2ed35c365a9befe838807c0da8509e22e
2
+ SHA256:
3
+ metadata.gz: e08213b32115b0300bc05722840975c90683fc889df4e86a8729a578ef831da2
4
+ data.tar.gz: 18ae1b373d916802649d9e09538c4a03e2d78d43ef182715c86d120ccdf6f658
5
5
  SHA512:
6
- metadata.gz: 8dc600fd9447d2da3c5c18eb7e05e772c5e93766ba9756a1712b4e7d5b079d2d38c61f30e73eb79de534dcf3e4980afdae1bdac15857b55d81f1ee4466a772c3
7
- data.tar.gz: 937c3e70fef76dba63807f0e1b11fe8689fc1d0d7c87c4770e169b0b570e1d12b162bde3a46c0f9971e84bffb8f75b7ee7dd76522c204a1f39b05c618fd4cb3b
6
+ metadata.gz: 4e1474eeb747ab8b38fae89adee6811a960f18ec8c2bb191efb61fdb07215cfe572fa7bcd700fe6e2dec7b1141b36ac61309650cacc2926a937332ccd48f7cb4
7
+ data.tar.gz: f294a5e219fb5de05f98e737c5b0e96d7867d675f2c79b4939a7879036236f087a253d35e477e172a63155643f938145b338dd5a546f68c03095ff67bd48f10a
@@ -267,6 +267,24 @@ module Infusionsoft
267
267
  product_id, percentage, amount, payout_type, description, date)
268
268
  end
269
269
 
270
+ # adding a manual payment for an invoice.
271
+ # This can be useful when the payments are not handled by Infusionsoft
272
+ # but you still needs to makethe invoice as paid
273
+ #
274
+ # @param [Integer] invoice_id
275
+ # @param [Float] amount
276
+ # @param [Date] date (time)
277
+ # @param [String] payment_type
278
+ # - E.g 'Credit Card'
279
+ # @param [String] description
280
+ # @param [Boolean] bypass_commissions (Whether this payment
281
+ # should count towards affiliate commissions.)
282
+
283
+ def add_manual_payment(invoice_id, amount, date, payment_type, description, bypass_commission)
284
+ response = get('InvoiceService.addManualPayment', invoice_id, amount,
285
+ date, payment_type, description, bypass_commission)
286
+ end
287
+
270
288
 
271
289
  # Deprecated - Adds a recurring order to the database.
272
290
  def invoice_add_recurring_order_with_price(contact_id, allow_duplicate, cprogram_id, qty,
@@ -279,7 +297,7 @@ module Infusionsoft
279
297
 
280
298
  # Deprecated - returns the invoice id from a one time order.
281
299
  def invoice_get_invoice_id(order_id)
282
- response = get('InvoiceService.getinvoice_id', order_id)
300
+ response = get('InvoiceService.getInvoiceId', order_id)
283
301
  end
284
302
  end
285
303
  end
@@ -16,12 +16,15 @@ module Infusionsoft
16
16
  })
17
17
  client.http_header_extra = {'User-Agent' => user_agent}
18
18
  begin
19
- api_logger.info "CALL: #{service_call} api_url: #{api_url} api_key:#{api_key} at:#{Time.now} args:#{args.inspect}"
19
+ api_logger.info "CALL: #{service_call} api_url: #{api_url} at:#{Time.now} args:#{args.inspect}"
20
20
  result = client.call("#{service_call}", api_key, *args)
21
21
  if result.nil?; ok_to_retry('nil response') end
22
22
  rescue Timeout::Error => timeout
23
23
  # Retry up to 5 times on a Timeout before raising it
24
24
  ok_to_retry(timeout) ? retry : raise
25
+ rescue OpenSSL::SSL::SSLError => ssl_error
26
+ # Retry up to 5 times on a SSL Handshake issue w Infusionsoft
27
+ ok_to_retry(ssl_error) ? retry : raise
25
28
  rescue XMLRPC::FaultException => xmlrpc_error
26
29
  # Catch all XMLRPC exceptions and rethrow specific exceptions for each type of xmlrpc fault code
27
30
  Infusionsoft::ExceptionHandler.new(xmlrpc_error)
@@ -1,4 +1,4 @@
1
1
  module Infusionsoft
2
2
  # The version of the gem
3
- VERSION = '1.2.1'.freeze unless defined?(::Infusionsoft::VERSION)
3
+ VERSION = '1.2.2'.freeze unless defined?(::Infusionsoft::VERSION)
4
4
  end
@@ -18,4 +18,15 @@ class InvoiceTest < Test::Unit::TestCase
18
18
  end
19
19
  end
20
20
 
21
+ def test_add_manual_payment
22
+ VCR.use_cassette('invoice_add_manual_payment') do
23
+ result = Infusionsoft.invoice_add_manual_payment(60, 199.00, Time.now, 'Credit Card', 'Paid in full', false)
24
+
25
+ assert_instance_of TrueClass, result
26
+ end
27
+ end
28
+
29
+
30
+
31
+
21
32
  end
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: '<?xml version="1.0" ?><methodCall><methodName>InvoiceService.addManualPayment</methodName><params><param><value><string>13bd0f9f842441fb2c2bef3e9ca18db6</string></value></param><param><value><i4>60</i4></value></param><param><value><double>199.0</double></value></param><param><value><dateTime.iso8601>20171208T11:56:04</dateTime.iso8601></value></param><param><value><string>Credit
9
+ Card</string></value></param><param><value><string>Paid in full</string></value></param><param><value><boolean>0</boolean></value></param></params></methodCall>
10
+
11
+ '
12
+ headers:
13
+ User-Agent:
14
+ - Infusionsoft-1.2.0-a1 (RubyGem)
15
+ Content-Type:
16
+ - text/xml; charset=utf-8
17
+ Content-Length:
18
+ - '544'
19
+ Connection:
20
+ - keep-alive
21
+ Accept-Encoding:
22
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
23
+ Accept:
24
+ - "*/*"
25
+ response:
26
+ status:
27
+ code: 200
28
+ message: OK
29
+ headers:
30
+ Cache-Control:
31
+ - no-cache, no-store
32
+ Content-Type:
33
+ - text/xml;charset=UTF-8
34
+ Date:
35
+ - Fri, 08 Dec 2017 00:56:04 GMT
36
+ Expires:
37
+ - Fri, 08 Dec 2017 00:56:04 GMT
38
+ Pragma:
39
+ - no-cache
40
+ Server:
41
+ - Apache-Coyote
42
+ Set-Cookie:
43
+ - app-lb=!1NeLgEHXoumXOZ8vitCrYAxHQKcFLkyPXQbfrmps12iyapGnRjSDeX5+2MdcUx5kfspdV8ro+yAUMGMLC3IEKvrhF0QxV5BcT0mgXbNhhtUux37hZ8c2Y5cFymncwqosTT0bkq8fi2k7eHm/zSy/JfE0oeJI4BY=;
44
+ path=/; Httponly; Secure
45
+ Strict-Transport-Security:
46
+ - max-age=31536000; includeSubDomains
47
+ Vary:
48
+ - Accept-Encoding
49
+ X-Frame-Options:
50
+ - SAMEORIGIN
51
+ X-Robots-Tag:
52
+ - noindex, nofollow
53
+ Transfer-Encoding:
54
+ - chunked
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><boolean>1</boolean></value></param></params></methodResponse>
58
+ http_version:
59
+ recorded_at: Fri, 08 Dec 2017 00:56:05 GMT
60
+ recorded_with: VCR 4.0.0
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.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-19 00:00:00.000000000 Z
11
+ date: 2018-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -95,6 +95,7 @@ files:
95
95
  - test/vcr_cassettes/email_send_template.yml
96
96
  - test/vcr_cassettes/email_update_template.yml
97
97
  - test/vcr_cassettes/find_by_email.yml
98
+ - test/vcr_cassettes/invoice_add_manual_payment.yml
98
99
  - test/vcr_cassettes/invoice_add_recurring_order.yml
99
100
  - test/vcr_cassettes/invoice_add_subscription.yml
100
101
  - test/vcr_cassettes/remove_from_group.yml
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  version: 1.3.6
118
119
  requirements: []
119
120
  rubyforge_project:
120
- rubygems_version: 2.6.13
121
+ rubygems_version: 2.7.6
121
122
  signing_key:
122
123
  specification_version: 4
123
124
  summary: Ruby wrapper for the Infusionsoft API