simplify 1.0.1 → 1.1.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.
@@ -33,12 +33,28 @@ module Simplify
33
33
  #
34
34
  class Customer < Hash
35
35
 
36
- # Public key used to access the API.
37
- attr_accessor :public_key
36
+ # Authentication object used to access the API (See Simplify::Authentication for details)
37
+ attr_accessor :authentication
38
38
 
39
- # Private key used to access the API.
40
- attr_accessor :private_key
39
+ # Returns the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
40
+ def public_key
41
+ return self.authentication.public_key
42
+ end
41
43
 
44
+ # Sets the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
45
+ def public_key=(k)
46
+ return self.authentication.public_key = k
47
+ end
48
+
49
+ # Returns the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
50
+ def private_key
51
+ return self.authentication.private_key
52
+ end
53
+
54
+ # Sets the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
55
+ def private_key=(k)
56
+ return self.authentication.private_key = k
57
+ end
42
58
 
43
59
 
44
60
  # Creates an Customer object
@@ -66,28 +82,22 @@ class Customer < Hash
66
82
  # * <code>subscriptions => name</code> Name describing subscription
67
83
  # * <code>subscriptions => plan</code> The plan ID that the subscription should be created from.
68
84
  # * <code>subscriptions => quantity</code> Quantity of the plan for the subscription.
69
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
70
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
85
+ # * <code>token</code> If specified, card associated with card token will be used
86
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
71
87
  # Returns a Customer object.
72
- def self.create(parms, public_key = nil, private_key = nil)
73
- if public_key == nil then
74
- public_key = Simplify::public_key
75
- end
76
- if private_key == nil then
77
- private_key = Simplify::private_key
78
- end
79
-
80
- h = Simplify::PaymentsApi.execute("customer", 'create', parms, public_key, private_key)
88
+ def self.create(parms, *auth)
89
+
90
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
91
+ h = Simplify::PaymentsApi.execute("customer", 'create', parms, auth_obj)
81
92
  obj = Customer.new()
82
- obj.public_key = public_key
83
- obj.private_key = private_key
84
- obj = obj.merge(h)
93
+ obj.authentication = auth_obj
94
+ obj = obj.merge!(h)
85
95
  obj
86
96
  end
87
97
 
88
98
  # Delete this object
89
99
  def delete()
90
- h = Simplify::PaymentsApi.execute("customer", 'delete', self, self.public_key, self.private_key)
100
+ h = Simplify::PaymentsApi.execute("customer", 'delete', self, self.authentication)
91
101
  self.merge!(h)
92
102
  self
93
103
  end
@@ -98,24 +108,16 @@ class Customer < Hash
98
108
  # * <code>max</code> Allows up to a max of 50 list items to return. <b>default:20</b>
99
109
  # * <code>offset</code> Used in paging of the list. This is the start offset of the page. <b>default:0</b>
100
110
  # * <code>sorting</code> Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either <code>asc</code> for ascending or <code>desc</code> for descending). Sortable properties are: <code> dateCreated</code><code> id</code><code> name</code><code> email</code><code> reference</code>.
101
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
102
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
111
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
103
112
  # Returns an object where the <code>list</code> property contains the list of Customer objects and the <code>total</code>
104
113
  # property contains the total number of Customer objects available for the given criteria.
105
- def self.list(criteria = nil, public_key = nil, private_key = nil)
114
+ def self.list(criteria = nil, *auth)
106
115
 
107
- if public_key == nil then
108
- public_key = Simplify::public_key
109
- end
110
- if private_key == nil then
111
- private_key = Simplify::private_key
112
- end
113
-
114
- h = Simplify::PaymentsApi.execute("customer", 'list', criteria, public_key, private_key)
116
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
117
+ h = Simplify::PaymentsApi.execute("customer", 'list', criteria, auth_obj)
115
118
  obj = Customer.new()
116
- obj.public_key = public_key
117
- obj.private_key = private_key
118
- obj = obj.merge(h)
119
+ obj.authentication = auth_obj
120
+ obj = obj.merge!(h)
119
121
  obj
120
122
 
121
123
  end
@@ -123,22 +125,15 @@ class Customer < Hash
123
125
  # Retrieve a Customer object from the API
124
126
  #
125
127
  # id:: ID of object to retrieve
126
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
127
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
128
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
128
129
  # Returns a Customer object.
129
- def self.find(id, public_key = nil, private_key = nil)
130
- if public_key == nil then
131
- public_key = Simplify::public_key
132
- end
133
- if private_key == nil then
134
- private_key = Simplify::private_key
135
- end
136
-
137
- h = Simplify::PaymentsApi.execute("customer", 'show', {"id" => id}, public_key, private_key)
130
+ def self.find(id, *auth)
131
+
132
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
133
+ h = Simplify::PaymentsApi.execute("customer", 'show', {"id" => id}, auth_obj)
138
134
  obj = Customer.new()
139
- obj.public_key = public_key
140
- obj.private_key = private_key
141
- obj = obj.merge(h)
135
+ obj.authentication = auth_obj
136
+ obj = obj.merge!(h)
142
137
  obj
143
138
  end
144
139
 
@@ -160,7 +155,7 @@ class Customer < Hash
160
155
  # * <code>name</code> Customer name <b>(required)</b>
161
156
  # * <code>reference</code> Reference field for external applications use.
162
157
  def update()
163
- h = Simplify::PaymentsApi.execute("customer", 'update', self, self.public_key, self.private_key)
158
+ h = Simplify::PaymentsApi.execute("customer", 'update', self, self.authentication)
164
159
  self.merge!(h)
165
160
  self
166
161
  end
@@ -33,12 +33,28 @@ module Simplify
33
33
  #
34
34
  class Deposit < Hash
35
35
 
36
- # Public key used to access the API.
37
- attr_accessor :public_key
36
+ # Authentication object used to access the API (See Simplify::Authentication for details)
37
+ attr_accessor :authentication
38
38
 
39
- # Private key used to access the API.
40
- attr_accessor :private_key
39
+ # Returns the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
40
+ def public_key
41
+ return self.authentication.public_key
42
+ end
41
43
 
44
+ # Sets the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
45
+ def public_key=(k)
46
+ return self.authentication.public_key = k
47
+ end
48
+
49
+ # Returns the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
50
+ def private_key
51
+ return self.authentication.private_key
52
+ end
53
+
54
+ # Sets the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
55
+ def private_key=(k)
56
+ return self.authentication.private_key = k
57
+ end
42
58
 
43
59
 
44
60
  # Retrieve Deposit objects.
@@ -47,24 +63,16 @@ class Deposit < Hash
47
63
  # * <code>max</code> Allows up to a max of 50 list items to return. <b>default:20</b>
48
64
  # * <code>offset</code> Used in paging of the list. This is the start offset of the page. <b>default:0</b>
49
65
  # * <code>sorting</code> Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either <code>asc</code> for ascending or <code>desc</code> for descending). Sortable properties are: <code> amount</code><code> dateCreated</code><code> depositDate</code>.
50
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
51
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
66
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
52
67
  # Returns an object where the <code>list</code> property contains the list of Deposit objects and the <code>total</code>
53
68
  # property contains the total number of Deposit objects available for the given criteria.
54
- def self.list(criteria = nil, public_key = nil, private_key = nil)
55
-
56
- if public_key == nil then
57
- public_key = Simplify::public_key
58
- end
59
- if private_key == nil then
60
- private_key = Simplify::private_key
61
- end
69
+ def self.list(criteria = nil, *auth)
62
70
 
63
- h = Simplify::PaymentsApi.execute("deposit", 'list', criteria, public_key, private_key)
71
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
72
+ h = Simplify::PaymentsApi.execute("deposit", 'list', criteria, auth_obj)
64
73
  obj = Deposit.new()
65
- obj.public_key = public_key
66
- obj.private_key = private_key
67
- obj = obj.merge(h)
74
+ obj.authentication = auth_obj
75
+ obj = obj.merge!(h)
68
76
  obj
69
77
 
70
78
  end
@@ -72,22 +80,15 @@ class Deposit < Hash
72
80
  # Retrieve a Deposit object from the API
73
81
  #
74
82
  # id:: ID of object to retrieve
75
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
76
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
83
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
77
84
  # Returns a Deposit object.
78
- def self.find(id, public_key = nil, private_key = nil)
79
- if public_key == nil then
80
- public_key = Simplify::public_key
81
- end
82
- if private_key == nil then
83
- private_key = Simplify::private_key
84
- end
85
+ def self.find(id, *auth)
85
86
 
86
- h = Simplify::PaymentsApi.execute("deposit", 'show', {"id" => id}, public_key, private_key)
87
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
88
+ h = Simplify::PaymentsApi.execute("deposit", 'show', {"id" => id}, auth_obj)
87
89
  obj = Deposit.new()
88
- obj.public_key = public_key
89
- obj.private_key = private_key
90
- obj = obj.merge(h)
90
+ obj.authentication = auth_obj
91
+ obj = obj.merge!(h)
91
92
  obj
92
93
  end
93
94
 
@@ -37,26 +37,18 @@ class Event < Hash
37
37
  # params:: a hash of parameters; valid keys are:
38
38
  # * <code>payload</code> The raw JWS message payload. <b>required</b>
39
39
  # * <code>url</code> The URL for the webhook. If present it must match the URL registered for the webhook.
40
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
41
- # private_key:: API key to use for the API call. If nil, the value of Simplify::private_key will be used.
42
-
43
- def self.create(params, public_key = nil, private_key = nil)
44
-
45
- if public_key == nil then
46
- public_key = Simplify::public_key
47
- end
48
- if private_key == nil then
49
- private_key = Simplify::private_key
50
- end
40
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
41
+ #
42
+ def self.create(params, *auth)
51
43
 
52
- h = Simplify::PaymentsApi.jws_decode(params, public_key, private_key)
44
+ h = Simplify::PaymentsApi.jws_decode(params, Simplify::PaymentsApi.create_auth_object(auth))
53
45
 
54
46
  if !h['event']
55
47
  raise ApiException.new("Incorrect data in webhook event", nil, nil)
56
48
  end
57
49
 
58
50
  obj = Event.new()
59
- obj = obj.merge(h['event'])
51
+ obj = obj.merge!(h['event'])
60
52
 
61
53
  obj
62
54
  end
@@ -33,12 +33,28 @@ module Simplify
33
33
  #
34
34
  class Invoice < Hash
35
35
 
36
- # Public key used to access the API.
37
- attr_accessor :public_key
36
+ # Authentication object used to access the API (See Simplify::Authentication for details)
37
+ attr_accessor :authentication
38
38
 
39
- # Private key used to access the API.
40
- attr_accessor :private_key
39
+ # Returns the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
40
+ def public_key
41
+ return self.authentication.public_key
42
+ end
43
+
44
+ # Sets the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
45
+ def public_key=(k)
46
+ return self.authentication.public_key = k
47
+ end
48
+
49
+ # Returns the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
50
+ def private_key
51
+ return self.authentication.private_key
52
+ end
41
53
 
54
+ # Sets the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
55
+ def private_key=(k)
56
+ return self.authentication.private_key = k
57
+ end
42
58
 
43
59
 
44
60
  # Retrieve Invoice objects.
@@ -47,24 +63,16 @@ class Invoice < Hash
47
63
  # * <code>max</code> Allows up to a max of 50 list items to return. <b>default:20</b>
48
64
  # * <code>offset</code> Used in paging of the list. This is the start offset of the page. <b>default:0</b>
49
65
  # * <code>sorting</code> Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either <code>asc</code> for ascending or <code>desc</code> for descending). Sortable properties are: <code> id</code><code> invoiceDate</code><code> customer</code><code> amount</code><code> processedDate</code>.
50
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
51
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
66
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
52
67
  # Returns an object where the <code>list</code> property contains the list of Invoice objects and the <code>total</code>
53
68
  # property contains the total number of Invoice objects available for the given criteria.
54
- def self.list(criteria = nil, public_key = nil, private_key = nil)
69
+ def self.list(criteria = nil, *auth)
55
70
 
56
- if public_key == nil then
57
- public_key = Simplify::public_key
58
- end
59
- if private_key == nil then
60
- private_key = Simplify::private_key
61
- end
62
-
63
- h = Simplify::PaymentsApi.execute("invoice", 'list', criteria, public_key, private_key)
71
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
72
+ h = Simplify::PaymentsApi.execute("invoice", 'list', criteria, auth_obj)
64
73
  obj = Invoice.new()
65
- obj.public_key = public_key
66
- obj.private_key = private_key
67
- obj = obj.merge(h)
74
+ obj.authentication = auth_obj
75
+ obj = obj.merge!(h)
68
76
  obj
69
77
 
70
78
  end
@@ -72,22 +80,15 @@ class Invoice < Hash
72
80
  # Retrieve a Invoice object from the API
73
81
  #
74
82
  # id:: ID of object to retrieve
75
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
76
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
83
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
77
84
  # Returns a Invoice object.
78
- def self.find(id, public_key = nil, private_key = nil)
79
- if public_key == nil then
80
- public_key = Simplify::public_key
81
- end
82
- if private_key == nil then
83
- private_key = Simplify::private_key
84
- end
85
-
86
- h = Simplify::PaymentsApi.execute("invoice", 'show', {"id" => id}, public_key, private_key)
85
+ def self.find(id, *auth)
86
+
87
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
88
+ h = Simplify::PaymentsApi.execute("invoice", 'show', {"id" => id}, auth_obj)
87
89
  obj = Invoice.new()
88
- obj.public_key = public_key
89
- obj.private_key = private_key
90
- obj = obj.merge(h)
90
+ obj.authentication = auth_obj
91
+ obj = obj.merge!(h)
91
92
  obj
92
93
  end
93
94
 
@@ -96,7 +97,7 @@ class Invoice < Hash
96
97
  # The properties that can be updated:
97
98
  # * <code>status</code> Status of the invoice. Examples: OPEN = Invoice has not been processed and can have invoice items added to it. PAID = Invoice has been paid. UNPAID = Invoice was not paid when the card was processed. System will try up to 5 times to process the card. <b>(required)</b>
98
99
  def update()
99
- h = Simplify::PaymentsApi.execute("invoice", 'update', self, self.public_key, self.private_key)
100
+ h = Simplify::PaymentsApi.execute("invoice", 'update', self, self.authentication)
100
101
  self.merge!(h)
101
102
  self
102
103
  end
@@ -33,12 +33,28 @@ module Simplify
33
33
  #
34
34
  class InvoiceItem < Hash
35
35
 
36
- # Public key used to access the API.
37
- attr_accessor :public_key
36
+ # Authentication object used to access the API (See Simplify::Authentication for details)
37
+ attr_accessor :authentication
38
38
 
39
- # Private key used to access the API.
40
- attr_accessor :private_key
39
+ # Returns the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
40
+ def public_key
41
+ return self.authentication.public_key
42
+ end
41
43
 
44
+ # Sets the public key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
45
+ def public_key=(k)
46
+ return self.authentication.public_key = k
47
+ end
48
+
49
+ # Returns the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
50
+ def private_key
51
+ return self.authentication.private_key
52
+ end
53
+
54
+ # Sets the private key used when accessing this object. <b>Deprecated: please use 'authentication' instead.</b>
55
+ def private_key=(k)
56
+ return self.authentication.private_key = k
57
+ end
42
58
 
43
59
 
44
60
  # Creates an InvoiceItem object
@@ -48,28 +64,21 @@ class InvoiceItem < Hash
48
64
  # * <code>currency</code> Currency code (ISO-4217) for the invoice item. Must match the currency associated with your account. <b>required </b><b>default:USD</b>
49
65
  # * <code>description</code> Individual items of an invoice
50
66
  # * <code>invoice</code> Description of the invoice item <b>required </b>
51
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
52
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
67
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
53
68
  # Returns a InvoiceItem object.
54
- def self.create(parms, public_key = nil, private_key = nil)
55
- if public_key == nil then
56
- public_key = Simplify::public_key
57
- end
58
- if private_key == nil then
59
- private_key = Simplify::private_key
60
- end
61
-
62
- h = Simplify::PaymentsApi.execute("invoiceItem", 'create', parms, public_key, private_key)
69
+ def self.create(parms, *auth)
70
+
71
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
72
+ h = Simplify::PaymentsApi.execute("invoiceItem", 'create', parms, auth_obj)
63
73
  obj = InvoiceItem.new()
64
- obj.public_key = public_key
65
- obj.private_key = private_key
66
- obj = obj.merge(h)
74
+ obj.authentication = auth_obj
75
+ obj = obj.merge!(h)
67
76
  obj
68
77
  end
69
78
 
70
79
  # Delete this object
71
80
  def delete()
72
- h = Simplify::PaymentsApi.execute("invoiceItem", 'delete', self, self.public_key, self.private_key)
81
+ h = Simplify::PaymentsApi.execute("invoiceItem", 'delete', self, self.authentication)
73
82
  self.merge!(h)
74
83
  self
75
84
  end
@@ -80,24 +89,16 @@ class InvoiceItem < Hash
80
89
  # * <code>max</code> Allows up to a max of 50 list items to return. <b>default:20</b>
81
90
  # * <code>offset</code> Used in paging of the list. This is the start offset of the page. <b>default:0</b>
82
91
  # * <code>sorting</code> Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either <code>asc</code> for ascending or <code>desc</code> for descending). Sortable properties are: <code> id</code><code> amount</code><code> description</code><code> invoice</code>.
83
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
84
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
92
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
85
93
  # Returns an object where the <code>list</code> property contains the list of InvoiceItem objects and the <code>total</code>
86
94
  # property contains the total number of InvoiceItem objects available for the given criteria.
87
- def self.list(criteria = nil, public_key = nil, private_key = nil)
95
+ def self.list(criteria = nil, *auth)
88
96
 
89
- if public_key == nil then
90
- public_key = Simplify::public_key
91
- end
92
- if private_key == nil then
93
- private_key = Simplify::private_key
94
- end
95
-
96
- h = Simplify::PaymentsApi.execute("invoiceItem", 'list', criteria, public_key, private_key)
97
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
98
+ h = Simplify::PaymentsApi.execute("invoiceItem", 'list', criteria, auth_obj)
97
99
  obj = InvoiceItem.new()
98
- obj.public_key = public_key
99
- obj.private_key = private_key
100
- obj = obj.merge(h)
100
+ obj.authentication = auth_obj
101
+ obj = obj.merge!(h)
101
102
  obj
102
103
 
103
104
  end
@@ -105,22 +106,15 @@ class InvoiceItem < Hash
105
106
  # Retrieve a InvoiceItem object from the API
106
107
  #
107
108
  # id:: ID of object to retrieve
108
- # public_key:: Public to use for the API call. If nil, the value of Simplify::public_key will be used.
109
- # private_key:: Private key to use for the API call. If nil, the value of Simplify::private_key will be used.
109
+ # auth:: Authentication information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object.
110
110
  # Returns a InvoiceItem object.
111
- def self.find(id, public_key = nil, private_key = nil)
112
- if public_key == nil then
113
- public_key = Simplify::public_key
114
- end
115
- if private_key == nil then
116
- private_key = Simplify::private_key
117
- end
118
-
119
- h = Simplify::PaymentsApi.execute("invoiceItem", 'show', {"id" => id}, public_key, private_key)
111
+ def self.find(id, *auth)
112
+
113
+ auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
114
+ h = Simplify::PaymentsApi.execute("invoiceItem", 'show', {"id" => id}, auth_obj)
120
115
  obj = InvoiceItem.new()
121
- obj.public_key = public_key
122
- obj.private_key = private_key
123
- obj = obj.merge(h)
116
+ obj.authentication = auth_obj
117
+ obj = obj.merge!(h)
124
118
  obj
125
119
  end
126
120
 
@@ -131,7 +125,7 @@ class InvoiceItem < Hash
131
125
  # * <code>currency</code> Currency code (ISO-4217) for the invoice item. Must match the currency associated with your account.
132
126
  # * <code>description</code> Individual items of an invoice
133
127
  def update()
134
- h = Simplify::PaymentsApi.execute("invoiceItem", 'update', self, self.public_key, self.private_key)
128
+ h = Simplify::PaymentsApi.execute("invoiceItem", 'update', self, self.authentication)
135
129
  self.merge!(h)
136
130
  self
137
131
  end