simplify 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simplify.rb +1 -0
- data/lib/simplify/authorization.rb +136 -0
- data/lib/simplify/cardtoken.rb +1 -1
- data/lib/simplify/constants.rb +1 -1
- data/lib/simplify/coupon.rb +1 -1
- data/lib/simplify/customer.rb +3 -3
- data/lib/simplify/invoice.rb +18 -4
- data/lib/simplify/invoiceitem.rb +3 -2
- data/lib/simplify/payment.rb +15 -3
- data/lib/simplify/plan.rb +1 -1
- data/lib/simplify/refund.rb +2 -1
- data/lib/simplify/subscription.rb +2 -2
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a96a3cc9983f666a577ec70105891a6ae1a01f36
|
4
|
+
data.tar.gz: efdd46a334d6134a7c570d74681d831245a49ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a4000459bdfe55c6351841759e2d8d206b1225c8a83e477a7d2420d9a015fee748770f0aeee8bdc2d3e9845d1098ba2ccbec6830abb287389ea63f5e8083c7
|
7
|
+
data.tar.gz: b5b754ac3d89c2693b21e3ecce653b4f24598cc80b90b1f13fb2eb602132e06e9d6617fe74d0a1c221459363daa566dd61d9f0ddb6191d0898d8628362dcc035
|
data/lib/simplify.rb
CHANGED
@@ -26,6 +26,7 @@
|
|
26
26
|
#
|
27
27
|
|
28
28
|
require File.dirname(__FILE__) + '/simplify/authentication'
|
29
|
+
require File.dirname(__FILE__) + '/simplify/authorization'
|
29
30
|
require File.dirname(__FILE__) + '/simplify/accesstoken'
|
30
31
|
require File.dirname(__FILE__) + '/simplify/cardtoken'
|
31
32
|
require File.dirname(__FILE__) + '/simplify/chargeback'
|
@@ -0,0 +1,136 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2013, 2014 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'simplify/paymentsapi'
|
29
|
+
|
30
|
+
module Simplify
|
31
|
+
|
32
|
+
# A Authorization object.
|
33
|
+
#
|
34
|
+
class Authorization < Hash
|
35
|
+
|
36
|
+
# Authentication object used to access the API (See Simplify::Authentication for details)
|
37
|
+
attr_accessor :authentication
|
38
|
+
|
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
|
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
|
58
|
+
|
59
|
+
|
60
|
+
# Creates an Authorization object
|
61
|
+
#
|
62
|
+
# parms:: a hash of parameters; valid keys are:
|
63
|
+
# * <code>amount</code> Amount of the payment (in the smallest unit of your currency). Example: 100 = $1.00USD [min value: 50, max value: 9999900] <b>required </b>
|
64
|
+
# * <code>card => addressCity</code> City of the cardholder. [max length: 50, min length: 2]
|
65
|
+
# * <code>card => addressCountry</code> Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. [max length: 2, min length: 2]
|
66
|
+
# * <code>card => addressLine1</code> Address of the cardholder. [max length: 255]
|
67
|
+
# * <code>card => addressLine2</code> Address of the cardholder if needed. [max length: 255]
|
68
|
+
# * <code>card => addressState</code> State code (USPS code) of residence of the cardholder. [max length: 2, min length: 2]
|
69
|
+
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 characters in length and only contains numbers or letters. [max length: 9, min length: 3]
|
70
|
+
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123
|
71
|
+
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] <b>required </b>
|
72
|
+
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
73
|
+
# * <code>card => name</code> Name as it appears on the card. [max length: 50, min length: 2]
|
74
|
+
# * <code>card => number</code> Card number as it appears on the card. [max length: 19, min length: 13] <b>required </b>
|
75
|
+
# * <code>currency</code> Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] <b>required </b>
|
76
|
+
# * <code>customer</code> ID of customer. If specified, card on file of customer will be used.
|
77
|
+
# * <code>description</code> Free form text field to be used as a description of the payment. This field is echoed back with the payment on any find or list operations. [max length: 1024]
|
78
|
+
# * <code>reference</code> Custom reference field to be used with outside systems.
|
79
|
+
# * <code>replayId</code> An identifier that can be sent to uniquely identify a payment request to facilitate retries due to I/O related issues. This identifier must be unique for your account (sandbox or live) across all of your payments. If supplied, we will check for a payment on your account that matches this identifier, and if one is found we will attempt to return an identical response of the original request. [max length: 50, min length: 1]
|
80
|
+
# * <code>token</code> If specified, card associated with card token will be used. [max length: 255]
|
81
|
+
# 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.
|
82
|
+
# Returns a Authorization object.
|
83
|
+
def self.create(parms, *auth)
|
84
|
+
|
85
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
86
|
+
h = Simplify::PaymentsApi.execute("authorization", 'create', parms, auth_obj)
|
87
|
+
obj = Authorization.new()
|
88
|
+
obj.authentication = auth_obj
|
89
|
+
obj = obj.merge!(h)
|
90
|
+
obj
|
91
|
+
end
|
92
|
+
|
93
|
+
# Delete this object
|
94
|
+
def delete()
|
95
|
+
h = Simplify::PaymentsApi.execute("authorization", 'delete', self, self.authentication)
|
96
|
+
self.merge!(h)
|
97
|
+
self
|
98
|
+
end
|
99
|
+
|
100
|
+
# Retrieve Authorization objects.
|
101
|
+
# criteria:: a hash of parameters; valid keys are:
|
102
|
+
# * <code>filter</code> Filters to apply to the list.
|
103
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
104
|
+
# * <code>offset</code> Used in pagination of the list. This is the start offset of the page. [default: 0]
|
105
|
+
# * <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> amount</code><code> id</code><code> description</code><code> paymentDate</code>.
|
106
|
+
# 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.
|
107
|
+
# Returns an object where the <code>list</code> property contains the list of Authorization objects and the <code>total</code>
|
108
|
+
# property contains the total number of Authorization objects available for the given criteria.
|
109
|
+
def self.list(criteria = nil, *auth)
|
110
|
+
|
111
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
112
|
+
h = Simplify::PaymentsApi.execute("authorization", 'list', criteria, auth_obj)
|
113
|
+
obj = Authorization.new()
|
114
|
+
obj.authentication = auth_obj
|
115
|
+
obj = obj.merge!(h)
|
116
|
+
obj
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
# Retrieve a Authorization object from the API
|
121
|
+
#
|
122
|
+
# id:: ID of object to retrieve
|
123
|
+
# 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.
|
124
|
+
# Returns a Authorization object.
|
125
|
+
def self.find(id, *auth)
|
126
|
+
|
127
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
128
|
+
h = Simplify::PaymentsApi.execute("authorization", 'show', {"id" => id}, auth_obj)
|
129
|
+
obj = Authorization.new()
|
130
|
+
obj.authentication = auth_obj
|
131
|
+
obj = obj.merge!(h)
|
132
|
+
obj
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
data/lib/simplify/cardtoken.rb
CHANGED
@@ -66,7 +66,7 @@ class CardToken < Hash
|
|
66
66
|
# * <code>card => addressLine1</code> Address of the cardholder. [max length: 255]
|
67
67
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. [max length: 255]
|
68
68
|
# * <code>card => addressState</code> State code (USPS code) of residence of the cardholder. [max length: 2, min length: 2]
|
69
|
-
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers. [max length: 9, min length: 3]
|
69
|
+
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. [max length: 9, min length: 3]
|
70
70
|
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123
|
71
71
|
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] <b>required </b>
|
72
72
|
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
data/lib/simplify/constants.rb
CHANGED
@@ -30,7 +30,7 @@ module Simplify
|
|
30
30
|
# Constants.
|
31
31
|
class Constants
|
32
32
|
|
33
|
-
@@version = '1.
|
33
|
+
@@version = '1.2.0'
|
34
34
|
@@api_base_live_url = 'https://api.simplify.com/v1/api'
|
35
35
|
@@api_base_sandbox_url = 'https://sandbox.simplify.com/v1/api'
|
36
36
|
@@oauth_base_url = 'https://www.simplify.com/commerce/oauth';
|
data/lib/simplify/coupon.rb
CHANGED
@@ -60,7 +60,7 @@ class Coupon < Hash
|
|
60
60
|
# Creates an Coupon object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amountOff</code> Amount off of the price of the product in
|
63
|
+
# * <code>amountOff</code> Amount off of the price of the product in the smallest units of the currency of the merchant. While this field is optional, you must provide either amountOff or percentOff for a coupon. Example: 100 = $1.00USD [min value: 1, max value: 9999900]
|
64
64
|
# * <code>couponCode</code> Code that identifies the coupon to be used. [min length: 2] <b>required </b>
|
65
65
|
# * <code>description</code> A brief section that describes the coupon.
|
66
66
|
# * <code>durationInMonths</code> Duration in months that the coupon will be applied after it has first been selected. [min value: 1, max value: 9999]
|
data/lib/simplify/customer.rb
CHANGED
@@ -65,7 +65,7 @@ class Customer < Hash
|
|
65
65
|
# * <code>card => addressLine1</code> Address of the cardholder <b>required </b>
|
66
66
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. <b>required </b>
|
67
67
|
# * <code>card => addressState</code> State code (USPS code) of residence of the cardholder. <b>required </b>
|
68
|
-
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers. <b>required </b>
|
68
|
+
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. <b>required </b>
|
69
69
|
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123 <b>required </b>
|
70
70
|
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 <b>required </b>
|
71
71
|
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 <b>required </b>
|
@@ -75,7 +75,7 @@ class Customer < Hash
|
|
75
75
|
# * <code>email</code> Email address of the customer <b>required </b>
|
76
76
|
# * <code>name</code> Customer name [min length: 2] <b>required </b>
|
77
77
|
# * <code>reference</code> Reference field for external applications use.
|
78
|
-
# * <code>subscriptions => amount</code> Amount of payment in
|
78
|
+
# * <code>subscriptions => amount</code> Amount of payment in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 50, max value: 9999900]
|
79
79
|
# * <code>subscriptions => coupon</code> Coupon associated with the subscription for the customer.
|
80
80
|
# * <code>subscriptions => currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
81
81
|
# * <code>subscriptions => customer</code> The customer ID to create the subscription for. Do not supply this when creating a customer.
|
@@ -146,7 +146,7 @@ class Customer < Hash
|
|
146
146
|
# * <code>card => addressLine1</code> Address of the cardholder. <b>(required)</b>
|
147
147
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. <b>(required)</b>
|
148
148
|
# * <code>card => addressState</code> State code (USPS code) of residence of the cardholder. <b>(required)</b>
|
149
|
-
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers. <b>(required)</b>
|
149
|
+
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. <b>(required)</b>
|
150
150
|
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123 <b>(required)</b>
|
151
151
|
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 <b>(required)</b>
|
152
152
|
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 <b>(required)</b>
|
data/lib/simplify/invoice.rb
CHANGED
@@ -66,17 +66,24 @@ class Invoice < Hash
|
|
66
66
|
# * <code>dueDate</code> The date invoice payment is due. If a late fee is provided this will be added to the invoice total is the due date has past.
|
67
67
|
# * <code>email</code> The email of the customer we are invoicing. This is optional if a customer id is provided. A new customer will be created using the the name and email.
|
68
68
|
# * <code>invoiceId</code> User defined invoice id. If not provided the system will generate a numeric id. [max length: 255]
|
69
|
-
# * <code>items => amount</code> Amount of the invoice item (
|
69
|
+
# * <code>items => amount</code> Amount of the invoice item (the smallest unit of your currency). Example: 100 = $1.00USD [min value: 1, max value: 9999900] <b>required </b>
|
70
70
|
# * <code>items => description</code> The description of the invoice item. [max length: 1024]
|
71
71
|
# * <code>items => invoice</code> The ID of the invoice this item belongs to.
|
72
|
+
# * <code>items => product</code> The product this invoice item refers to. <b>required </b>
|
72
73
|
# * <code>items => quantity</code> Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999, default: 1]
|
73
74
|
# * <code>items => reference</code> User defined reference field. [max length: 255]
|
74
75
|
# * <code>items => tax</code> The tax ID of the tax charge in the invoice item.
|
75
|
-
# * <code>lateFee</code> The late fee amount that will be added to the invoice total is the due date is past due. Value provided must be in
|
76
|
+
# * <code>lateFee</code> The late fee amount that will be added to the invoice total is the due date is past due. Value provided must be in the smallest unit of your currency. Example: 100 = $1.00USD [max value: 9999900]
|
76
77
|
# * <code>memo</code> A memo that is displayed to the customer on the invoice payment screen. [max length: 4000]
|
77
78
|
# * <code>name</code> The name of the customer we are invoicing. This is optional if a customer id is provided. A new customer will be created using the the name and email. [max length: 50, min length: 2]
|
78
79
|
# * <code>note</code> This field can be used to store a note that is not displayed to the customer. [max length: 4000]
|
79
80
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
81
|
+
# * <code>shippingAddressLine1</code> Address Line 1 where the product should be shipped. [max length: 255]
|
82
|
+
# * <code>shippingAddressLine2</code> Address Line 2 where the product should be shipped. [max length: 255]
|
83
|
+
# * <code>shippingCity</code> City where the product should be shipped. [max length: 255, min length: 2]
|
84
|
+
# * <code>shippingCountry</code> Country where the product should be shipped. [max length: 2, min length: 2]
|
85
|
+
# * <code>shippingState</code> State where the product should be shipped. [max length: 2, min length: 2]
|
86
|
+
# * <code>shippingZip</code> ZIP code where the product should be shipped. [max length: 9, min length: 5]
|
80
87
|
# * <code>type</code> The type of invoice. One of WEB or MOBILE. [valid values: WEB, MOBILE, default: WEB]
|
81
88
|
# 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.
|
82
89
|
# Returns a Invoice object.
|
@@ -138,17 +145,24 @@ class Invoice < Hash
|
|
138
145
|
# * <code>datePaid</code> This is the date the invoice was PAID in UTC millis.
|
139
146
|
# * <code>discountRate</code> The discount percent as a decimal e.g. 12.5. This is used to calculate the discount amount which is subtracted from the total amount due before any tax is applied. [max length: 6]
|
140
147
|
# * <code>dueDate</code> The date invoice payment is due. If a late fee is provided this will be added to the invoice total is the due date has past.
|
141
|
-
# * <code>items => amount</code> Amount of the invoice item
|
148
|
+
# * <code>items => amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1, max value: 9999900] <b>(required)</b>
|
142
149
|
# * <code>items => description</code> The description of the invoice item. [max length: 1024]
|
143
150
|
# * <code>items => invoice</code> The ID of the invoice this item belongs to.
|
151
|
+
# * <code>items => product</code> The Id of the product this item refers to. <b>(required)</b>
|
144
152
|
# * <code>items => quantity</code> Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999, default: 1]
|
145
153
|
# * <code>items => reference</code> User defined reference field. [max length: 255]
|
146
154
|
# * <code>items => tax</code> The tax ID of the tax charge in the invoice item.
|
147
|
-
# * <code>lateFee</code> The late fee amount that will be added to the invoice total is the due date is past due. Value provided must be in
|
155
|
+
# * <code>lateFee</code> The late fee amount that will be added to the invoice total is the due date is past due. Value provided must be in the smallest unit of your currency. Example: 100 = $1.00USD
|
148
156
|
# * <code>memo</code> A memo that is displayed to the customer on the invoice payment screen. [max length: 4000]
|
149
157
|
# * <code>note</code> This field can be used to store a note that is not displayed to the customer. [max length: 4000]
|
150
158
|
# * <code>payment</code> The ID of the payment. Use this ID to query the /payment API. [max length: 255]
|
151
159
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
160
|
+
# * <code>shippingAddressLine1</code> The shipping address line 1 for the product. [max length: 255]
|
161
|
+
# * <code>shippingAddressLine2</code> The shipping address line 2 for the product. [max length: 255]
|
162
|
+
# * <code>shippingCity</code> The shipping city for the product. [max length: 255, min length: 2]
|
163
|
+
# * <code>shippingCountry</code> The shipping country for the product. [max length: 2, min length: 2]
|
164
|
+
# * <code>shippingState</code> The shipping state for the product. [max length: 2, min length: 2]
|
165
|
+
# * <code>shippingZip</code> The shipping ZIP code for the product. [max length: 9, min length: 5]
|
152
166
|
# * <code>status</code> New status of the invoice.
|
153
167
|
def update()
|
154
168
|
h = Simplify::PaymentsApi.execute("invoice", 'update', self, self.authentication)
|
data/lib/simplify/invoiceitem.rb
CHANGED
@@ -60,9 +60,10 @@ class InvoiceItem < Hash
|
|
60
60
|
# Creates an InvoiceItem object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amount</code> Amount of the invoice item
|
63
|
+
# * <code>amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1, max value: 9999900] <b>required </b>
|
64
64
|
# * <code>description</code> Individual items of an invoice [max length: 1024]
|
65
65
|
# * <code>invoice</code> The ID of the invoice this item belongs to.
|
66
|
+
# * <code>product</code> Product ID this item relates to. <b>required </b>
|
66
67
|
# * <code>quantity</code> Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999, default: 1]
|
67
68
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
68
69
|
# * <code>tax</code> The tax ID of the tax charge in the invoice item.
|
@@ -103,7 +104,7 @@ class InvoiceItem < Hash
|
|
103
104
|
# Updates this object
|
104
105
|
#
|
105
106
|
# The properties that can be updated:
|
106
|
-
# * <code>amount</code> Amount of the invoice item
|
107
|
+
# * <code>amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1, max value: 9999900]
|
107
108
|
# * <code>description</code> Individual items of an invoice
|
108
109
|
# * <code>quantity</code> Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999]
|
109
110
|
# * <code>reference</code> User defined reference field.
|
data/lib/simplify/payment.rb
CHANGED
@@ -60,13 +60,14 @@ class Payment < Hash
|
|
60
60
|
# Creates an Payment object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amount</code> Amount of the payment (
|
63
|
+
# * <code>amount</code> Amount of the payment (in the smallest unit of your currency). Example: 100 = $1.00USD [min value: 50, max value: 9999900]
|
64
|
+
# * <code>authorization</code> The ID of the authorization being used to capture the payment.
|
64
65
|
# * <code>card => addressCity</code> City of the cardholder. [max length: 50, min length: 2]
|
65
66
|
# * <code>card => addressCountry</code> Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. [max length: 2, min length: 2]
|
66
67
|
# * <code>card => addressLine1</code> Address of the cardholder. [max length: 255]
|
67
68
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. [max length: 255]
|
68
69
|
# * <code>card => addressState</code> State code (USPS code) of residence of the cardholder. [max length: 2, min length: 2]
|
69
|
-
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers. [max length: 9, min length: 3]
|
70
|
+
# * <code>card => addressZip</code> Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. [max length: 9, min length: 3]
|
70
71
|
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123
|
71
72
|
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] <b>required </b>
|
72
73
|
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
@@ -74,8 +75,10 @@ class Payment < Hash
|
|
74
75
|
# * <code>card => number</code> Card number as it appears on the card. [max length: 19, min length: 13] <b>required </b>
|
75
76
|
# * <code>currency</code> Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] <b>required </b>
|
76
77
|
# * <code>customer</code> ID of customer. If specified, card on file of customer will be used.
|
77
|
-
# * <code>description</code>
|
78
|
+
# * <code>description</code> Free form text field to be used as a description of the payment. This field is echoed back with the payment on any find or list operations. [max length: 1024]
|
79
|
+
# * <code>invoice</code> ID of invoice for which this payment is being made.
|
78
80
|
# * <code>reference</code> Custom reference field to be used with outside systems.
|
81
|
+
# * <code>replayId</code> An identifier that can be sent to uniquely identify a payment request to facilitate retries due to I/O related issues. This identifier must be unique for your account (sandbox or live) across all of your payments. If supplied, we will check for a payment on your account that matches this identifier. If found will attempt to return an identical response of the original request. [max length: 50, min length: 1]
|
79
82
|
# * <code>token</code> If specified, card associated with card token will be used. [max length: 255]
|
80
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.
|
81
84
|
# Returns a Payment object.
|
@@ -124,5 +127,14 @@ class Payment < Hash
|
|
124
127
|
obj
|
125
128
|
end
|
126
129
|
|
130
|
+
# Updates this object
|
131
|
+
#
|
132
|
+
# The properties that can be updated:
|
133
|
+
def update()
|
134
|
+
h = Simplify::PaymentsApi.execute("payment", 'update', self, self.authentication)
|
135
|
+
self.merge!(h)
|
136
|
+
self
|
137
|
+
end
|
138
|
+
|
127
139
|
end
|
128
140
|
end
|
data/lib/simplify/plan.rb
CHANGED
@@ -60,7 +60,7 @@ class Plan < Hash
|
|
60
60
|
# Creates an Plan object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amount</code> Amount of payment for the plan in
|
63
|
+
# * <code>amount</code> Amount of payment for the plan in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 50, max value: 9999900] <b>required </b>
|
64
64
|
# * <code>currency</code> Currency code (ISO-4217) for the plan. Must match the currency associated with your account. [default: USD] <b>required </b>
|
65
65
|
# * <code>frequency</code> Frequency of payment for the plan. Example: Monthly <b>required </b>
|
66
66
|
# * <code>name</code> Name of the plan [max length: 50, min length: 2] <b>required </b>
|
data/lib/simplify/refund.rb
CHANGED
@@ -60,10 +60,11 @@ class Refund < Hash
|
|
60
60
|
# Creates an Refund object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amount</code> Amount of the refund in
|
63
|
+
# * <code>amount</code> Amount of the refund in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1, max value: 9999900] <b>required </b>
|
64
64
|
# * <code>payment</code> ID of the payment for the refund <b>required </b>
|
65
65
|
# * <code>reason</code> Reason for the refund
|
66
66
|
# * <code>reference</code> Custom reference field to be used with outside systems.
|
67
|
+
# * <code>replayId</code> An identifier that can be sent to uniquely identify a refund request to facilitate retries due to I/O related issues. This identifier must be unique for your account (sandbox or live) across all of your refunds. If supplied, we will check for a refund on your account that matches this identifier. If found we will return an identical response to that of the original request. [max length: 50, min length: 1]
|
67
68
|
# 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.
|
68
69
|
# Returns a Refund object.
|
69
70
|
def self.create(parms, *auth)
|
@@ -60,7 +60,7 @@ class Subscription < Hash
|
|
60
60
|
# Creates an Subscription object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
-
# * <code>amount</code> Amount of the payment
|
63
|
+
# * <code>amount</code> Amount of the payment in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 50, max value: 9999900]
|
64
64
|
# * <code>coupon</code> Coupon ID associated with the subscription
|
65
65
|
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
66
66
|
# * <code>customer</code> Customer that is enrolling in the subscription.
|
@@ -125,7 +125,7 @@ class Subscription < Hash
|
|
125
125
|
# Updates this object
|
126
126
|
#
|
127
127
|
# The properties that can be updated:
|
128
|
-
# * <code>amount</code> Amount of the payment
|
128
|
+
# * <code>amount</code> Amount of the payment in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 50, max value: 9999900]
|
129
129
|
# * <code>coupon</code> Coupon being assigned to this subscription
|
130
130
|
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
131
131
|
# * <code>frequency</code> Frequency of payment for the plan. Example: Monthly
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simplify Commerce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ruby-hmac
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Ruby access to the Simplify Commerce API
|
@@ -58,9 +58,11 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
+
- lib/simplify.rb
|
61
62
|
- lib/simplify/accesstoken.rb
|
62
63
|
- lib/simplify/apiexception.rb
|
63
64
|
- lib/simplify/authentication.rb
|
65
|
+
- lib/simplify/authorization.rb
|
64
66
|
- lib/simplify/cardtoken.rb
|
65
67
|
- lib/simplify/chargeback.rb
|
66
68
|
- lib/simplify/constants.rb
|
@@ -77,7 +79,6 @@ files:
|
|
77
79
|
- lib/simplify/subscription.rb
|
78
80
|
- lib/simplify/tax.rb
|
79
81
|
- lib/simplify/webhook.rb
|
80
|
-
- lib/simplify.rb
|
81
82
|
homepage: https://www.simplify.com/commerce
|
82
83
|
licenses:
|
83
84
|
- BSD
|
@@ -88,17 +89,17 @@ require_paths:
|
|
88
89
|
- lib
|
89
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
90
91
|
requirements:
|
91
|
-
- -
|
92
|
+
- - ">="
|
92
93
|
- !ruby/object:Gem::Version
|
93
94
|
version: '0'
|
94
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
|
-
- -
|
97
|
+
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
98
99
|
version: '0'
|
99
100
|
requirements: []
|
100
101
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.2.2
|
102
103
|
signing_key:
|
103
104
|
specification_version: 4
|
104
105
|
summary: Simplify Commerce Ruby SDK
|