simplify 1.2.0 → 1.3.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 +3 -1
- data/lib/simplify/accesstoken.rb +1 -1
- data/lib/simplify/apiexception.rb +1 -1
- data/lib/simplify/authentication.rb +1 -1
- data/lib/simplify/authorization.rb +8 -6
- data/lib/simplify/cardtoken.rb +3 -3
- data/lib/simplify/chargeback.rb +3 -3
- data/lib/simplify/constants.rb +2 -2
- data/lib/simplify/coupon.rb +7 -6
- data/lib/simplify/customer.rb +11 -7
- data/lib/simplify/deposit.rb +3 -3
- data/lib/simplify/event.rb +1 -1
- data/lib/simplify/fraudcheck.rb +129 -0
- data/lib/simplify/invoice.rb +66 -25
- data/lib/simplify/invoiceitem.rb +4 -4
- data/lib/simplify/payment.rb +9 -7
- data/lib/simplify/paymentsapi.rb +1 -1
- data/lib/simplify/plan.rb +11 -5
- data/lib/simplify/refund.rb +6 -4
- data/lib/simplify/subscription.rb +15 -7
- data/lib/simplify/tax.rb +3 -3
- data/lib/simplify/transactionreview.rb +128 -0
- data/lib/simplify/webhook.rb +3 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84713c08a5adba068524df19e62b2b38bd74c768
|
4
|
+
data.tar.gz: e2af191c5d328304a12fcb429deabd8a615286b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9939403ac4b2e932809f818e1d66f35a86b429158a760ede50fbe445a909631aae80e9954e3de9cfa1f0ec447b7eaa81fffec44c8e105f5ff6b18ac2c4265f
|
7
|
+
data.tar.gz: 3bbc4bf783728f91500d17242aa6242adce26f70332f9b1f602c05f4d4c0406a0298ef7b150103d1716dab7e9e5fde572a111f7da438ed585eecb132388fa93c
|
data/lib/simplify.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -34,6 +34,7 @@ require File.dirname(__FILE__) + '/simplify/coupon'
|
|
34
34
|
require File.dirname(__FILE__) + '/simplify/customer'
|
35
35
|
require File.dirname(__FILE__) + '/simplify/deposit'
|
36
36
|
require File.dirname(__FILE__) + '/simplify/event'
|
37
|
+
require File.dirname(__FILE__) + '/simplify/fraudcheck'
|
37
38
|
require File.dirname(__FILE__) + '/simplify/invoice'
|
38
39
|
require File.dirname(__FILE__) + '/simplify/invoiceitem'
|
39
40
|
require File.dirname(__FILE__) + '/simplify/tax'
|
@@ -41,5 +42,6 @@ require File.dirname(__FILE__) + '/simplify/payment'
|
|
41
42
|
require File.dirname(__FILE__) + '/simplify/plan'
|
42
43
|
require File.dirname(__FILE__) + '/simplify/refund'
|
43
44
|
require File.dirname(__FILE__) + '/simplify/subscription'
|
45
|
+
require File.dirname(__FILE__) + '/simplify/transactionreview'
|
44
46
|
require File.dirname(__FILE__) + '/simplify/webhook'
|
45
47
|
|
data/lib/simplify/accesstoken.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,16 +60,16 @@ class Authorization < Hash
|
|
60
60
|
# Creates an Authorization object
|
61
61
|
#
|
62
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
|
63
|
+
# * <code>amount</code> Amount of the payment (in the smallest unit of your currency). Example: 100 = $1.00USD <b>required </b>
|
64
64
|
# * <code>card => addressCity</code> City of the cardholder. [max length: 50, min length: 2]
|
65
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
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
|
-
# * <code>card => addressState</code> State
|
68
|
+
# * <code>card => addressState</code> State of residence of the cardholder. For the US, this is a 2-digit USPS code. [max length: 255, min length: 2]
|
69
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
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
|
-
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
72
|
+
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] <b>required </b>
|
73
73
|
# * <code>card => name</code> Name as it appears on the card. [max length: 50, min length: 2]
|
74
74
|
# * <code>card => number</code> Card number as it appears on the card. [max length: 19, min length: 13] <b>required </b>
|
75
75
|
# * <code>currency</code> Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] <b>required </b>
|
@@ -77,6 +77,8 @@ class Authorization < Hash
|
|
77
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
78
|
# * <code>reference</code> Custom reference field to be used with outside systems.
|
79
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>statementDescription => name</code> Merchant name <b>required </b>
|
81
|
+
# * <code>statementDescription => phoneNumber</code> Merchant contact phone number.
|
80
82
|
# * <code>token</code> If specified, card associated with card token will be used. [max length: 255]
|
81
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.
|
82
84
|
# Returns a Authorization object.
|
@@ -100,8 +102,8 @@ class Authorization < Hash
|
|
100
102
|
# Retrieve Authorization objects.
|
101
103
|
# criteria:: a hash of parameters; valid keys are:
|
102
104
|
# * <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>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
106
|
+
# * <code>offset</code> Used in pagination of the list. This is the start offset of the page. [min value: 0, default: 0]
|
105
107
|
# * <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
108
|
# 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
109
|
# Returns an object where the <code>list</code> property contains the list of Authorization objects and the <code>total</code>
|
data/lib/simplify/cardtoken.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -65,11 +65,11 @@ class CardToken < Hash
|
|
65
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
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
|
-
# * <code>card => addressState</code> State
|
68
|
+
# * <code>card => addressState</code> State of residence of the cardholder. For the US, this is a 2-digit USPS code. [max length: 255, min length: 2]
|
69
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
|
-
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
72
|
+
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] <b>required </b>
|
73
73
|
# * <code>card => name</code> Name as appears on the card. [max length: 50, min length: 2]
|
74
74
|
# * <code>card => number</code> Card number as it appears on the card. [max length: 19, min length: 13] <b>required </b>
|
75
75
|
# * <code>key</code> Key used to create the card token.
|
data/lib/simplify/chargeback.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,8 +60,8 @@ class Chargeback < Hash
|
|
60
60
|
# Retrieve Chargeback objects.
|
61
61
|
# criteria:: a hash of parameters; valid keys are:
|
62
62
|
# * <code>filter</code> Filters to apply to the list.
|
63
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
64
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
63
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
64
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
65
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> amount</code><code> description</code><code> dateCreated</code>.
|
66
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.
|
67
67
|
# Returns an object where the <code>list</code> property contains the list of Chargeback objects and the <code>total</code>
|
data/lib/simplify/constants.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -30,7 +30,7 @@ module Simplify
|
|
30
30
|
# Constants.
|
31
31
|
class Constants
|
32
32
|
|
33
|
-
@@version = '1.
|
33
|
+
@@version = '1.3.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
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,12 +60,13 @@ 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 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
|
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]
|
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
|
-
# * <code>durationInMonths</code> Duration in months that the coupon will be applied after it has first been selected. [min value: 1, max value: 9999]
|
66
|
+
# * <code>durationInMonths</code> DEPRECATED - Duration in months that the coupon will be applied after it has first been selected. [min value: 1, max value: 9999]
|
67
67
|
# * <code>endDate</code> Last date of the coupon in UTC millis that the coupon can be applied to a subscription. This ends at 23:59:59 of the merchant timezone.
|
68
68
|
# * <code>maxRedemptions</code> Maximum number of redemptions allowed for the coupon. A redemption is defined as when the coupon is applied to the subscription for the first time. [min value: 1]
|
69
|
+
# * <code>numTimesApplied</code> The number of times a coupon will be applied on a customer's subscription. [min value: 1, max value: 9999]
|
69
70
|
# * <code>percentOff</code> Percentage off of the price of the product. While this field is optional, you must provide either amountOff or percentOff for a coupon. The percent off is a whole number. [min value: 1, max value: 100]
|
70
71
|
# * <code>startDate</code> First date of the coupon in UTC millis that the coupon can be applied to a subscription. This starts at midnight of the merchant timezone. <b>required </b>
|
71
72
|
# 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.
|
@@ -90,9 +91,9 @@ class Coupon < Hash
|
|
90
91
|
# Retrieve Coupon objects.
|
91
92
|
# criteria:: a hash of parameters; valid keys are:
|
92
93
|
# * <code>filter</code> Filters to apply to the list.
|
93
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
94
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
95
|
-
# * <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> maxRedemptions</code><code> timesRedeemed</code><code> id</code><code> startDate</code><code> endDate</code><code> percentOff</code><code> couponCode</code><code> durationInMonths</code><code> amountOff</code>.
|
94
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
95
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
96
|
+
# * <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> maxRedemptions</code><code> timesRedeemed</code><code> id</code><code> startDate</code><code> endDate</code><code> percentOff</code><code> couponCode</code><code> durationInMonths</code><code> numTimesApplied</code><code> amountOff</code>.
|
96
97
|
# 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.
|
97
98
|
# Returns an object where the <code>list</code> property contains the list of Coupon objects and the <code>total</code>
|
98
99
|
# property contains the total number of Coupon objects available for the given criteria.
|
data/lib/simplify/customer.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -64,7 +64,7 @@ class Customer < Hash
|
|
64
64
|
# * <code>card => addressCountry</code> Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. <b>required </b>
|
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
|
-
# * <code>card => addressState</code> State
|
67
|
+
# * <code>card => addressState</code> State of residence of the cardholder. For the US, this is a 2-digit USPS code. <b>required </b>
|
68
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>
|
@@ -75,14 +75,18 @@ 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 the smallest unit of your currency. Example: 100 = $1.00USD
|
78
|
+
# * <code>subscriptions => amount</code> Amount of payment in the smallest unit of your currency. Example: 100 = $1.00USD
|
79
|
+
# * <code>subscriptions => billingCycle</code> How the plan is billed to the customer. Values must be AUTO (indefinitely until the customer cancels) or FIXED (a fixed number of billing cycles). [default: AUTO]
|
80
|
+
# * <code>subscriptions => billingCycleLimit</code> The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
|
79
81
|
# * <code>subscriptions => coupon</code> Coupon associated with the subscription for the customer.
|
80
82
|
# * <code>subscriptions => currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
81
83
|
# * <code>subscriptions => customer</code> The customer ID to create the subscription for. Do not supply this when creating a customer.
|
82
|
-
# * <code>subscriptions => frequency</code> Frequency of payment for the plan.
|
84
|
+
# * <code>subscriptions => frequency</code> Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
|
85
|
+
# * <code>subscriptions => frequencyPeriod</code> Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly.
|
83
86
|
# * <code>subscriptions => name</code> Name describing subscription
|
84
87
|
# * <code>subscriptions => plan</code> The plan ID that the subscription should be created from.
|
85
88
|
# * <code>subscriptions => quantity</code> Quantity of the plan for the subscription. [min value: 1]
|
89
|
+
# * <code>subscriptions => renewalReminderLeadDays</code> If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
|
86
90
|
# * <code>token</code> If specified, card associated with card token will be used
|
87
91
|
# 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.
|
88
92
|
# Returns a Customer object.
|
@@ -106,8 +110,8 @@ class Customer < Hash
|
|
106
110
|
# Retrieve Customer objects.
|
107
111
|
# criteria:: a hash of parameters; valid keys are:
|
108
112
|
# * <code>filter</code> Filters to apply to the list.
|
109
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
110
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
113
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
114
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
111
115
|
# * <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>.
|
112
116
|
# 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.
|
113
117
|
# Returns an object where the <code>list</code> property contains the list of Customer objects and the <code>total</code>
|
@@ -145,7 +149,7 @@ class Customer < Hash
|
|
145
149
|
# * <code>card => addressCountry</code> Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. <b>(required)</b>
|
146
150
|
# * <code>card => addressLine1</code> Address of the cardholder. <b>(required)</b>
|
147
151
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. <b>(required)</b>
|
148
|
-
# * <code>card => addressState</code> State
|
152
|
+
# * <code>card => addressState</code> State of residence of the cardholder. For the US, this is a 2-digit USPS code. <b>(required)</b>
|
149
153
|
# * <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
154
|
# * <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
155
|
# * <code>card => expMonth</code> Expiration month of the card. Format is MM. Example: January = 01 <b>(required)</b>
|
data/lib/simplify/deposit.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,8 +60,8 @@ class Deposit < Hash
|
|
60
60
|
# Retrieve Deposit objects.
|
61
61
|
# criteria:: a hash of parameters; valid keys are:
|
62
62
|
# * <code>filter</code> Filters to apply to the list.
|
63
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
64
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
63
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
64
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
65
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>.
|
66
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.
|
67
67
|
# Returns an object where the <code>list</code> property contains the list of Deposit objects and the <code>total</code>
|
data/lib/simplify/event.rb
CHANGED
@@ -0,0 +1,129 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2013 - 2015 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 FraudCheck object.
|
33
|
+
#
|
34
|
+
class FraudCheck < 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 FraudCheck object
|
61
|
+
#
|
62
|
+
# parms:: a hash of parameters; valid keys are:
|
63
|
+
# * <code>amount</code> Amount of the transaction to be checked for fraud (in the smallest unit of your currency). Example: 100 = $1.00USD. This field is required if using “full” or “advanced” mode.
|
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 of residence of the cardholder. For the US, this is a 2-digit USPS code. [max length: 255, 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 [min value: 0, 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 to be checked for fraud. This field is required if using “full” or “advanced” mode.
|
76
|
+
# * <code>description</code> - Description of the fraud check. [max length: 255]
|
77
|
+
# * <code>ipAddress</code> IP Address of the customer for which the fraud check is to be done. [max length: 45]
|
78
|
+
# * <code>mode</code> Fraud check mode. “simple” only does an AVS and CVC check; “advanced” does a complete fraud check, running the input against the set up rules. [valid values: simple, advanced, full] <b>required </b>
|
79
|
+
# * <code>sessionId</code> Session ID used during data collection. [max length: 255]
|
80
|
+
# * <code>token</code> Card token token representing card details for the card to be checked. [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 FraudCheck object.
|
83
|
+
def self.create(parms, *auth)
|
84
|
+
|
85
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
86
|
+
h = Simplify::PaymentsApi.execute("fraudCheck", 'create', parms, auth_obj)
|
87
|
+
obj = FraudCheck.new()
|
88
|
+
obj.authentication = auth_obj
|
89
|
+
obj = obj.merge!(h)
|
90
|
+
obj
|
91
|
+
end
|
92
|
+
|
93
|
+
# Retrieve FraudCheck objects.
|
94
|
+
# criteria:: a hash of parameters; valid keys are:
|
95
|
+
# * <code>filter</code> Allows for ascending or descending sorting of the list.
|
96
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
97
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
98
|
+
# * <code>sorting</code> Used in paging of the list. This is the start offset of the page. The value maps properties to the sort direction (either <code>asc</code> for ascending or <code>desc</code> for descending). Sortable properties are: .
|
99
|
+
# 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.
|
100
|
+
# Returns an object where the <code>list</code> property contains the list of FraudCheck objects and the <code>total</code>
|
101
|
+
# property contains the total number of FraudCheck objects available for the given criteria.
|
102
|
+
def self.list(criteria = nil, *auth)
|
103
|
+
|
104
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
105
|
+
h = Simplify::PaymentsApi.execute("fraudCheck", 'list', criteria, auth_obj)
|
106
|
+
obj = FraudCheck.new()
|
107
|
+
obj.authentication = auth_obj
|
108
|
+
obj = obj.merge!(h)
|
109
|
+
obj
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
# Retrieve a FraudCheck object from the API
|
114
|
+
#
|
115
|
+
# id:: ID of object to retrieve
|
116
|
+
# 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.
|
117
|
+
# Returns a FraudCheck object.
|
118
|
+
def self.find(id, *auth)
|
119
|
+
|
120
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
121
|
+
h = Simplify::PaymentsApi.execute("fraudCheck", 'show', {"id" => id}, auth_obj)
|
122
|
+
obj = FraudCheck.new()
|
123
|
+
obj.authentication = auth_obj
|
124
|
+
obj = obj.merge!(h)
|
125
|
+
obj
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
data/lib/simplify/invoice.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,30 +60,49 @@ class Invoice < Hash
|
|
60
60
|
# Creates an Invoice object
|
61
61
|
#
|
62
62
|
# parms:: a hash of parameters; valid keys are:
|
63
|
+
# * <code>billingAddress => city</code> Billing address city of the location where the goods or services were supplied. [max length: 255, min length: 2]
|
64
|
+
# * <code>billingAddress => country</code> Billing address country of the location where the goods or services were supplied. [max length: 2, min length: 2]
|
65
|
+
# * <code>billingAddress => line1</code> Billing address line 1 of the location where the goods or services were supplied. [max length: 255]
|
66
|
+
# * <code>billingAddress => line2</code> Billing address line 2 of the location where the goods or services were supplied. [max length: 255]
|
67
|
+
# * <code>billingAddress => name</code> Billing address name of the location where the goods or services were supplied. Will use the customer name if not provided. [max length: 255]
|
68
|
+
# * <code>billingAddress => state</code> Billing address state of the location where the goods or services were supplied. [max length: 255]
|
69
|
+
# * <code>billingAddress => zip</code> Billing address zip of the location where the goods or services were supplied. [max length: 32]
|
70
|
+
# * <code>businessAddress => city</code> Address city of the business that is sending the invoice. [max length: 255, min length: 2]
|
71
|
+
# * <code>businessAddress => country</code> Address country of the business that is sending the invoice. [max length: 2, min length: 2]
|
72
|
+
# * <code>businessAddress => line1</code> Address line 1 of the business that is sending the invoice. [max length: 255]
|
73
|
+
# * <code>businessAddress => line2</code> Address line 2 of the business that is sending the invoice. [max length: 255]
|
74
|
+
# * <code>businessAddress => name</code> The name of the business that is sending the invoice. [max length: 255]
|
75
|
+
# * <code>businessAddress => state</code> Address state of the business that is sending the invoice. [max length: 255]
|
76
|
+
# * <code>businessAddress => zip</code> Address zip of the business that is sending the invoice. [max length: 32]
|
63
77
|
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [max length: 3, min length: 3, default: USD]
|
64
|
-
# * <code>customer</code> The customer ID of the customer we are invoicing. This is optional
|
78
|
+
# * <code>customer</code> The customer ID of the customer we are invoicing. This is optional if invoiceToCopy or a name and email are provided
|
79
|
+
# * <code>customerTaxNo</code> The tax number or VAT id of the person to whom the goods or services were supplied. [max length: 255]
|
65
80
|
# * <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]
|
66
81
|
# * <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
|
-
# * <code>email</code> The email of the customer we are invoicing. This is optional if
|
82
|
+
# * <code>email</code> The email of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email.
|
68
83
|
# * <code>invoiceId</code> User defined invoice id. If not provided the system will generate a numeric id. [max length: 255]
|
69
|
-
# * <code>
|
84
|
+
# * <code>invoiceToCopy</code> The id of an existing invoice to be copied. This is optional if customer or a name and email are provided
|
85
|
+
# * <code>items => amount</code> Amount of the invoice item (the smallest unit of your currency). Example: 100 = $1.00USD [min value: -9999900, max value: 9999900] <b>required </b>
|
70
86
|
# * <code>items => description</code> The description of the invoice item. [max length: 1024]
|
71
87
|
# * <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.
|
88
|
+
# * <code>items => product</code> The product this invoice item refers to.
|
73
89
|
# * <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]
|
74
90
|
# * <code>items => reference</code> User defined reference field. [max length: 255]
|
75
91
|
# * <code>items => tax</code> The tax ID of the tax charge in the invoice item.
|
76
92
|
# * <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]
|
77
93
|
# * <code>memo</code> A memo that is displayed to the customer on the invoice payment screen. [max length: 4000]
|
78
|
-
# * <code>name</code> The name of the customer we are invoicing. This is optional if
|
94
|
+
# * <code>name</code> The name of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email. [max length: 50, min length: 2]
|
79
95
|
# * <code>note</code> This field can be used to store a note that is not displayed to the customer. [max length: 4000]
|
80
96
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
81
|
-
# * <code>
|
82
|
-
# * <code>
|
83
|
-
# * <code>
|
84
|
-
# * <code>
|
85
|
-
# * <code>
|
86
|
-
# * <code>
|
97
|
+
# * <code>shippingAddress => city</code> Address city of the location where the goods or services were supplied. [max length: 255, min length: 2]
|
98
|
+
# * <code>shippingAddress => country</code> Address country of the location where the goods or services were supplied. [max length: 2, min length: 2]
|
99
|
+
# * <code>shippingAddress => line1</code> Address line 1 of the location where the goods or services were supplied. [max length: 255]
|
100
|
+
# * <code>shippingAddress => line2</code> Address line 2 of the location where the goods or services were supplied. [max length: 255]
|
101
|
+
# * <code>shippingAddress => name</code> Address name of the location where the goods or services were supplied. [max length: 255]
|
102
|
+
# * <code>shippingAddress => state</code> Address state of the location where the goods or services were supplied. [max length: 255]
|
103
|
+
# * <code>shippingAddress => zip</code> Address zip of the location where the goods or services were supplied. [max length: 32]
|
104
|
+
# * <code>suppliedDate</code> The date on which the goods or services were supplied.
|
105
|
+
# * <code>taxNo</code> The tax number or VAT id of the person who supplied the goods or services. [max length: 255]
|
87
106
|
# * <code>type</code> The type of invoice. One of WEB or MOBILE. [valid values: WEB, MOBILE, default: WEB]
|
88
107
|
# 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.
|
89
108
|
# Returns a Invoice object.
|
@@ -107,9 +126,9 @@ class Invoice < Hash
|
|
107
126
|
# Retrieve Invoice objects.
|
108
127
|
# criteria:: a hash of parameters; valid keys are:
|
109
128
|
# * <code>filter</code> Filters to apply to the list.
|
110
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
111
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
112
|
-
# * <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> dueDate</code><code> datePaid</code><code> customer</code><code> status</code>.
|
129
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
130
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
131
|
+
# * <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> dueDate</code><code> datePaid</code><code> customer</code><code> status</code><code> dateCreated</code>.
|
113
132
|
# 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.
|
114
133
|
# Returns an object where the <code>list</code> property contains the list of Invoice objects and the <code>total</code>
|
115
134
|
# property contains the total number of Invoice objects available for the given criteria.
|
@@ -142,28 +161,50 @@ class Invoice < Hash
|
|
142
161
|
# Updates this object
|
143
162
|
#
|
144
163
|
# The properties that can be updated:
|
145
|
-
# * <code>
|
164
|
+
# * <code>billingAddress => city</code> Billing address city of the location where the goods or services were supplied. [max length: 255, min length: 2]
|
165
|
+
# * <code>billingAddress => country</code> Billing address country of the location where the goods or services were supplied. [max length: 2, min length: 2]
|
166
|
+
# * <code>billingAddress => line1</code> Billing address line 1 of the location where the goods or services were supplied. [max length: 255]
|
167
|
+
# * <code>billingAddress => line2</code> Billing address line 2 of the location where the goods or services were supplied. [max length: 255]
|
168
|
+
# * <code>billingAddress => name</code> Billing address name of the location where the goods or services were supplied. [max length: 255]
|
169
|
+
# * <code>billingAddress => state</code> Billing address state of the location where the goods or services were supplied. [max length: 255]
|
170
|
+
# * <code>billingAddress => zip</code> Billing address zip of the location where the goods or services were supplied. [max length: 32]
|
171
|
+
# * <code>businessAddress => city</code> Business address city of the business that is sending the invoice. [max length: 255, min length: 2]
|
172
|
+
# * <code>businessAddress => country</code> Business address country of the business that is sending the invoice. [max length: 2, min length: 2]
|
173
|
+
# * <code>businessAddress => line1</code> Business address line 1 of the business that is sending the invoice. [max length: 255]
|
174
|
+
# * <code>businessAddress => line2</code> Business address line 2 of the business that is sending the invoice. [max length: 255]
|
175
|
+
# * <code>businessAddress => name</code> Business address name of the business that is sending the invoice. [max length: 255]
|
176
|
+
# * <code>businessAddress => state</code> Business address state of the business that is sending the invoice. [max length: 255]
|
177
|
+
# * <code>businessAddress => zip</code> Business address zip of the business that is sending the invoice. [max length: 32]
|
178
|
+
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [max length: 3, min length: 3]
|
179
|
+
# * <code>customerTaxNo</code> The tax number or VAT id of the person to whom the goods or services were supplied. [max length: 255]
|
180
|
+
# * <code>datePaid</code> This is the date the invoice was PAID in UTC millis.
|
146
181
|
# * <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]
|
147
182
|
# * <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.
|
148
|
-
# * <code>
|
183
|
+
# * <code>email</code> The email of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email.
|
184
|
+
# * <code>invoiceId</code> User defined invoice id. If not provided the system will generate a numeric id. [max length: 255]
|
185
|
+
# * <code>items => amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: -9999900, max value: 9999900] <b>(required)</b>
|
149
186
|
# * <code>items => description</code> The description of the invoice item. [max length: 1024]
|
150
187
|
# * <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.
|
188
|
+
# * <code>items => product</code> The Id of the product this item refers to.
|
152
189
|
# * <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]
|
153
190
|
# * <code>items => reference</code> User defined reference field. [max length: 255]
|
154
191
|
# * <code>items => tax</code> The tax ID of the tax charge in the invoice item.
|
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
|
192
|
+
# * <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]
|
156
193
|
# * <code>memo</code> A memo that is displayed to the customer on the invoice payment screen. [max length: 4000]
|
194
|
+
# * <code>name</code> The name of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email. [max length: 50, min length: 2]
|
157
195
|
# * <code>note</code> This field can be used to store a note that is not displayed to the customer. [max length: 4000]
|
158
196
|
# * <code>payment</code> The ID of the payment. Use this ID to query the /payment API. [max length: 255]
|
159
197
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
160
|
-
# * <code>
|
161
|
-
# * <code>
|
162
|
-
# * <code>
|
163
|
-
# * <code>
|
164
|
-
# * <code>
|
165
|
-
# * <code>
|
198
|
+
# * <code>shippingAddress => city</code> Address city of the location where the goods or services were supplied. [max length: 255, min length: 2]
|
199
|
+
# * <code>shippingAddress => country</code> Address country of the location where the goods or services were supplied. [max length: 2, min length: 2]
|
200
|
+
# * <code>shippingAddress => line1</code> Address line 1 of the location where the goods or services were supplied. [max length: 255]
|
201
|
+
# * <code>shippingAddress => line2</code> Address line 2 of the location where the goods or services were supplied. [max length: 255]
|
202
|
+
# * <code>shippingAddress => name</code> Address name of the location where the goods or services were supplied. [max length: 255]
|
203
|
+
# * <code>shippingAddress => state</code> Address state of the location where the goods or services were supplied. [max length: 255]
|
204
|
+
# * <code>shippingAddress => zip</code> Address zip of the location where the goods or services were supplied. [max length: 32]
|
166
205
|
# * <code>status</code> New status of the invoice.
|
206
|
+
# * <code>suppliedDate</code> The date on which the goods or services were supplied.
|
207
|
+
# * <code>taxNo</code> The tax number or VAT id of the person who supplied the goods or services. [max length: 255]
|
167
208
|
def update()
|
168
209
|
h = Simplify::PaymentsApi.execute("invoice", 'update', self, self.authentication)
|
169
210
|
self.merge!(h)
|
data/lib/simplify/invoiceitem.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,10 +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 in the smallest unit of your currency. Example: 100 = $1.00USD [min value:
|
63
|
+
# * <code>amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: -9999900, 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.
|
66
|
+
# * <code>product</code> Product ID this item relates to.
|
67
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]
|
68
68
|
# * <code>reference</code> User defined reference field. [max length: 255]
|
69
69
|
# * <code>tax</code> The tax ID of the tax charge in the invoice item.
|
@@ -104,7 +104,7 @@ class InvoiceItem < Hash
|
|
104
104
|
# Updates this object
|
105
105
|
#
|
106
106
|
# The properties that can be updated:
|
107
|
-
# * <code>amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1
|
107
|
+
# * <code>amount</code> Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1]
|
108
108
|
# * <code>description</code> Individual items of an invoice
|
109
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]
|
110
110
|
# * <code>reference</code> User defined reference field.
|
data/lib/simplify/payment.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,17 +60,17 @@ 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 (in the smallest unit of your currency). Example: 100 = $1.00USD
|
63
|
+
# * <code>amount</code> Amount of the payment (in the smallest unit of your currency). Example: 100 = $1.00USD
|
64
64
|
# * <code>authorization</code> The ID of the authorization being used to capture the payment.
|
65
65
|
# * <code>card => addressCity</code> City of the cardholder. [max length: 50, min length: 2]
|
66
66
|
# * <code>card => addressCountry</code> Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. [max length: 2, min length: 2]
|
67
67
|
# * <code>card => addressLine1</code> Address of the cardholder. [max length: 255]
|
68
68
|
# * <code>card => addressLine2</code> Address of the cardholder if needed. [max length: 255]
|
69
|
-
# * <code>card => addressState</code> State
|
69
|
+
# * <code>card => addressState</code> State of residence of the cardholder. For the US, this is a 2-digit USPS code. [max length: 255, min length: 2]
|
70
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]
|
71
71
|
# * <code>card => cvc</code> CVC security code of the card. This is the code on the back of the card. Example: 123
|
72
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>
|
73
|
-
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [max value: 99] <b>required </b>
|
73
|
+
# * <code>card => expYear</code> Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] <b>required </b>
|
74
74
|
# * <code>card => name</code> Name as it appears on the card. [max length: 50, min length: 2]
|
75
75
|
# * <code>card => number</code> Card number as it appears on the card. [max length: 19, min length: 13] <b>required </b>
|
76
76
|
# * <code>currency</code> Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] <b>required </b>
|
@@ -79,6 +79,8 @@ class Payment < Hash
|
|
79
79
|
# * <code>invoice</code> ID of invoice for which this payment is being made.
|
80
80
|
# * <code>reference</code> Custom reference field to be used with outside systems.
|
81
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]
|
82
|
+
# * <code>statementDescription => name</code> Merchant name. <b>required </b>
|
83
|
+
# * <code>statementDescription => phoneNumber</code> Merchant contact phone number.
|
82
84
|
# * <code>token</code> If specified, card associated with card token will be used. [max length: 255]
|
83
85
|
# 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.
|
84
86
|
# Returns a Payment object.
|
@@ -95,9 +97,9 @@ class Payment < Hash
|
|
95
97
|
# Retrieve Payment objects.
|
96
98
|
# criteria:: a hash of parameters; valid keys are:
|
97
99
|
# * <code>filter</code> Filters to apply to the list.
|
98
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
99
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
100
|
-
# * <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>.
|
100
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
101
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
102
|
+
# * <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> createdBy</code><code> amount</code><code> id</code><code> description</code><code> paymentDate</code>.
|
101
103
|
# 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.
|
102
104
|
# Returns an object where the <code>list</code> property contains the list of Payment objects and the <code>total</code>
|
103
105
|
# property contains the total number of Payment objects available for the given criteria.
|
data/lib/simplify/paymentsapi.rb
CHANGED
data/lib/simplify/plan.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,10 +60,16 @@ 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 the smallest unit of your currency. Example: 100 = $1.00USD
|
63
|
+
# * <code>amount</code> Amount of payment for the plan in the smallest unit of your currency. Example: 100 = $1.00USD <b>required </b>
|
64
|
+
# * <code>billingCycle</code> How the plan is billed to the customer. Values must be AUTO (indefinitely until the customer cancels) or FIXED (a fixed number of billing cycles). [default: AUTO]
|
65
|
+
# * <code>billingCycleLimit</code> The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
|
64
66
|
# * <code>currency</code> Currency code (ISO-4217) for the plan. Must match the currency associated with your account. [default: USD] <b>required </b>
|
65
|
-
# * <code>frequency</code> Frequency of payment for the plan.
|
67
|
+
# * <code>frequency</code> Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY". [default: MONTHLY] <b>required </b>
|
68
|
+
# * <code>frequencyPeriod</code> Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly. [min value: 1, default: 1] <b>required </b>
|
66
69
|
# * <code>name</code> Name of the plan [max length: 50, min length: 2] <b>required </b>
|
70
|
+
# * <code>renewalReminderLeadDays</code> If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
|
71
|
+
# * <code>trialPeriod</code> Plan free trial period selection. Must be Days, Weeks, or Month [default: NONE] <b>required </b>
|
72
|
+
# * <code>trialPeriodQuantity</code> Quantity of the trial period. Must be greater than 0 and a whole number. [min value: 1]
|
67
73
|
# 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
74
|
# Returns a Plan object.
|
69
75
|
def self.create(parms, *auth)
|
@@ -86,8 +92,8 @@ class Plan < Hash
|
|
86
92
|
# Retrieve Plan objects.
|
87
93
|
# criteria:: a hash of parameters; valid keys are:
|
88
94
|
# * <code>filter</code> Filters to apply to the list.
|
89
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
90
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
95
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
96
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
91
97
|
# * <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> frequency</code><code> name</code><code> id</code>.
|
92
98
|
# 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.
|
93
99
|
# Returns an object where the <code>list</code> property contains the list of Plan objects and the <code>total</code>
|
data/lib/simplify/refund.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,11 +60,13 @@ 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 the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1
|
63
|
+
# * <code>amount</code> Amount of the refund in the smallest unit of your currency. Example: 100 = $1.00USD [min value: 1] <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
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]
|
68
|
+
# * <code>statementDescription => name</code> Merchant name. <b>required </b>
|
69
|
+
# * <code>statementDescription => phoneNumber</code> Merchant contact phone number.
|
68
70
|
# 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.
|
69
71
|
# Returns a Refund object.
|
70
72
|
def self.create(parms, *auth)
|
@@ -80,8 +82,8 @@ class Refund < Hash
|
|
80
82
|
# Retrieve Refund objects.
|
81
83
|
# criteria:: a hash of parameters; valid keys are:
|
82
84
|
# * <code>filter</code> Filters to apply to the list.
|
83
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
84
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
85
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
86
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
85
87
|
# * <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> dateCreated</code><code> paymentDate</code>.
|
86
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.
|
87
89
|
# Returns an object where the <code>list</code> property contains the list of Refund objects and the <code>total</code>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -60,14 +60,18 @@ 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 in the smallest unit of your currency. Example: 100 = $1.00USD
|
63
|
+
# * <code>amount</code> Amount of the payment in the smallest unit of your currency. Example: 100 = $1.00USD
|
64
|
+
# * <code>billingCycle</code> How the plan is billed to the customer. Values must be AUTO (indefinitely until the customer cancels) or FIXED (a fixed number of billing cycles). [default: AUTO]
|
65
|
+
# * <code>billingCycleLimit</code> The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
|
64
66
|
# * <code>coupon</code> Coupon ID associated with the subscription
|
65
67
|
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
66
68
|
# * <code>customer</code> Customer that is enrolling in the subscription.
|
67
|
-
# * <code>frequency</code> Frequency of payment for the plan.
|
69
|
+
# * <code>frequency</code> Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
|
70
|
+
# * <code>frequencyPeriod</code> Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly.
|
68
71
|
# * <code>name</code> Name describing subscription
|
69
72
|
# * <code>plan</code> The ID of the plan that should be used for the subscription.
|
70
73
|
# * <code>quantity</code> Quantity of the plan for the subscription. [min value: 1]
|
74
|
+
# * <code>renewalReminderLeadDays</code> If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
|
71
75
|
# 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.
|
72
76
|
# Returns a Subscription object.
|
73
77
|
def self.create(parms, *auth)
|
@@ -90,8 +94,8 @@ class Subscription < Hash
|
|
90
94
|
# Retrieve Subscription objects.
|
91
95
|
# criteria:: a hash of parameters; valid keys are:
|
92
96
|
# * <code>filter</code> Filters to apply to the list.
|
93
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
94
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
97
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
98
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
95
99
|
# * <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> plan</code>.
|
96
100
|
# 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.
|
97
101
|
# Returns an object where the <code>list</code> property contains the list of Subscription objects and the <code>total</code>
|
@@ -125,14 +129,18 @@ class Subscription < Hash
|
|
125
129
|
# Updates this object
|
126
130
|
#
|
127
131
|
# The properties that can be updated:
|
128
|
-
# * <code>amount</code> Amount of the payment in the smallest unit of your currency. Example: 100 = $1.00USD
|
132
|
+
# * <code>amount</code> Amount of the payment in the smallest unit of your currency. Example: 100 = $1.00USD
|
133
|
+
# * <code>billingCycle</code> How the plan is billed to the customer. Values must be AUTO (indefinitely until the customer cancels) or FIXED (a fixed number of billing cycles). [default: AUTO]
|
134
|
+
# * <code>billingCycleLimit</code> The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
|
129
135
|
# * <code>coupon</code> Coupon being assigned to this subscription
|
130
136
|
# * <code>currency</code> Currency code (ISO-4217). Must match the currency associated with your account. [default: USD]
|
131
|
-
# * <code>frequency</code> Frequency of payment for the plan.
|
137
|
+
# * <code>frequency</code> Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
|
138
|
+
# * <code>frequencyPeriod</code> Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly. [min value: 1]
|
132
139
|
# * <code>name</code> Name describing subscription
|
133
140
|
# * <code>plan</code> Plan that should be used for the subscription.
|
134
141
|
# * <code>prorate</code> Whether to prorate existing subscription. [default: true] <b>(required)</b>
|
135
142
|
# * <code>quantity</code> Quantity of the plan for the subscription. [min value: 1]
|
143
|
+
# * <code>renewalReminderLeadDays</code> If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null or 0, no emails are sent. Minimum value is 7 if set.
|
136
144
|
def update()
|
137
145
|
h = Simplify::PaymentsApi.execute("subscription", 'update', self, self.authentication)
|
138
146
|
self.merge!(h)
|
data/lib/simplify/tax.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -84,8 +84,8 @@ class Tax < Hash
|
|
84
84
|
# Retrieve Tax objects.
|
85
85
|
# criteria:: a hash of parameters; valid keys are:
|
86
86
|
# * <code>filter</code> Filters to apply to the list.
|
87
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
88
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
87
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
88
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
89
89
|
# * <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> label</code>.
|
90
90
|
# 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.
|
91
91
|
# Returns an object where the <code>list</code> property contains the list of Tax objects and the <code>total</code>
|
@@ -0,0 +1,128 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2013 - 2015 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 TransactionReview object.
|
33
|
+
#
|
34
|
+
class TransactionReview < 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 TransactionReview object
|
61
|
+
#
|
62
|
+
# parms:: a hash of parameters; valid keys are:
|
63
|
+
# 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.
|
64
|
+
# Returns a TransactionReview object.
|
65
|
+
def self.create(parms, *auth)
|
66
|
+
|
67
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
68
|
+
h = Simplify::PaymentsApi.execute("transactionReview", 'create', parms, auth_obj)
|
69
|
+
obj = TransactionReview.new()
|
70
|
+
obj.authentication = auth_obj
|
71
|
+
obj = obj.merge!(h)
|
72
|
+
obj
|
73
|
+
end
|
74
|
+
|
75
|
+
# Delete this object
|
76
|
+
def delete()
|
77
|
+
h = Simplify::PaymentsApi.execute("transactionReview", 'delete', self, self.authentication)
|
78
|
+
self.merge!(h)
|
79
|
+
self
|
80
|
+
end
|
81
|
+
|
82
|
+
# Retrieve TransactionReview objects.
|
83
|
+
# criteria:: a hash of parameters; valid keys are:
|
84
|
+
# * <code>filter</code> Allows for ascending or descending sorting of the list.
|
85
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
86
|
+
# * <code>offset</code> Filters to apply to the list. [min value: 0, default: 0]
|
87
|
+
# * <code>sorting</code> Used in paging of the list. This is the start offset of the page. 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> status</code>.
|
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.
|
89
|
+
# Returns an object where the <code>list</code> property contains the list of TransactionReview objects and the <code>total</code>
|
90
|
+
# property contains the total number of TransactionReview objects available for the given criteria.
|
91
|
+
def self.list(criteria = nil, *auth)
|
92
|
+
|
93
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
94
|
+
h = Simplify::PaymentsApi.execute("transactionReview", 'list', criteria, auth_obj)
|
95
|
+
obj = TransactionReview.new()
|
96
|
+
obj.authentication = auth_obj
|
97
|
+
obj = obj.merge!(h)
|
98
|
+
obj
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# Retrieve a TransactionReview object from the API
|
103
|
+
#
|
104
|
+
# id:: ID of object to retrieve
|
105
|
+
# 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.
|
106
|
+
# Returns a TransactionReview object.
|
107
|
+
def self.find(id, *auth)
|
108
|
+
|
109
|
+
auth_obj = Simplify::PaymentsApi.create_auth_object(auth)
|
110
|
+
h = Simplify::PaymentsApi.execute("transactionReview", 'show', {"id" => id}, auth_obj)
|
111
|
+
obj = TransactionReview.new()
|
112
|
+
obj.authentication = auth_obj
|
113
|
+
obj = obj.merge!(h)
|
114
|
+
obj
|
115
|
+
end
|
116
|
+
|
117
|
+
# Updates this object
|
118
|
+
#
|
119
|
+
# The properties that can be updated:
|
120
|
+
# * <code>status</code> Status of the transaction review.
|
121
|
+
def update()
|
122
|
+
h = Simplify::PaymentsApi.execute("transactionReview", 'update', self, self.authentication)
|
123
|
+
self.merge!(h)
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
end
|
data/lib/simplify/webhook.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013
|
2
|
+
# Copyright (c) 2013 - 2015 MasterCard International Incorporated
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification, are
|
@@ -83,8 +83,8 @@ class Webhook < Hash
|
|
83
83
|
# Retrieve Webhook objects.
|
84
84
|
# criteria:: a hash of parameters; valid keys are:
|
85
85
|
# * <code>filter</code> Filters to apply to the list.
|
86
|
-
# * <code>max</code> Allows up to a max of 50 list items to return. [max value: 50, default: 20]
|
87
|
-
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [default: 0]
|
86
|
+
# * <code>max</code> Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
|
87
|
+
# * <code>offset</code> Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
|
88
88
|
# * <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>.
|
89
89
|
# 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.
|
90
90
|
# Returns an object where the <code>list</code> property contains the list of Webhook objects and the <code>total</code>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/simplify/customer.rb
|
71
71
|
- lib/simplify/deposit.rb
|
72
72
|
- lib/simplify/event.rb
|
73
|
+
- lib/simplify/fraudcheck.rb
|
73
74
|
- lib/simplify/invoice.rb
|
74
75
|
- lib/simplify/invoiceitem.rb
|
75
76
|
- lib/simplify/payment.rb
|
@@ -78,6 +79,7 @@ files:
|
|
78
79
|
- lib/simplify/refund.rb
|
79
80
|
- lib/simplify/subscription.rb
|
80
81
|
- lib/simplify/tax.rb
|
82
|
+
- lib/simplify/transactionreview.rb
|
81
83
|
- lib/simplify/webhook.rb
|
82
84
|
homepage: https://www.simplify.com/commerce
|
83
85
|
licenses:
|
@@ -99,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
101
|
version: '0'
|
100
102
|
requirements: []
|
101
103
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.4.5.1
|
103
105
|
signing_key:
|
104
106
|
specification_version: 4
|
105
107
|
summary: Simplify Commerce Ruby SDK
|