infusionsoft 1.0.9 → 1.1.0a
Sign up to get free protection for your applications and to get access to all the features.
data/lib/infusionsoft/client.rb
CHANGED
@@ -14,6 +14,7 @@ module Infusionsoft
|
|
14
14
|
require 'infusionsoft/client/file'
|
15
15
|
require 'infusionsoft/client/ticket' # Deprecated by Infusionsoft
|
16
16
|
require 'infusionsoft/client/search'
|
17
|
+
require 'infusionsoft/client/credit_card'
|
17
18
|
|
18
19
|
include Infusionsoft::Client::Contact
|
19
20
|
include Infusionsoft::Client::Email
|
@@ -23,5 +24,6 @@ module Infusionsoft
|
|
23
24
|
include Infusionsoft::Client::File
|
24
25
|
include Infusionsoft::Client::Ticket # Deprecated by Infusionsoft
|
25
26
|
include Infusionsoft::Client::Search
|
27
|
+
include Infusionsoft::Client::CreditCard
|
26
28
|
end
|
27
29
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Infusionsoft
|
2
|
+
class Client
|
3
|
+
# CreditCardSubmission service is used to obtain a token that is to be submitted
|
4
|
+
# through a form when adding a credit card. In accordance with PCI compliance,
|
5
|
+
# adding credit cards through the API will no longer be supported.
|
6
|
+
module CreditCard
|
7
|
+
|
8
|
+
# This service will request a token that will be used when submitting
|
9
|
+
# a new credit card through a form
|
10
|
+
#
|
11
|
+
# @param [Integer] contact_id of the Infusionsoft contact
|
12
|
+
# @param [String] url that will be redirected to upon successfully adding card
|
13
|
+
# @param [String] url that will be redirected to when there is a failure upon adding card
|
14
|
+
def credit_card_request_token(contact_id, success_url, failure_url)
|
15
|
+
response = get('CreditCardSubmissionService.requestSubmissionToken', contact_id, success_url, failure_url)
|
16
|
+
end
|
17
|
+
|
18
|
+
def credit_card_lookup_by_token(token)
|
19
|
+
response = get('CreditCardSubmissionService.requestCreditCardId', token)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -18,8 +18,8 @@ module Infusionsoft
|
|
18
18
|
@retry_count += 1
|
19
19
|
puts "*** INFUSION API TIMEOUT: retrying #{@retry_count} ***"
|
20
20
|
retry if ok_to_retry
|
21
|
-
rescue
|
22
|
-
|
21
|
+
rescue => e
|
22
|
+
raise(InfusionAPIError, "*** INFUSION API ERROR: #{e.faultCode} - #{e.faultString} ***") if ['test', 'development', 'staging'].include?(Rails.env)
|
23
23
|
end
|
24
24
|
|
25
25
|
return result
|
@@ -31,3 +31,5 @@ module Infusionsoft
|
|
31
31
|
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
class InfusionAPIError < StandardError; end
|
data/lib/infusionsoft/version.rb
CHANGED
metadata
CHANGED
@@ -1,34 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: infusionsoft
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 9
|
10
|
-
version: 1.0.9
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0a
|
5
|
+
prerelease: 5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Nathan Leavitt
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-04-04 00:00:00 -07:00
|
19
|
-
default_executable:
|
12
|
+
date: 2012-07-30 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
14
|
description: A Ruby wrapper written for the Infusionsoft API
|
23
|
-
email:
|
15
|
+
email:
|
24
16
|
- nate@infusedsystems.com
|
25
17
|
executables: []
|
26
|
-
|
27
18
|
extensions: []
|
28
|
-
|
29
19
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
files:
|
20
|
+
files:
|
32
21
|
- .gitignore
|
33
22
|
- LICENSE.md
|
34
23
|
- README.md
|
@@ -38,6 +27,7 @@ files:
|
|
38
27
|
- lib/infusionsoft/client.rb
|
39
28
|
- lib/infusionsoft/client/affiliate.rb
|
40
29
|
- lib/infusionsoft/client/contact.rb
|
30
|
+
- lib/infusionsoft/client/credit_card.rb
|
41
31
|
- lib/infusionsoft/client/data.rb
|
42
32
|
- lib/infusionsoft/client/email.rb
|
43
33
|
- lib/infusionsoft/client/file.rb
|
@@ -50,41 +40,28 @@ files:
|
|
50
40
|
- lib/infusionsoft/request.rb
|
51
41
|
- lib/infusionsoft/version.rb
|
52
42
|
- test/api_infusion_test.rb
|
53
|
-
has_rdoc: true
|
54
43
|
homepage: https://github.com/nateleavitt/infusionsoft
|
55
44
|
licenses: []
|
56
|
-
|
57
45
|
post_install_message:
|
58
46
|
rdoc_options: []
|
59
|
-
|
60
|
-
require_paths:
|
47
|
+
require_paths:
|
61
48
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
50
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
|
68
|
-
|
69
|
-
- 0
|
70
|
-
version: "0"
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
56
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 1
|
79
|
-
- 3
|
80
|
-
- 6
|
81
|
-
version: 1.3.6
|
57
|
+
requirements:
|
58
|
+
- - ! '>'
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.3.1
|
82
61
|
requirements: []
|
83
|
-
|
84
62
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
63
|
+
rubygems_version: 1.8.24
|
86
64
|
signing_key:
|
87
65
|
specification_version: 3
|
88
66
|
summary: Ruby wrapper for the Infusionsoft API
|
89
67
|
test_files: []
|
90
|
-
|