diff --git a/Paysafe.sln b/Paysafe.sln
new file mode 100644
index 0000000..4d4124f
--- /dev/null
+++ b/Paysafe.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Paysafe", "Paysafe\Paysafe.csproj", "{1AA4F97B-967A-4420-B3CC-EF1EFBAA72F8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaysafeTests", "tests\PaysafeTests.csproj", "{5FCF0A84-E497-46AC-9058-CC79E6FEB872}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "SampleApp\SampleApp.csproj", "{A98AFF11-EA57-4475-9A27-7DB43053BA3F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1AA4F97B-967A-4420-B3CC-EF1EFBAA72F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1AA4F97B-967A-4420-B3CC-EF1EFBAA72F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1AA4F97B-967A-4420-B3CC-EF1EFBAA72F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1AA4F97B-967A-4420-B3CC-EF1EFBAA72F8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5FCF0A84-E497-46AC-9058-CC79E6FEB872}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5FCF0A84-E497-46AC-9058-CC79E6FEB872}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5FCF0A84-E497-46AC-9058-CC79E6FEB872}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5FCF0A84-E497-46AC-9058-CC79E6FEB872}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A98AFF11-EA57-4475-9A27-7DB43053BA3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A98AFF11-EA57-4475-9A27-7DB43053BA3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A98AFF11-EA57-4475-9A27-7DB43053BA3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A98AFF11-EA57-4475-9A27-7DB43053BA3F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Paysafe/CardPayments/AccordD.cs b/Paysafe/CardPayments/AccordD.cs
new file mode 100644
index 0000000..4a68fa5
--- /dev/null
+++ b/Paysafe/CardPayments/AccordD.cs
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class AccordD : JSONObject
+ {
+ ///
+ /// Initialize the AccordD object with some set of properties
+ ///
+ /// Dictionary
+ public AccordD(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.financingType, CardPaymentsConstants.enumFinancingType},
+ {CardPaymentsConstants.plan, STRING_TYPE},
+ {CardPaymentsConstants.gracePeriod, INT_TYPE},
+ {CardPaymentsConstants.term, INT_TYPE}
+ };
+
+ ///
+ /// Get the financingType
+ ///
+ /// string
+ public string financingType()
+ {
+ return this.getProperty(CardPaymentsConstants.financingType);
+ }
+
+ ///
+ /// Set the financingType
+ ///
+ /// void
+ public void financingType(string data)
+ {
+ this.setProperty(CardPaymentsConstants.financingType, data);
+ }
+
+ ///
+ /// Get the plan
+ ///
+ /// string
+ public string plan()
+ {
+ return this.getProperty(CardPaymentsConstants.plan);
+ }
+
+ ///
+ /// Set the plan
+ ///
+ /// void
+ public void plan(string data)
+ {
+ this.setProperty(CardPaymentsConstants.plan, data);
+ }
+
+ ///
+ /// Get the gracePeriod
+ ///
+ /// int
+ public int gracePeriod()
+ {
+ return this.getProperty(CardPaymentsConstants.gracePeriod);
+ }
+
+ ///
+ /// Set the gracePeriod
+ ///
+ /// void
+ public void gracePeriod(int data)
+ {
+ this.setProperty(CardPaymentsConstants.gracePeriod, data);
+ }
+
+ ///
+ /// Get the term
+ ///
+ /// int
+ public int term()
+ {
+ return this.getProperty(CardPaymentsConstants.term);
+ }
+
+ ///
+ /// Set the term
+ ///
+ /// void
+ public void term(int data)
+ {
+ this.setProperty(CardPaymentsConstants.term, data);
+ }
+
+ ///
+ /// AccordDBuilder will allow a AccordD to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class AccordDBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the AccordD builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public AccordDBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the financingType
+ ///
+ /// string
+ /// AccordDBuilder
+ public AccordDBuilder financingType(string data)
+ {
+ this.properties[CardPaymentsConstants.financingType] = data;
+ return this;
+ }
+
+ ///
+ /// Set the plan
+ ///
+ /// string
+ /// AccordDBuilder
+ public AccordDBuilder plan(string data)
+ {
+ this.properties[CardPaymentsConstants.plan] = data;
+ return this;
+ }
+
+ ///
+ /// Set the gracePeriod
+ ///
+ /// int
+ /// AccordDBuilder
+ public AccordDBuilder gracePeriod(int data)
+ {
+ this.properties[CardPaymentsConstants.gracePeriod] = data;
+ return this;
+ }
+
+ ///
+ /// Set the term
+ ///
+ /// int
+ /// AccordDBuilder
+ public AccordDBuilder term(int data)
+ {
+ this.properties[CardPaymentsConstants.term] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/AcquireResponse.cs b/Paysafe/CardPayments/AcquireResponse.cs
new file mode 100644
index 0000000..7388a1d
--- /dev/null
+++ b/Paysafe/CardPayments/AcquireResponse.cs
@@ -0,0 +1,444 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+
+ public class AcquirerResponse : JSONObject
+ {
+ ///
+ /// Initialize the AcquirerResponse object with some set of properties
+ ///
+ /// Dictionary
+ public AcquirerResponse(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.code, STRING_TYPE},
+ {CardPaymentsConstants.responseCode, STRING_TYPE},
+ {CardPaymentsConstants.avsCode, STRING_TYPE},
+ {CardPaymentsConstants.balanceResponse, STRING_TYPE},
+ {CardPaymentsConstants.batchNumber, STRING_TYPE},
+ {CardPaymentsConstants.effectiveDate, STRING_TYPE},
+ {CardPaymentsConstants.financingType, STRING_TYPE},
+ {CardPaymentsConstants.gracePeriod, STRING_TYPE},
+ {CardPaymentsConstants.plan, STRING_TYPE},
+ {CardPaymentsConstants.seqNumber, STRING_TYPE},
+ {CardPaymentsConstants.term, STRING_TYPE},
+ {CardPaymentsConstants.terminalId, STRING_TYPE},
+ {CardPaymentsConstants.responseId, STRING_TYPE},
+ {CardPaymentsConstants.requestId, STRING_TYPE},
+ {CardPaymentsConstants.description, STRING_TYPE},
+ {CardPaymentsConstants.authCode, STRING_TYPE},
+ {CardPaymentsConstants.txnDateTime, STRING_TYPE},
+ {CardPaymentsConstants.referenceNbr, STRING_TYPE},
+ {CardPaymentsConstants.responseReasonCode, STRING_TYPE},
+ {CardPaymentsConstants.cvv2Result, STRING_TYPE},
+ {CardPaymentsConstants.mid, STRING_TYPE}
+ };
+
+ ///
+ /// Get the code
+ ///
+ /// string
+ public string code()
+ {
+ return this.getProperty(CardPaymentsConstants.code);
+ }
+
+ ///
+ /// Set the code
+ ///
+ /// void
+ public void code(string data)
+ {
+ this.setProperty(CardPaymentsConstants.code, data);
+ }
+
+ ///
+ /// Get the responseCode
+ ///
+ /// string
+ public string responseCode()
+ {
+ return this.getProperty(CardPaymentsConstants.responseCode);
+ }
+
+ ///
+ /// Set the responseCode
+ ///
+ /// void
+ public void responseCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.responseCode, data);
+ }
+
+ ///
+ /// Get the avsCode
+ ///
+ /// string
+ public string avsCode()
+ {
+ return this.getProperty(CardPaymentsConstants.avsCode);
+ }
+
+ ///
+ /// Set the avsCode
+ ///
+ /// void
+ public void avsCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.avsCode, data);
+ }
+
+ ///
+ /// Get the balanceResponse
+ ///
+ /// string
+ public string balanceResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.balanceResponse);
+ }
+
+ ///
+ /// Set the balanceResponse
+ ///
+ /// void
+ public void balanceResponse(string data)
+ {
+ this.setProperty(CardPaymentsConstants.balanceResponse, data);
+ }
+
+ ///
+ /// Get the batchNumber
+ ///
+ /// string
+ public string batchNumber()
+ {
+ return this.getProperty(CardPaymentsConstants.batchNumber);
+ }
+
+ ///
+ /// Set the batchNumber
+ ///
+ /// void
+ public void batchNumber(string data)
+ {
+ this.setProperty(CardPaymentsConstants.batchNumber, data);
+ }
+
+ ///
+ /// Get the effectiveDate
+ ///
+ /// string
+ public string effectiveDate()
+ {
+ return this.getProperty(CardPaymentsConstants.effectiveDate);
+ }
+
+ ///
+ /// Set the effectiveDate
+ ///
+ /// void
+ public void effectiveDate(string data)
+ {
+ this.setProperty(CardPaymentsConstants.effectiveDate, data);
+ }
+
+ ///
+ /// Get the financingType
+ ///
+ /// string
+ public string financingType()
+ {
+ return this.getProperty(CardPaymentsConstants.financingType);
+ }
+
+ ///
+ /// Set the financingType
+ ///
+ /// void
+ public void financingType(string data)
+ {
+ this.setProperty(CardPaymentsConstants.financingType, data);
+ }
+
+ ///
+ /// Get the gracePeriod
+ ///
+ /// int
+ public int gracePeriod()
+ {
+ return this.getProperty(CardPaymentsConstants.gracePeriod);
+ }
+
+ ///
+ /// Set the gracePeriod
+ ///
+ /// void
+ public void gracePeriod(int data)
+ {
+ this.setProperty(CardPaymentsConstants.gracePeriod, data);
+ }
+
+ ///
+ /// Get the plan
+ ///
+ /// string
+ public string plan()
+ {
+ return this.getProperty(CardPaymentsConstants.plan);
+ }
+
+ ///
+ /// Set the plan
+ ///
+ /// void
+ public void plan(string data)
+ {
+ this.setProperty(CardPaymentsConstants.plan, data);
+ }
+
+ ///
+ /// Get the seqNumber
+ ///
+ /// string
+ public string seqNumber()
+ {
+ return this.getProperty(CardPaymentsConstants.seqNumber);
+ }
+
+ ///
+ /// Set the seqNumber
+ ///
+ /// void
+ public void seqNumber(string data)
+ {
+ this.setProperty(CardPaymentsConstants.seqNumber, data);
+ }
+
+ ///
+ /// Get the term
+ ///
+ /// string
+ public string term()
+ {
+ return this.getProperty(CardPaymentsConstants.term);
+ }
+
+ ///
+ /// Set the term
+ ///
+ /// void
+ public void term(int data)
+ {
+ this.setProperty(CardPaymentsConstants.term, data);
+ }
+
+ ///
+ /// Get the terminalId
+ ///
+ /// string
+ public string terminalId()
+ {
+ return this.getProperty(CardPaymentsConstants.terminalId);
+ }
+
+ ///
+ /// Set the terminalId
+ ///
+ /// void
+ public void terminalId(int data)
+ {
+ this.setProperty(CardPaymentsConstants.terminalId, data);
+ }
+
+ ///
+ /// Get the requestId
+ ///
+ /// string
+ public string requestId()
+ {
+ return this.getProperty(CardPaymentsConstants.requestId);
+ }
+
+ ///
+ /// Set the requestId
+ ///
+ /// void
+ public void requestId(int data)
+ {
+ this.setProperty(CardPaymentsConstants.requestId, data);
+ }
+
+ ///
+ /// Get the responseId
+ ///
+ /// string
+ public string responseId()
+ {
+ return this.getProperty(CardPaymentsConstants.responseId);
+ }
+
+ ///
+ /// Set the responseId
+ ///
+ /// void
+ public void responseId(int data)
+ {
+ this.setProperty(CardPaymentsConstants.terminalId, data);
+ }
+
+ ///
+ /// Get the description
+ ///
+ /// string
+ public string description()
+ {
+ return this.getProperty(CardPaymentsConstants.description);
+ }
+
+ ///
+ /// Set the description
+ ///
+ /// void
+ public void description(string data)
+ {
+ this.setProperty(CardPaymentsConstants.description, data);
+ }
+
+ ///
+ /// Get the authCode
+ ///
+ /// string
+ public string authCode()
+ {
+ return this.getProperty(CardPaymentsConstants.authCode);
+ }
+
+ ///
+ /// Set the authCode
+ ///
+ /// void
+ public void authCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authCode, data);
+ }
+
+ ///
+ /// Get the txnDateTime
+ ///
+ /// string
+ public string txnDateTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnDateTime);
+ }
+
+ ///
+ /// Set the txnDateTime
+ ///
+ /// void
+ public void txnDateTime(string data)
+ {
+ this.setProperty(CardPaymentsConstants.txnDateTime, data);
+ }
+
+ ///
+ /// Get the referenceNbr
+ ///
+ /// string
+ public string referenceNbr()
+ {
+ return this.getProperty(CardPaymentsConstants.referenceNbr);
+ }
+
+ ///
+ /// Set the referenceNbr
+ ///
+ /// void
+ public void referenceNbr(string data)
+ {
+ this.setProperty(CardPaymentsConstants.referenceNbr, data);
+ }
+
+ ///
+ /// Get the responseReasonCode
+ ///
+ /// string
+ public string responseReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.responseReasonCode);
+ }
+
+ ///
+ /// Set the responseReasonCode
+ ///
+ /// void
+ public void responseReasonCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.responseReasonCode, data);
+ }
+
+ ///
+ /// Get the cvv2Result
+ ///
+ /// string
+ public string cvv2Result()
+ {
+ return this.getProperty(CardPaymentsConstants.cvv2Result);
+ }
+
+ ///
+ /// Set the cvv2Result
+ ///
+ /// void
+ public void cvv2Result(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cvv2Result, data);
+ }
+
+ ///
+ /// Get the mid
+ ///
+ /// string
+ public string mid()
+ {
+ return this.getProperty(CardPaymentsConstants.mid);
+ }
+
+ ///
+ /// Set the mid
+ ///
+ /// void
+ public void mid(string data)
+ {
+ this.setProperty(CardPaymentsConstants.mid, data);
+ }
+
+ }
+}
diff --git a/Paysafe/CardPayments/Authorization.cs b/Paysafe/CardPayments/Authorization.cs
new file mode 100644
index 0000000..c42466e
--- /dev/null
+++ b/Paysafe/CardPayments/Authorization.cs
@@ -0,0 +1,840 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Authorization : JSONObject
+ {
+
+ ///
+ /// Gets the array key to access the array of authorizations
+ ///
+ /// The key to be checked in the returning JSON
+ public static string getPageableArrayKey()
+ {
+ return "auths";
+ }
+
+ ///
+ /// Initialize the Authorization object with some set of properties
+ ///
+ /// Dictionary
+ public Authorization(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// Initialize an authorization object with an id
+ ///
+ ///
+ public Authorization(String id)
+ : base(fieldTypes)
+ {
+ this.id(id);
+ }
+
+ ///
+ /// This object is used to validate any properties set within the object
+ ///
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.id, STRING_TYPE},
+ {CardPaymentsConstants.merchantRefNum, STRING_TYPE},
+ {CardPaymentsConstants.amount, INT_TYPE},
+ {CardPaymentsConstants.settleWithAuth, BOOL_TYPE},
+ {CardPaymentsConstants.availableToSettle, INT_TYPE},
+ {CardPaymentsConstants.childAccountNum, STRING_TYPE},
+ {CardPaymentsConstants.card, typeof(Card)},
+ {CardPaymentsConstants.authentication, typeof(PaysafeAuthentication)},
+ {CardPaymentsConstants.authCode, STRING_TYPE},
+ {CardPaymentsConstants.profile, typeof(Profile)},
+ {CardPaymentsConstants.billingDetails, typeof(BillingDetails)},
+ {CardPaymentsConstants.shippingDetails, typeof(ShippingDetails)},
+ {CardPaymentsConstants.recurring, CardPaymentsConstants.enumRecurring},
+ {CardPaymentsConstants.customerIp, STRING_TYPE},
+ {CardPaymentsConstants.dupCheck, BOOL_TYPE},
+ {CardPaymentsConstants.keywords, typeof(List)},
+ {CardPaymentsConstants.merchantDescriptor, typeof(MerchantDescriptor)},
+ {CardPaymentsConstants.accordD, typeof(AccordD)},
+ {CardPaymentsConstants.description, STRING_TYPE},
+ {CardPaymentsConstants.masterPass, typeof(MasterPass)},
+ {CardPaymentsConstants.txnTime, typeof(System.DateTime)},
+ {CardPaymentsConstants.currencyCode, STRING_TYPE},
+ {CardPaymentsConstants.avsResponse, CardPaymentsConstants.enumAVSResponse},
+ {CardPaymentsConstants.cvvVerification, CardPaymentsConstants.enumCVVVerification},
+ {CardPaymentsConstants.status, CardPaymentsConstants.enumStatus},
+ {CardPaymentsConstants.riskReasonCode, typeof(List)},
+ {CardPaymentsConstants.acquirerResponse, typeof(AcquirerResponse)},
+ {CardPaymentsConstants.visaAdditionalAuthData, typeof(VisaAdditionalAuthData)},
+ {CardPaymentsConstants.settlements, typeof(List)},
+ {CardPaymentsConstants.error, typeof(OptError)},
+ {CardPaymentsConstants.links, typeof(List)}
+ };
+
+ ///
+ /// Get the id
+ ///
+ /// string
+ public string id()
+ {
+ return this.getProperty(CardPaymentsConstants.id);
+ }
+
+ ///
+ /// Set the id
+ ///
+ /// void
+ public void id(string data)
+ {
+ this.setProperty(CardPaymentsConstants.id, data);
+ }
+
+ ///
+ /// Get the merchantRefNum
+ ///
+ /// string
+ public string merchantRefNum()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantRefNum);
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// void
+ public void merchantRefNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantRefNum, data);
+ }
+
+ ///
+ /// Get the amount
+ ///
+ /// int
+ public int amount()
+ {
+ return this.getProperty(CardPaymentsConstants.amount);
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// void
+ public void amount(int data)
+ {
+ this.setProperty(CardPaymentsConstants.amount, data);
+ }
+
+ ///
+ /// Get the settleWithAuth
+ ///
+ /// bool
+ public bool settleWithAuth()
+ {
+ return this.getProperty(CardPaymentsConstants.settleWithAuth);
+ }
+
+ ///
+ /// Set the settleWithAuth
+ ///
+ /// void
+ public void settleWithAuth(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.settleWithAuth, data);
+ }
+
+ ///
+ /// Get the availableToSettle
+ ///
+ /// int
+ public int availableToSettle()
+ {
+ return this.getProperty(CardPaymentsConstants.availableToSettle);
+ }
+
+ ///
+ /// Set the availableToSettle
+ ///
+ /// void
+ public void availableToSettle(int data)
+ {
+ this.setProperty(CardPaymentsConstants.availableToSettle, data);
+ }
+
+ ///
+ /// Get the childAccountNum
+ ///
+ /// string
+ public string childAccountNum()
+ {
+ return this.getProperty(CardPaymentsConstants.childAccountNum);
+ }
+
+ ///
+ /// Set the childAccountNum
+ ///
+ /// void
+ public void childAccountNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.childAccountNum, data);
+ }
+
+ ///
+ /// Get the card
+ ///
+ /// Card
+ public Card card()
+ {
+ return this.getProperty(CardPaymentsConstants.card);
+ }
+
+ ///
+ /// Set the card
+ ///
+ /// void
+ public void card(Card data)
+ {
+ this.setProperty(CardPaymentsConstants.card, data);
+ }
+
+ ///
+ /// Get the authentication
+ ///
+ /// Authentication
+ public PaysafeAuthentication authentication()
+ {
+ return this.getProperty(CardPaymentsConstants.authentication);
+ }
+
+ ///
+ /// Set the authentication
+ ///
+ /// void
+ public void authentication(PaysafeAuthentication data)
+ {
+ this.setProperty(CardPaymentsConstants.authentication, data);
+ }
+
+ ///
+ /// Get the authCode
+ ///
+ /// string
+ public string authCode()
+ {
+ return this.getProperty(CardPaymentsConstants.authCode);
+ }
+
+ ///
+ /// Set the authCode
+ ///
+ /// void
+ public void authCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authCode, data);
+ }
+
+ ///
+ /// Get the profile
+ ///
+ /// Profile
+ public Profile profile()
+ {
+ return this.getProperty(CardPaymentsConstants.profile);
+
+ }
+
+ ///
+ /// Set the profile
+ ///
+ /// void
+ public void profile(Profile data)
+ {
+ this.setProperty(CardPaymentsConstants.profile, data);
+ }
+
+ ///
+ /// Get the billing details
+ ///
+ /// BillingDetails
+ public BillingDetails billingDetails()
+ {
+ return this.getProperty(CardPaymentsConstants.billingDetails);
+ }
+
+ ///
+ /// Set the billingDetails
+ ///
+ /// void
+ public void billingDetails(BillingDetails data)
+ {
+ this.setProperty(CardPaymentsConstants.billingDetails, data);
+ }
+
+ ///
+ /// Get the shipping details
+ ///
+ /// ShippingDetails
+ public ShippingDetails shippingDetails()
+ {
+ return this.getProperty(CardPaymentsConstants.shippingDetails);
+ }
+
+ ///
+ /// Set the shippingDetails
+ ///
+ /// void
+ public void shippingDetails(ShippingDetails data)
+ {
+ this.setProperty(CardPaymentsConstants.shippingDetails, data);
+ }
+
+ ///
+ /// Get the recurring
+ ///
+ /// string
+ public string recurring()
+ {
+ return this.getProperty(CardPaymentsConstants.recurring);
+ }
+
+ ///
+ /// Set the recurring
+ ///
+ /// void
+ public void recurring(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recurring, data);
+ }
+
+ ///
+ /// Get the customerIp
+ ///
+ /// string
+ public string customerIp()
+ {
+ return this.getProperty(CardPaymentsConstants.customerIp);
+ }
+
+ ///
+ /// Set the customerIp
+ ///
+ /// void
+ public void customerIp(string data)
+ {
+ this.setProperty(CardPaymentsConstants.customerIp, data);
+ }
+
+ ///
+ /// Get the dupCheck
+ ///
+ /// bool
+ public bool dupCheck()
+ {
+ return this.getProperty(CardPaymentsConstants.dupCheck);
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// void
+ public void dupCheck(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.dupCheck, data);
+ }
+
+ ///
+ /// Get the keywords
+ ///
+ /// List
+ public List keywords()
+ {
+ return this.getProperty(CardPaymentsConstants.keywords);
+ }
+
+ ///
+ /// Set the keywords
+ ///
+ /// void
+ public void keywords(List data)
+ {
+ this.setProperty(CardPaymentsConstants.keywords, data);
+ }
+
+ ///
+ /// Get the merchantDescriptor
+ ///
+ /// MerchantDescriptor
+ public MerchantDescriptor merchantDescriptor()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantDescriptor);
+ }
+
+ ///
+ /// Set the merchantDescriptor
+ ///
+ /// void
+ public void merchantDescriptor(MerchantDescriptor data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantDescriptor, data);
+ }
+
+ ///
+ /// Get the accordD
+ ///
+ /// AccordD
+ public AccordD accordD()
+ {
+ return this.getProperty(CardPaymentsConstants.accordD);
+ }
+
+ ///
+ /// Set the accordD
+ ///
+ /// void
+ public void accordD(AccordD data)
+ {
+ this.setProperty(CardPaymentsConstants.accordD, data);
+ }
+
+ ///
+ /// Get the description
+ ///
+ /// string
+ public string description()
+ {
+ return this.getProperty(CardPaymentsConstants.description);
+ }
+
+ ///
+ /// Set the description
+ ///
+ /// void
+ public void description(string data)
+ {
+ this.setProperty(CardPaymentsConstants.description, data);
+ }
+
+ ///
+ /// Get the masterPass
+ ///
+ /// MasterPass
+ public MasterPass masterPass()
+ {
+ return this.getProperty(CardPaymentsConstants.masterPass);
+ }
+
+ ///
+ /// Set the masterPass
+ ///
+ /// void
+ public void masterPass(MasterPass data)
+ {
+ this.setProperty(CardPaymentsConstants.masterPass, data);
+ }
+
+ ///
+ /// Get the txnTime
+ ///
+ /// System.DateTime
+ public System.DateTime txnTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnTime);
+ }
+
+ ///
+ /// Set the txnTime
+ ///
+ /// void
+ public void txnTime(System.DateTime data)
+ {
+ this.setProperty(CardPaymentsConstants.txnTime, data);
+ }
+
+ ///
+ /// Get the currencyCode
+ ///
+ /// string
+ public string currencyCode()
+ {
+ return this.getProperty(CardPaymentsConstants.currencyCode);
+ }
+
+ ///
+ /// Set the currencyCode
+ ///
+ /// void
+ public void currencyCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.currencyCode, data);
+ }
+
+ ///
+ /// Get the avsResponse
+ ///
+ /// string
+ public string avsResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.avsResponse);
+ }
+
+ ///
+ /// Set the avsResponse
+ ///
+ /// void
+ public void avsResponse(string data)
+ {
+ this.setProperty(CardPaymentsConstants.avsResponse, data);
+ }
+
+ ///
+ /// Get the cvvVerification
+ ///
+ /// string
+ public string cvvVerification()
+ {
+ return this.getProperty(CardPaymentsConstants.cvvVerification);
+ }
+
+ ///
+ /// Set the cvvVerification
+ ///
+ /// void
+ public void cvvVerification(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cvvVerification, data);
+ }
+
+ ///
+ /// Get the status
+ ///
+ /// string
+ public string status()
+ {
+ return this.getProperty(CardPaymentsConstants.status);
+ }
+
+ ///
+ /// Set the status
+ ///
+ /// void
+ public void status(string data)
+ {
+ this.setProperty(CardPaymentsConstants.status, data);
+ }
+
+ ///
+ /// Get the riskReasonCode
+ ///
+ /// List
+ public List riskReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.riskReasonCode);
+ }
+
+ ///
+ /// Set the riskReasonCode
+ ///
+ /// void
+ public void riskReasonCode(List data)
+ {
+ this.setProperty(CardPaymentsConstants.riskReasonCode, data);
+ }
+
+ ///
+ /// Get the acquireResponse
+ ///
+ /// AcquirerResponse
+ public AcquirerResponse acquireResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.acquirerResponse);
+ }
+
+ ///
+ /// Set the acquireResponse
+ ///
+ /// void
+ public void acquireResponse(AcquirerResponse data)
+ {
+ this.setProperty(CardPaymentsConstants.acquirerResponse, data);
+ }
+
+ ///
+ /// Get the visaAdditionalAuthData
+ ///
+ /// VisaAdditionalAuthData
+ public VisaAdditionalAuthData visaAdditionalAuthData()
+ {
+ return this.getProperty(CardPaymentsConstants.visaAdditionalAuthData);
+ }
+
+ ///
+ /// Set the visaAdditionalAuthData
+ ///
+ /// void
+ public void visaAdditionalAuthData(VisaAdditionalAuthData data)
+ {
+ this.setProperty(CardPaymentsConstants.visaAdditionalAuthData, data);
+ }
+
+ ///
+ /// Get the settlements
+ ///
+ /// List
+ public List settlements()
+ {
+ return this.getProperty(CardPaymentsConstants.settlements);
+ }
+
+ ///
+ /// Set the settlements
+ ///
+ /// void
+ public void settlements(List data)
+ {
+ this.setProperty(CardPaymentsConstants.settlements, data);
+ }
+
+ ///
+ /// Get the error
+ ///
+ /// Error
+ public OptError error()
+ {
+ return this.getProperty(CardPaymentsConstants.error);
+ }
+
+ ///
+ /// Set the error
+ ///
+ /// void
+ public void error(OptError data)
+ {
+ this.setProperty(CardPaymentsConstants.error, data);
+ }
+
+ ///
+ /// Get the links
+ ///
+ /// List
+ public List links()
+ {
+ return this.getProperty(CardPaymentsConstants.links);
+ }
+
+ ///
+ /// Set the links
+ ///
+ /// void
+ public void links(List data)
+ {
+ this.setProperty(CardPaymentsConstants.links, data);
+ }
+
+ ///
+ /// Get a new AuthorizationBuilder
+ ///
+ /// AuthorizationBuilder
+ public static AuthorizationBuilder Builder()
+ {
+ return new AuthorizationBuilder();
+ }
+
+ ///
+ /// AuthorizationBuilder will allow an authorization to be initialized.
+ /// set all properties and subpropeties, then trigger .Build() to
+ /// get the generated Authorization object
+ ///
+ public class AuthorizationBuilder : BaseJSONBuilder
+ {
+ ///
+ /// Set the id
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder id(string data)
+ {
+ this.properties[CardPaymentsConstants.id] = data;
+ return this;
+ }
+
+ ///
+ /// Set the merchantRefNum parameter
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder merchantRefNum(string data)
+ {
+ this.properties[CardPaymentsConstants.merchantRefNum] = data;
+ return this;
+ }
+
+ ///
+ /// Set the amount parameter
+ ///
+ /// int
+ /// AuthorizationBuilder
+ public AuthorizationBuilder amount(int data)
+ {
+ this.properties[CardPaymentsConstants.amount] = data;
+ return this;
+ }
+
+ ///
+ /// Build a card within this authorization.
+ ///
+ /// Card.CardBuilder
+ public Card.CardBuilder card()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.card))
+ {
+ this.properties[CardPaymentsConstants.card] = new Card.CardBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.card] as Card.CardBuilder;
+ }
+
+ ///
+ /// Set the settleWithAuth property
+ ///
+ /// bool
+ /// AuthorizationBuilder
+ public AuthorizationBuilder settleWithAuth(bool data)
+ {
+ this.properties[CardPaymentsConstants.settleWithAuth] = data;
+ return this;
+ }
+
+ ///
+ /// Set the customerIp parameter
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder customerIp(string data)
+ {
+ this.properties[CardPaymentsConstants.customerIp] = data;
+ return this;
+ }
+
+ ///
+ /// Set the dupCheck parameter
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder dupCheck(bool data)
+ {
+ this.properties[CardPaymentsConstants.dupCheck] = data;
+ return this;
+ }
+
+ ///
+ /// Set the description
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder description(string data)
+ {
+ this.properties[CardPaymentsConstants.description] = data;
+ return this;
+ }
+
+ ///
+ /// Build a authentication within this authorization.
+ ///
+ /// PaysafeAuthentication.AuthenticationBuilder
+ public PaysafeAuthentication.AuthenticationBuilder authentication()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.authentication))
+ {
+ this.properties[CardPaymentsConstants.authentication] = new PaysafeAuthentication.AuthenticationBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.authentication] as PaysafeAuthentication.AuthenticationBuilder;
+ }
+
+ ///
+ /// Build a billing details object within this authorization.
+ ///
+ /// BillingDetails.BillingDetailsBuilder
+ public BillingDetails.BillingDetailsBuilder billingDetails()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.billingDetails))
+ {
+ this.properties[CardPaymentsConstants.billingDetails] = new BillingDetails.BillingDetailsBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.billingDetails] as BillingDetails.BillingDetailsBuilder;
+ }
+
+ ///
+ /// Build a shipping details object within this authorization.
+ ///
+ /// ShippingDetails.ShippingDetailsBuilder
+ public ShippingDetails.ShippingDetailsBuilder shippingDetails()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.shippingDetails))
+ {
+ this.properties[CardPaymentsConstants.shippingDetails] = new ShippingDetails.ShippingDetailsBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.shippingDetails] as ShippingDetails.ShippingDetailsBuilder;
+ }
+
+ ///
+ /// Set the recurring parameter
+ ///
+ /// string
+ /// AuthorizationBuilder
+ public AuthorizationBuilder recurring(string data)
+ {
+ this.properties[CardPaymentsConstants.recurring] = data;
+ return this;
+
+ }
+
+ ///
+ /// Build a merchant descriptor object within this authorization.
+ ///
+ /// MerchantDescriptor.MerchantDescriptorBuilder
+ public MerchantDescriptor.MerchantDescriptorBuilder merchantDescriptor()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.merchantDescriptor))
+ {
+ this.properties[CardPaymentsConstants.merchantDescriptor] = new MerchantDescriptor.MerchantDescriptorBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.merchantDescriptor] as MerchantDescriptor.MerchantDescriptorBuilder;
+ }
+
+ ///
+ /// Build an accordD object within this authorization.
+ ///
+ /// AccordD.AccordDBuilder
+ public AccordD.AccordDBuilder accordD()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.accordD))
+ {
+ this.properties[CardPaymentsConstants.accordD] = new AccordD.AccordDBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.accordD] as AccordD.AccordDBuilder;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/AuthorizationReversal.cs b/Paysafe/CardPayments/AuthorizationReversal.cs
new file mode 100644
index 0000000..3510a0c
--- /dev/null
+++ b/Paysafe/CardPayments/AuthorizationReversal.cs
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class AuthorizationReversal : JSONObject
+ {
+ ///
+ /// Initialize the Profile object with some set of properties
+ ///
+ /// Dictionary
+ public AuthorizationReversal(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// Initialize an authorization reversal object with an id
+ ///
+ ///
+ public AuthorizationReversal(String id)
+ : base(fieldTypes)
+ {
+ this.id(id);
+ }
+
+ ///
+ /// Gets the array key to access the array of authorization reversals
+ ///
+ /// The key to be checked in the returning JSON
+ public static string getPageableArrayKey()
+ {
+ return "voidAuths";
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.id, STRING_TYPE},
+ {CardPaymentsConstants.merchantRefNum, STRING_TYPE},
+ {CardPaymentsConstants.amount, INT_TYPE},
+ {CardPaymentsConstants.childAccountNum, STRING_TYPE},
+ {CardPaymentsConstants.dupCheck, BOOL_TYPE},
+ {CardPaymentsConstants.txnTime, typeof(System.DateTime)},
+ {CardPaymentsConstants.status, CardPaymentsConstants.enumStatus},
+ {CardPaymentsConstants.riskReasonCode, typeof(List)},
+ {CardPaymentsConstants.acquirerResponse, typeof(AcquirerResponse)},
+ {CardPaymentsConstants.error, typeof(OptError)},
+ {CardPaymentsConstants.links, typeof(List)},
+ {CardPaymentsConstants.authorizationId, STRING_TYPE}
+ };
+
+
+ ///
+ /// Get the id
+ ///
+ /// string
+ public string id()
+ {
+ return this.getProperty(CardPaymentsConstants.id);
+ }
+
+ ///
+ /// Set the id
+ ///
+ /// void
+ public void id(string data)
+ {
+ this.setProperty(CardPaymentsConstants.id, data);
+ }
+
+ ///
+ /// Get the merchantRefNum
+ ///
+ /// string
+ public string merchantRefNum()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantRefNum);
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// void
+ public void merchantRefNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantRefNum, data);
+ }
+ ///
+ /// Get the amount
+ ///
+ /// int
+ public int amount()
+ {
+ return this.getProperty(CardPaymentsConstants.amount);
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// void
+ public void amount(int data)
+ {
+ this.setProperty(CardPaymentsConstants.amount, data);
+ }
+
+ ///
+ /// Get the childAccountNum
+ ///
+ /// string
+ public string childAccountNum()
+ {
+ return this.getProperty(CardPaymentsConstants.childAccountNum);
+ }
+
+ ///
+ /// Set the childAccountNum
+ ///
+ /// void
+ public void childAccountNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.childAccountNum, data);
+ }
+
+ ///
+ /// Get the dupCheck
+ ///
+ /// bool
+ public int dupCheck()
+ {
+ return this.getProperty(CardPaymentsConstants.dupCheck);
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// void
+ public void dupCheck(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.dupCheck, data);
+ }
+
+ ///
+ /// Get the txnTime
+ ///
+ /// System.DateTime
+ public System.DateTime txnTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnTime);
+ }
+
+ ///
+ /// Set the txnTime
+ ///
+ /// void
+ public void txnTime(System.DateTime data)
+ {
+ this.setProperty(CardPaymentsConstants.txnTime, data);
+ }
+
+ ///
+ /// Get the status
+ ///
+ /// string
+ public string status()
+ {
+ return this.getProperty(CardPaymentsConstants.status);
+ }
+
+ ///
+ /// Set the status
+ ///
+ /// void
+ public void status(string data)
+ {
+ this.setProperty(CardPaymentsConstants.status, data);
+ }
+
+ ///
+ /// Get the riskReasonCode
+ ///
+ /// List
+ public List riskReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.riskReasonCode);
+ }
+
+ ///
+ /// Set the riskReasonCode
+ ///
+ /// void
+ public void riskReasonCode(List data)
+ {
+ this.setProperty(CardPaymentsConstants.riskReasonCode, data);
+ }
+
+ ///
+ /// Get the acquireResponse
+ ///
+ /// AcquirerResponse
+ public AcquirerResponse acquireResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.acquirerResponse);
+ }
+
+ ///
+ /// Set the acquireResponse
+ ///
+ /// void
+ public void acquireResponse(AcquirerResponse data)
+ {
+ this.setProperty(CardPaymentsConstants.acquirerResponse, data);
+ }
+
+ ///
+ /// Get the error
+ ///
+ /// Error
+ public OptError error()
+ {
+ return this.getProperty(CardPaymentsConstants.error);
+ }
+
+ ///
+ /// Set the error
+ ///
+ /// void
+ public void error(OptError data)
+ {
+ this.setProperty(CardPaymentsConstants.error, data);
+ }
+
+ ///
+ /// Get the links
+ ///
+ /// List
+ public List links()
+ {
+ return this.getProperty(CardPaymentsConstants.links);
+ }
+
+ ///
+ /// Set the links
+ ///
+ /// void
+ public void links(List data)
+ {
+ this.setProperty(CardPaymentsConstants.links, data);
+ }
+
+ ///
+ /// Get the authorizationId
+ ///
+ /// string
+ public string authorizationId()
+ {
+ return this.getProperty(CardPaymentsConstants.authorizationId);
+ }
+
+ ///
+ /// Set the authorizationId
+ ///
+ /// void
+ public void authorizationId(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authorizationId, data);
+ }
+
+ ///
+ /// Get a new AuthorizationBuilder
+ ///
+ /// AuthorizationReversalBuilder
+ public static AuthorizationReversalBuilder Builder()
+ {
+ return new AuthorizationReversalBuilder();
+ }
+
+ ///
+ /// AuthorizationReversalBuilder will allow an AuthorizationReversal to be initialized.
+ /// set all properties and subpropeties, then trigger .Build() to
+ /// get the generated Authorization object
+ ///
+ public class AuthorizationReversalBuilder : BaseJSONBuilder
+ {
+ ///
+ /// Set the id
+ ///
+ /// string
+ /// AuthorizationReversalBuilder
+ public AuthorizationReversalBuilder id(string data)
+ {
+ this.properties[CardPaymentsConstants.id] = data;
+ return this;
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// string
+ /// AuthorizationReversalBuilder
+ public AuthorizationReversalBuilder merchantRefNum(string data)
+ {
+ this.properties[CardPaymentsConstants.merchantRefNum] = data;
+ return this;
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// int
+ /// AuthorizationReversalBuilder
+ public AuthorizationReversalBuilder amount(int data)
+ {
+ this.properties[CardPaymentsConstants.amount] = data;
+ return this;
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// bool
+ /// AuthorizationReversalBuilder
+ public AuthorizationReversalBuilder dupCheck(bool data)
+ {
+ this.properties[CardPaymentsConstants.dupCheck] = data;
+ return this;
+ }
+
+ ///
+ /// Set the authorizationId
+ ///
+ /// string
+ /// AuthorizationReversalBuilder
+ public AuthorizationReversalBuilder authorizationId(string data)
+ {
+ this.properties[CardPaymentsConstants.authorizationId] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/BillingDetails.cs b/Paysafe/CardPayments/BillingDetails.cs
new file mode 100644
index 0000000..193bb0e
--- /dev/null
+++ b/Paysafe/CardPayments/BillingDetails.cs
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class BillingDetails : AddressDetails
+ {
+
+ private static new Dictionary fieldTypes = new Dictionary(addressFieldTypes);
+
+ public BillingDetails(Dictionary properties)
+ : base(fieldTypes, properties)
+ {
+ }
+
+
+ ///
+ /// BillingDetailsBuilder will allow a BillingDetails to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class BillingDetailsBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the BillingDetails builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public BillingDetailsBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the street
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder street(string data)
+ {
+ this.properties[CardPaymentsConstants.street] = data;
+ return this;
+ }
+
+ ///
+ /// Set the street2
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder street2(string data)
+ {
+ this.properties[CardPaymentsConstants.street2] = data;
+ return this;
+ }
+
+ ///
+ /// Set the city
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder city(string data)
+ {
+ this.properties[CardPaymentsConstants.city] = data;
+ return this;
+ }
+
+ ///
+ /// Set the state
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder state(string data)
+ {
+ this.properties[CardPaymentsConstants.state] = data;
+ return this;
+ }
+
+ ///
+ /// Set the country
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder country(string data)
+ {
+ this.properties[CardPaymentsConstants.country] = data;
+ return this;
+ }
+
+ ///
+ /// Set the zip
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder zip(string data)
+ {
+ this.properties[CardPaymentsConstants.zip] = data;
+ return this;
+ }
+
+ ///
+ /// Set the phone
+ ///
+ /// string
+ /// BillingDetailsBuilder
+ public BillingDetailsBuilder phone(string data)
+ {
+ this.properties[CardPaymentsConstants.phone] = data;
+ return this;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Paysafe/CardPayments/Card.cs b/Paysafe/CardPayments/Card.cs
new file mode 100644
index 0000000..871ee0a
--- /dev/null
+++ b/Paysafe/CardPayments/Card.cs
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Card : JSONObject
+ {
+
+ ///
+ /// Initialize the Card object with some set of properties
+ ///
+ /// Dictionary
+ public Card(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// This object is used to validate any properties set within the object
+ ///
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.paymentToken, STRING_TYPE},
+ {CardPaymentsConstants.cardNum, STRING_TYPE},
+ {CardPaymentsConstants.type, STRING_TYPE},
+ {CardPaymentsConstants.lastDigits, STRING_TYPE},
+ {CardPaymentsConstants.cardExpiry, typeof(CardExpiry)},
+ {CardPaymentsConstants.cvv, STRING_TYPE},
+ {CardPaymentsConstants.track1, STRING_TYPE},
+ {CardPaymentsConstants.track2, STRING_TYPE},
+ };
+
+ ///
+ /// Get the payment token
+ ///
+ /// string
+ public string paymentToken()
+ {
+ return this.getProperty(CardPaymentsConstants.paymentToken);
+ }
+
+ ///
+ /// Set the payment token
+ ///
+ /// string
+ public void paymentToken(string data)
+ {
+ this.setProperty(CardPaymentsConstants.paymentToken, data);
+ }
+
+ ///
+ /// Get the card number
+ ///
+ /// string
+ public string cardNum()
+ {
+ return this.getProperty(CardPaymentsConstants.cardNum);
+ }
+
+ ///
+ /// Set the card number
+ ///
+ /// string
+ public void cardNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cardNum, data);
+ }
+
+ ///
+ /// Get the card's type
+ ///
+ /// string
+ public string type()
+ {
+ return this.getProperty(CardPaymentsConstants.type);
+ }
+
+ ///
+ /// Set the card's type
+ ///
+ /// string
+ public void type(string data)
+ {
+ this.setProperty(CardPaymentsConstants.type, data);
+ }
+
+ ///
+ /// Get the card's last digits
+ ///
+ /// string
+ public string lastDigits()
+ {
+ return this.getProperty(CardPaymentsConstants.lastDigits);
+ }
+
+ ///
+ /// Set the card's last digits
+ ///
+ /// string
+ public void lastDigits(string data)
+ {
+ this.setProperty(CardPaymentsConstants.lastDigits, data);
+ }
+
+ ///
+ /// Get the card expiry
+ ///
+ /// CardExpiry
+ public CardExpiry cardExpiry()
+ {
+ return this.getProperty(CardPaymentsConstants.cardExpiry);
+ }
+
+ ///
+ /// Set the card expiry
+ ///
+ /// CardExpiry
+ public void cardExpiry(CardExpiry data)
+ {
+ this.setProperty(CardPaymentsConstants.cardExpiry, data);
+ }
+
+ ///
+ /// Get the card cvv
+ ///
+ /// string
+ public string cvv()
+ {
+ return this.getProperty(CardPaymentsConstants.cvv);
+ }
+
+ ///
+ /// Set the card cvv
+ ///
+ /// string
+ public void cvv(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cvv, data);
+ }
+
+ ///
+ /// Get the track1 data
+ ///
+ /// string
+ public string track1()
+ {
+ return this.getProperty(CardPaymentsConstants.track1);
+ }
+
+ ///
+ /// Set the track1 data
+ ///
+ /// string
+ public void track1(string data)
+ {
+ this.setProperty(CardPaymentsConstants.track1, data);
+ }
+
+ ///
+ /// Get the track2 data
+ ///
+ /// string
+ public string track2()
+ {
+ return this.getProperty(CardPaymentsConstants.track1);
+ }
+
+ ///
+ /// Set the track2 data
+ ///
+ /// string
+ public void track2(string data)
+ {
+ this.setProperty(CardPaymentsConstants.track2, data);
+ }
+
+ ///
+ /// CardBuilder will allow an card to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back tot he parent builder
+ ///
+ public class CardBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the Card builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public CardBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the payment token
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder paymentToken(string data)
+ {
+ this.properties[CardPaymentsConstants.paymentToken] = data;
+ return this;
+ }
+
+ ///
+ /// Set the card number
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder cardNum(string data)
+ {
+ this.properties[CardPaymentsConstants.cardNum] = data;
+ return this;
+ }
+
+ ///
+ /// Set the card's type
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder type(string data)
+ {
+ this.properties[CardPaymentsConstants.type] = data;
+ return this;
+ }
+
+ ///
+ /// Set the card's last digits
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder lastDigits(string data)
+ {
+ this.properties[CardPaymentsConstants.lastDigits] = data;
+ return this;
+ }
+
+ ///
+ /// Build a card expiry within this card.
+ ///
+ /// CardExpiry.CardExpiryBuilder>
+ public CardExpiry.CardExpiryBuilder> cardExpiry()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.cardExpiry))
+ {
+ this.properties[CardPaymentsConstants.cardExpiry] = new CardExpiry.CardExpiryBuilder>(this);
+ }
+ return this.properties[CardPaymentsConstants.cardExpiry] as CardExpiry.CardExpiryBuilder>;
+ }
+
+ ///
+ /// Set the card cvv
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder cvv(string data)
+ {
+ this.properties[CardPaymentsConstants.cvv] = data;
+ return this;
+ }
+
+ ///
+ /// Set the track1 data
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder track1(string data)
+ {
+ this.properties[CardPaymentsConstants.track1] = data;
+ return this;
+ }
+
+ ///
+ /// Set the track2 data
+ ///
+ /// string
+ /// CardBuilder
+ public CardBuilder track2(string data)
+ {
+ this.properties[CardPaymentsConstants.track2] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/CardPaymentService.cs b/Paysafe/CardPayments/CardPaymentService.cs
new file mode 100644
index 0000000..53364f9
--- /dev/null
+++ b/Paysafe/CardPayments/CardPaymentService.cs
@@ -0,0 +1,631 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+using PaysafeApiClient = Paysafe.PaysafeApiClient;
+
+namespace Paysafe.CardPayments
+{
+ public class CardPaymentService
+ {
+
+ ///
+ /// The api client, performs all http requests
+ ///
+ private PaysafeApiClient client;
+
+ ///
+ /// The card payments api base uri
+ ///
+ private string uri = "cardpayments/v1";
+
+ ///
+ /// Initialize the card payments service with an client object
+ ///
+ /// PaysafeApiClient
+ public CardPaymentService(PaysafeApiClient client)
+ {
+ this.client = client;
+ }
+
+ ///
+ /// Check if the service is available
+ ///
+ /// true if successful
+ public Boolean monitor() {
+ Request request = new Request(uri:"cardpayments/monitor");
+ dynamic response = this.client.processRequest(request);
+
+ return ("READY".Equals((string)(response[CardPaymentsConstants.status])));
+ }
+
+ ///
+ /// Authorize
+ ///
+ /// Authorization
+ /// Authorization
+ public Authorization authorize(Authorization auth)
+ {
+ auth.setRequiredFields(new List {
+ CardPaymentsConstants.merchantRefNum,
+ CardPaymentsConstants.amount,
+ CardPaymentsConstants.card
+ });
+ auth.setOptionalFields(new List {
+ CardPaymentsConstants.settleWithAuth,
+ CardPaymentsConstants.customerIp,
+ CardPaymentsConstants.dupCheck,
+ CardPaymentsConstants.description,
+ CardPaymentsConstants.authentication,
+ CardPaymentsConstants.billingDetails,
+ CardPaymentsConstants.shippingDetails,
+ CardPaymentsConstants.recurring,
+ CardPaymentsConstants.merchantDescriptor,
+ CardPaymentsConstants.accordD
+ });
+
+ Request request = new Request(
+ method: RequestType.POST,
+ uri: this.prepareURI("/auths"),
+ body: auth
+ );
+ dynamic response = this.client.processRequest(request);
+
+ return new Authorization(response);
+ }
+
+ ///
+ /// Cancel the Authorization
+ ///
+ /// Authorization
+ /// Authorization
+ public Authorization cancelHeldAuth(Authorization auth)
+ {
+ auth.setRequiredFields(new List {CardPaymentsConstants.id});
+ auth.checkRequiredFields();
+
+ Authorization tmpAuth = new Authorization();
+ tmpAuth.status("CANCELLED");
+
+ Request request = new Request(
+ method: RequestType.PUT,
+ uri: this.prepareURI("/auths/" + auth.id()),
+ body: tmpAuth
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Authorization(response);
+ }
+
+ ///
+ /// Approve
+ ///
+ /// Authorization
+ /// Authorization
+ public Authorization approveHeldAuth(Authorization auth)
+ {
+ auth.setRequiredFields(new List {CardPaymentsConstants.id});
+
+ auth.checkRequiredFields();
+
+ Authorization tmpAuth = new Authorization();
+ tmpAuth.status("COMPLETED");
+
+ Request request = new Request(
+ method: RequestType.PUT,
+ uri: this.prepareURI("/auths/" + auth.id()),
+ body: tmpAuth
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Authorization(response);
+ }
+
+ ///
+ /// Reverse
+ ///
+ /// AuthorizationReversal
+ /// AuthorizationReversal
+ public AuthorizationReversal reverseAuth(AuthorizationReversal authReversal)
+ {
+ authReversal.setRequiredFields(new List {CardPaymentsConstants.authorizationId});
+ authReversal.checkRequiredFields();
+ authReversal.setRequiredFields(new List {CardPaymentsConstants.merchantRefNum});
+ authReversal.setOptionalFields(new List {
+ CardPaymentsConstants.amount,
+ CardPaymentsConstants.dupCheck
+ });
+
+ Request request = new Request(
+ method: RequestType.POST,
+ uri: this.prepareURI("/auths/" + authReversal.authorizationId() + "/voidauths"),
+ body: authReversal
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new AuthorizationReversal(response);
+ }
+
+ ///
+ /// Settlement
+ ///
+ /// Settlement
+ /// Settlement
+ public Settlement settlement(Settlement settle)
+ {
+ settle.setRequiredFields(new List { CardPaymentsConstants.authorizationId });
+ settle.checkRequiredFields();
+ settle.setRequiredFields(new List { CardPaymentsConstants.merchantRefNum });
+ settle.setOptionalFields(new List {
+ CardPaymentsConstants.amount,
+ CardPaymentsConstants.dupCheck
+ });
+
+ Request request = new Request(
+ method: RequestType.POST,
+ uri: this.prepareURI("/auths/" + settle.authorizationId() + "/settlements"),
+ body: settle
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Settlement(response);
+ }
+
+ ///
+ /// Cancel Settlement
+ ///
+ /// Settlement
+ /// Settlement
+ public Settlement cancelSettlement(Settlement settle)
+ {
+ settle.setRequiredFields(new List { CardPaymentsConstants.id });
+ settle.checkRequiredFields();
+
+ Settlement tmpSettlement = new Settlement();
+ tmpSettlement.status("CANCELLED");
+
+ Request request = new Request(
+ method: RequestType.PUT,
+ uri: this.prepareURI("/settlements/" + settle.id()),
+ body: tmpSettlement
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Settlement(response);
+ }
+
+ ///
+ /// Refund
+ ///
+ /// Refund
+ /// Refund
+ public Refund refund(Refund newRefund)
+ {
+ newRefund.setRequiredFields(new List { CardPaymentsConstants.settlementId });
+ newRefund.checkRequiredFields();
+ newRefund.setRequiredFields(new List { CardPaymentsConstants.merchantRefNum });
+ newRefund.setOptionalFields(new List {
+ CardPaymentsConstants.amount,
+ CardPaymentsConstants.dupCheck
+ });
+
+ Request request = new Request(
+ method: RequestType.POST,
+ uri: this.prepareURI("/settlements/" + newRefund.settlementId() + "/refunds"),
+ body: newRefund
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Refund(response);
+ }
+
+ ///
+ /// Cancel Refund
+ ///
+ /// Refund
+ /// Refund
+ public Refund cancelRefund(Refund refund)
+ {
+ refund.setRequiredFields(new List { CardPaymentsConstants.id });
+ refund.checkRequiredFields();
+
+ Refund tmpRefund = new Refund();
+ tmpRefund.status("CANCELLED");
+
+ Request request = new Request(
+ method: RequestType.PUT,
+ uri: this.prepareURI("/refunds/" + refund.id()),
+ body: tmpRefund
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Refund(response);
+ }
+
+ ///
+ /// Verify
+ ///
+ /// Verification
+ /// Verificationd
+ public Verification verify(Verification verification)
+ {
+ verification.setRequiredFields(new List {
+ CardPaymentsConstants.merchantRefNum,
+ CardPaymentsConstants.card
+ });
+
+ verification.setOptionalFields(new List {
+ CardPaymentsConstants.profile,
+ CardPaymentsConstants.customerIp,
+ CardPaymentsConstants.dupCheck,
+ CardPaymentsConstants.description,
+ CardPaymentsConstants.billingDetails
+ });
+
+ Request request = new Request(
+ method: RequestType.POST,
+ uri: this.prepareURI("/verifications"),
+ body: verification
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Verification(response);
+ }
+
+ ///
+ /// Get the authorization
+ ///
+ /// Authorization
+ /// Authorization
+ public Authorization get(Authorization auth)
+ {
+ auth.setRequiredFields(new List { CardPaymentsConstants.id });
+ auth.checkRequiredFields();
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/auths/" + auth.id())
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Authorization(response);
+ }
+
+ ///
+ /// Get the AuthorizationReversal
+ ///
+ /// AuthorizationReversal
+ /// AuthorizationReversal
+ public AuthorizationReversal get(AuthorizationReversal authReversal)
+ {
+ authReversal.setRequiredFields(new List { CardPaymentsConstants.id });
+ authReversal.checkRequiredFields();
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/voidauths/" + authReversal.id())
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new AuthorizationReversal(response);
+ }
+
+ ///
+ /// Get the Settlement
+ ///
+ /// Settlement
+ /// Settlement
+ public Settlement get(Settlement settlement)
+ {
+ settlement.setRequiredFields(new List { CardPaymentsConstants.id });
+ settlement.checkRequiredFields();
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/settlements/" + settlement.id())
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Settlement(response);
+ }
+
+ ///
+ /// Get the Refund
+ ///
+ /// Refund
+ /// Refund
+ public Refund get(Refund refund)
+ {
+ refund.setRequiredFields(new List { CardPaymentsConstants.id });
+ refund.checkRequiredFields();
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/refunds/" + refund.id())
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Refund(response);
+ }
+
+ ///
+ /// Get the verification
+ ///
+ /// Verification
+ /// Verification
+ public Verification get(Verification verify)
+ {
+ verify.setRequiredFields(new List { CardPaymentsConstants.id });
+ verify.checkRequiredFields();
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/verifications/" + verify.id())
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Verification(response);
+ }
+
+ ///
+ /// Get matching authorizations
+ ///
+ ///
+ ///
+ ///
+ public Pagerator getAuths(Authorization auth = null, Filter filter = null)
+ {
+ Dictionary queryStr = new Dictionary();
+ if (auth != null && !String.IsNullOrWhiteSpace(auth.merchantRefNum())) {
+ queryStr.Add("merchantRefNum", auth.merchantRefNum());
+ }
+ if (filter != null)
+ {
+ if (filter.limit != null)
+ {
+ queryStr.Add("limit", filter.limit.ToString());
+ }
+ if (filter.offset != null)
+ {
+ queryStr.Add("offset", filter.offset.ToString());
+ }
+ if (!String.IsNullOrWhiteSpace(filter.startDate))
+ {
+ queryStr.Add("startDate", filter.startDate);
+ }
+ if (!String.IsNullOrWhiteSpace(filter.endDate))
+ {
+ queryStr.Add("endDate", filter.endDate);
+ }
+ }
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/auths"),
+ queryString: queryStr
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Pagerator(this.client, typeof(Authorization), response);
+ }
+
+ ///
+ /// Get matching authorization reversals
+ ///
+ ///
+ ///
+ ///
+ public Pagerator getAuthReversals(AuthorizationReversal authReversal = null, Filter filter = null)
+ {
+ Dictionary queryStr = new Dictionary();
+ if (authReversal != null && !String.IsNullOrWhiteSpace(authReversal.merchantRefNum()))
+ {
+ queryStr.Add("merchantRefNum", authReversal.merchantRefNum());
+ }
+ if (filter != null)
+ {
+ if (filter.limit != null)
+ {
+ queryStr.Add("limit", filter.limit.ToString());
+ }
+ if (filter.offset != null)
+ {
+ queryStr.Add("offset", filter.offset.ToString());
+ }
+ if (!String.IsNullOrWhiteSpace(filter.startDate))
+ {
+ queryStr.Add("startDate", filter.startDate);
+ }
+ if (!String.IsNullOrWhiteSpace(filter.endDate))
+ {
+ queryStr.Add("endDate", filter.endDate);
+ }
+ }
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/voidauths"),
+ queryString: queryStr
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Pagerator(this.client, typeof(AuthorizationReversal), response);
+ }
+
+ ///
+ /// Get matching settlements
+ ///
+ ///
+ ///
+ ///
+ public Pagerator getSettlements(Settlement settlement = null, Filter filter = null)
+ {
+ Dictionary queryStr = new Dictionary();
+ if (settlement != null && !String.IsNullOrWhiteSpace(settlement.merchantRefNum()))
+ {
+ queryStr.Add("merchantRefNum", settlement.merchantRefNum());
+ }
+ if (filter != null)
+ {
+ if (filter.limit != null)
+ {
+ queryStr.Add("limit", filter.limit.ToString());
+ }
+ if (filter.offset != null)
+ {
+ queryStr.Add("offset", filter.offset.ToString());
+ }
+ if (!String.IsNullOrWhiteSpace(filter.startDate))
+ {
+ queryStr.Add("startDate", filter.startDate);
+ }
+ if (!String.IsNullOrWhiteSpace(filter.endDate))
+ {
+ queryStr.Add("endDate", filter.endDate);
+ }
+ }
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/settlements"),
+ queryString: queryStr
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Pagerator(this.client, typeof(Settlement), response);
+ }
+
+ ///
+ /// Get matching refunds
+ ///
+ ///
+ ///
+ ///
+ public Pagerator getRefunds(Refund refund = null, Filter filter = null)
+ {
+ Dictionary queryStr = new Dictionary();
+ if (refund != null && !String.IsNullOrWhiteSpace(refund.merchantRefNum()))
+ {
+ queryStr.Add("merchantRefNum", refund.merchantRefNum());
+ }
+ if (filter != null)
+ {
+ if (filter.limit != null)
+ {
+ queryStr.Add("limit", filter.limit.ToString());
+ }
+ if (filter.offset != null)
+ {
+ queryStr.Add("offset", filter.offset.ToString());
+ }
+ if (!String.IsNullOrWhiteSpace(filter.startDate))
+ {
+ queryStr.Add("startDate", filter.startDate);
+ }
+ if (!String.IsNullOrWhiteSpace(filter.endDate))
+ {
+ queryStr.Add("endDate", filter.endDate);
+ }
+ }
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/refunds"),
+ queryString: queryStr
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Pagerator(this.client, typeof(Refund), response);
+ }
+
+ ///
+ /// Get matching verifications
+ ///
+ ///
+ ///
+ ///
+ public Pagerator getVerifications(Verification verify = null, Filter filter = null)
+ {
+ Dictionary queryStr = new Dictionary();
+ if (verify != null && !String.IsNullOrWhiteSpace(verify.merchantRefNum()))
+ {
+ queryStr.Add("merchantRefNum", verify.merchantRefNum());
+ }
+ if (filter != null)
+ {
+ if (filter.limit != null)
+ {
+ queryStr.Add("limit", filter.limit.ToString());
+ }
+ if (filter.offset != null)
+ {
+ queryStr.Add("offset", filter.offset.ToString());
+ }
+ if (!String.IsNullOrWhiteSpace(filter.startDate))
+ {
+ queryStr.Add("startDate", filter.startDate);
+ }
+ if (!String.IsNullOrWhiteSpace(filter.endDate))
+ {
+ queryStr.Add("endDate", filter.endDate);
+ }
+ }
+
+ Request request = new Request(
+ method: RequestType.GET,
+ uri: this.prepareURI("/verifications"),
+ queryString: queryStr
+ );
+
+ dynamic response = this.client.processRequest(request);
+
+ return new Pagerator(this.client, typeof(Verification), response);
+ }
+
+ private string prepareURI(string path)
+ {
+ if (String.IsNullOrWhiteSpace(this.client.account()))
+ {
+ throw new PaysafeException("Missing or invalid account");
+ }
+ return this.uri + "/accounts/" + this.client.account() + path;
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/CardPaymentsConstants.cs b/Paysafe/CardPayments/CardPaymentsConstants.cs
new file mode 100644
index 0000000..2ec7a5d
--- /dev/null
+++ b/Paysafe/CardPayments/CardPaymentsConstants.cs
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.CardPayments
+{
+ /**
+ * This class can be used to override any of the string literals from the global strings class
+ */
+ class CardPaymentsConstants : Paysafe.Common.GlobalConstants
+ {
+ public static readonly List enumAVSResponse = new List() {
+ validationMatch,
+ validationMatchAddressOnly,
+ validationMatchZipOnly,
+ validationNoMatch,
+ validationNotProcessed,
+ validationUnknown
+ };
+ public static readonly List enumCVVVerification = new List() {
+ validationMatch,
+ validationNoMatch,
+ validationNotProcessed,
+ validationUnknown
+
+ };
+ public static readonly List enumFinancingType = new List() {
+ financingDeferredPayment,
+ financingEqualPayment
+ };
+ public static readonly List enumRecurring = new List() {
+ recurringInitial,
+ recurringRecurring
+ };
+ public static readonly List enumStatus = new List() {
+ statusReceived,
+ statusPending,
+ statusProcessing,
+ statusCompleted,
+ statusFailed,
+ statusCancelled
+ };
+ }
+}
diff --git a/Paysafe/CardPayments/Filter.cs b/Paysafe/CardPayments/Filter.cs
new file mode 100644
index 0000000..b1c914a
--- /dev/null
+++ b/Paysafe/CardPayments/Filter.cs
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.CardPayments
+{
+ public class Filter
+ {
+
+ ///
+ /// number of results per page
+ ///
+
+ public int? limit = null;
+
+ ///
+ /// The offset to start the request
+ ///
+ public int? offset = null;
+
+ ///
+ /// The earliest date to match
+ ///
+ public String startDate = null;
+
+ ///
+ /// The latest date to match
+ ///
+ public String endDate = null;
+ }
+}
diff --git a/Paysafe/CardPayments/MasterPass.cs b/Paysafe/CardPayments/MasterPass.cs
new file mode 100644
index 0000000..a702487
--- /dev/null
+++ b/Paysafe/CardPayments/MasterPass.cs
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+
+ public class MasterPass : JSONObject
+ {
+ ///
+ /// Initialize the MasterPass object with some set of properties
+ ///
+ /// Dictionary
+ public MasterPass(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.payPassWalletIndicator, STRING_TYPE},
+ {CardPaymentsConstants.authenticationMethod, STRING_TYPE},
+ {CardPaymentsConstants.cardEnrollementMethod, STRING_TYPE},
+ {CardPaymentsConstants.masterCardAssignedId, STRING_TYPE}
+ };
+
+ ///
+ /// Get the payPassWalletIndicator
+ ///
+ /// string
+ public string payPassWalletIndicator()
+ {
+ return this.getProperty(CardPaymentsConstants.payPassWalletIndicator);
+ }
+
+ ///
+ /// Set the payPassWalletIndicator
+ ///
+ /// void
+ public void payPassWalletIndicator(string data)
+ {
+ this.setProperty(CardPaymentsConstants.payPassWalletIndicator, data);
+ }
+
+ ///
+ /// Get the authenticationMethod
+ ///
+ /// string
+ public string authenticationMethod()
+ {
+ return this.getProperty(CardPaymentsConstants.authenticationMethod);
+ }
+
+ ///
+ /// Set the authenticationMethod
+ ///
+ /// void
+ public void authenticationMethod(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authenticationMethod, data);
+ }
+
+ ///
+ /// Get the cardEnrollementMethod
+ ///
+ /// string
+ public string cardEnrollementMethod()
+ {
+ return this.getProperty(CardPaymentsConstants.cardEnrollementMethod);
+ }
+
+ ///
+ /// Set the cardEnrollementMethod
+ ///
+ /// void
+ public void cardEnrollementMethod(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cardEnrollementMethod, data);
+ }
+
+ ///
+ /// Get the masterCardAssignedId
+ ///
+ /// string
+ public string masterCardAssignedIdr()
+ {
+ return this.getProperty(CardPaymentsConstants.masterCardAssignedId);
+ }
+
+ ///
+ /// Set the masterCardAssignedId
+ ///
+ /// void
+ public void masterCardAssignedId(string data)
+ {
+ this.setProperty(CardPaymentsConstants.masterCardAssignedId, data);
+ }
+
+ }
+}
diff --git a/Paysafe/CardPayments/MerchantDescriptor.cs b/Paysafe/CardPayments/MerchantDescriptor.cs
new file mode 100644
index 0000000..e88bc31
--- /dev/null
+++ b/Paysafe/CardPayments/MerchantDescriptor.cs
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+
+ public class MerchantDescriptor : JSONObject
+ {
+ ///
+ /// Initialize the MerchantDescriptor object with some set of properties
+ ///
+ /// Dictionary
+ public MerchantDescriptor(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.dynamicDescriptor, STRING_TYPE},
+ {CardPaymentsConstants.phone, STRING_TYPE}
+ };
+
+ ///
+ /// Get the dynamicDescriptor
+ ///
+ /// string
+ public string dynamicDescriptor()
+ {
+ return this.getProperty(CardPaymentsConstants.dynamicDescriptor);
+ }
+
+ ///
+ /// Set the dynamicDescriptor
+ ///
+ /// void
+ public void dynamicDescriptor(string data)
+ {
+ this.setProperty(CardPaymentsConstants.dynamicDescriptor, data);
+ }
+
+ ///
+ /// Get the street
+ ///
+ /// string
+ public string street()
+ {
+ return this.getProperty(CardPaymentsConstants.phone);
+ }
+
+ ///
+ /// Set the zip
+ ///
+ /// void
+ public void zip(string data)
+ {
+ this.setProperty(CardPaymentsConstants.phone, data);
+ }
+
+ ///
+ /// MerchantDescriptorBuilder will allow a MerchantDescriptor to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class MerchantDescriptorBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the MerchantDescriptor builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public MerchantDescriptorBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the dynamicDescriptor
+ ///
+ /// string
+ /// MerchantDescriptorBuilder
+ public MerchantDescriptorBuilder dynamicDescriptor(string data)
+ {
+ this.properties[CardPaymentsConstants.dynamicDescriptor] = data;
+ return this;
+ }
+
+
+ ///
+ /// Set the phone
+ ///
+ /// string
+ /// MerchantDescriptorBuilder
+ public MerchantDescriptorBuilder phone(string data)
+ {
+ this.properties[CardPaymentsConstants.phone] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/Pagerator.cs b/Paysafe/CardPayments/Pagerator.cs
new file mode 100644
index 0000000..95a348a
--- /dev/null
+++ b/Paysafe/CardPayments/Pagerator.cs
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Pagerator : AbstractPagerator
+ {
+ public Pagerator(PaysafeApiClient apiClient, Type pagingClassType, Dictionary data)
+ : base(apiClient, pagingClassType)
+ {
+ this.parseResponse(data);
+ }
+
+ override protected sealed void parseResponse(Dictionary data)
+ {
+ if (!data.ContainsKey(this.arrayKey) || !(data[this.arrayKey] is List))
+ {
+ throw new PaysafeException("Missing array key from results");
+ }
+ foreach(dynamic obj in data[this.arrayKey] as List) {
+ Object[] args = { obj };
+ dynamic result = Activator.CreateInstance(this.classType, args);
+ this.results.Add(result);
+ }
+ this.nextPage = null;
+
+ if (data.ContainsKey("links")
+ && data["links"] is List)
+ {
+ foreach (dynamic obj in (List)data["links"])
+ {
+ Link tmpLink = new Link(obj);
+ if (tmpLink.rel().Equals("next"))
+ {
+ this.nextPage = tmpLink.href();
+ break;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/PaysafeAuthentication.cs b/Paysafe/CardPayments/PaysafeAuthentication.cs
new file mode 100644
index 0000000..60903a8
--- /dev/null
+++ b/Paysafe/CardPayments/PaysafeAuthentication.cs
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+
+namespace Paysafe.CardPayments
+{
+ public class PaysafeAuthentication : JSONObject
+ {
+
+ ///
+ /// Initialize the BillingDetails object with some set of properties
+ ///
+ /// Dictionary
+ public PaysafeAuthentication(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.eci, INT_TYPE},
+ {CardPaymentsConstants.cavv, STRING_TYPE},
+ {CardPaymentsConstants.xid, STRING_TYPE},
+ {CardPaymentsConstants.threeDEnrollment, STRING_TYPE},
+ {CardPaymentsConstants.threeDResult, STRING_TYPE},
+ {CardPaymentsConstants.signatureStatus, STRING_TYPE}
+ };
+
+ ///
+ /// Get the eci
+ ///
+ /// int
+ public int eci()
+ {
+ return this.getProperty(CardPaymentsConstants.eci);
+ }
+
+ ///
+ /// Set the eci
+ ///
+ /// void
+ public void eci(int data)
+ {
+ this.setProperty(CardPaymentsConstants.eci, data);
+ }
+
+ ///
+ /// Get the cavv
+ ///
+ /// string
+ public string cavv()
+ {
+ return this.getProperty(CardPaymentsConstants.cavv);
+ }
+
+ ///
+ /// Set the cavv
+ ///
+ /// void
+ public void cavv(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cavv, data);
+ }
+
+ ///
+ /// Get the xid
+ ///
+ /// string
+ public string xid()
+ {
+ return this.getProperty(CardPaymentsConstants.xid);
+ }
+
+ ///
+ /// Set the xid
+ ///
+ /// void
+ public void xid(string data)
+ {
+ this.setProperty(CardPaymentsConstants.xid, data);
+ }
+
+ ///
+ /// Get the threeDEnrollment
+ ///
+ /// string
+ public string threeDEnrollment()
+ {
+ return this.getProperty(CardPaymentsConstants.threeDEnrollment);
+ }
+
+ ///
+ /// Set the threeDEnrollment
+ ///
+ /// void
+ public void threeDEnrollment(string data)
+ {
+ this.setProperty(CardPaymentsConstants.threeDEnrollment, data);
+ }
+
+ ///
+ /// Get the threeDResult
+ ///
+ /// string
+ public string threeDResult()
+ {
+ return this.getProperty(CardPaymentsConstants.threeDResult);
+ }
+
+ ///
+ /// Set the threeDResult
+ ///
+ /// void
+ public void threeDResult(string data)
+ {
+ this.setProperty(CardPaymentsConstants.threeDResult, data);
+ }
+
+ ///
+ /// Get the signatureStatus
+ ///
+ /// string
+ public string signatureStatus()
+ {
+ return this.getProperty(CardPaymentsConstants.signatureStatus);
+ }
+
+ ///
+ /// Set the signatureStatus
+ ///
+ /// void
+ public void signatureStatus(string data)
+ {
+ this.setProperty(CardPaymentsConstants.signatureStatus, data);
+ }
+
+
+ ///
+ /// AuthenticationBuilder will allow a Authentication to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class AuthenticationBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the Authentication builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public AuthenticationBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+
+ ///
+ /// Set the eci
+ ///
+ /// int
+ /// AuthenticationBuilder
+ public AuthenticationBuilder eci(int data)
+ {
+ this.properties[CardPaymentsConstants.eci] = data;
+ return this;
+ }
+
+ ///
+ /// Set the cavv
+ ///
+ /// string
+ /// AuthenticationBuilder
+ public AuthenticationBuilder cavv(string data)
+ {
+ this.properties[CardPaymentsConstants.cavv] = data;
+ return this;
+ }
+
+ ///
+ /// Set the xid
+ ///
+ /// string
+ /// AuthenticationBuilder
+ public AuthenticationBuilder xid(string data)
+ {
+ this.properties[CardPaymentsConstants.xid] = data;
+ return this;
+ }
+
+ ///
+ /// Set the threeDEnrollment
+ ///
+ /// string
+ /// AuthenticationBuilder
+ public AuthenticationBuilder threeDEnrollment(string data)
+ {
+ this.properties[CardPaymentsConstants.threeDEnrollment] = data;
+ return this;
+ }
+
+ ///
+ /// Set the threeDResult
+ ///
+ /// string
+ /// AuthenticationBuilder
+ public AuthenticationBuilder threeDResult(string data)
+ {
+ this.properties[CardPaymentsConstants.threeDResult] = data;
+ return this;
+ }
+
+ ///
+ /// Set the signatureStatus
+ ///
+ /// string
+ /// AuthenticationBuilder
+ public AuthenticationBuilder signatureStatus(string data)
+ {
+ this.properties[CardPaymentsConstants.signatureStatus] = data;
+ return this;
+ }
+
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/Profile.cs b/Paysafe/CardPayments/Profile.cs
new file mode 100644
index 0000000..f048a2b
--- /dev/null
+++ b/Paysafe/CardPayments/Profile.cs
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Profile : JSONObject
+ {
+ ///
+ /// Initialize the Profile object with some set of properties
+ ///
+ /// Dictionary
+ public Profile(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.firstName, STRING_TYPE},
+ {CardPaymentsConstants.lastName, STRING_TYPE},
+ {CardPaymentsConstants.email, EMAIL_TYPE}
+ };
+
+
+ ///
+ /// Get the firstName
+ ///
+ /// string
+ public string firstName()
+ {
+ return this.getProperty(CardPaymentsConstants.firstName);
+ }
+
+ ///
+ /// Set the firstName
+ ///
+ /// void
+ public void firstName(string data)
+ {
+ this.setProperty(CardPaymentsConstants.firstName, data);
+ }
+
+ ///
+ /// Get the lastName
+ ///
+ /// string
+ public string lastName()
+ {
+ return this.getProperty(CardPaymentsConstants.lastName);
+ }
+
+ ///
+ /// Set the lastName
+ ///
+ /// void
+ public void lastName(string data)
+ {
+ this.setProperty(CardPaymentsConstants.lastName, data);
+ }
+
+ ///
+ /// Get the email
+ ///
+ /// string
+ public string email()
+ {
+ return this.getProperty(CardPaymentsConstants.email);
+ }
+
+ ///
+ /// Set the email
+ ///
+ /// void
+ public void email(string data)
+ {
+ this.setProperty(CardPaymentsConstants.email, data);
+ }
+
+
+ ///
+ /// ProfileBuilder will allow a Profile to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class ProfileBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the Profile builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public ProfileBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the firstname
+ ///
+ /// string
+ /// ProfileBuilder
+ public ProfileBuilder firstName(string data)
+ {
+ this.properties[CardPaymentsConstants.firstName] = data;
+ return this;
+ }
+
+ ///
+ /// Set the lastname
+ ///
+ /// string
+ /// ProfileBuilder
+ public ProfileBuilder lastName(string data)
+ {
+ this.properties[CardPaymentsConstants.lastName] = data;
+ return this;
+ }
+
+ ///
+ /// Set the email
+ ///
+ /// string
+ /// ProfileBuilder
+ public ProfileBuilder email(string data)
+ {
+ this.properties[CardPaymentsConstants.email] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/Refund.cs b/Paysafe/CardPayments/Refund.cs
new file mode 100644
index 0000000..43c5549
--- /dev/null
+++ b/Paysafe/CardPayments/Refund.cs
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+
+ public class Refund : JSONObject
+ {
+ ///
+ /// Initialize the Refund object with some set of properties
+ ///
+ /// Dictionary
+ public Refund(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// Initialize a refund object with an id
+ ///
+ ///
+ public Refund(String id)
+ : base(fieldTypes)
+ {
+ this.id(id);
+ }
+
+ ///
+ /// Gets the array key to access the array of refunds
+ ///
+ /// The key to be checked in the returning JSON
+ public static string getPageableArrayKey()
+ {
+ return "refunds";
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.id, STRING_TYPE},
+ {CardPaymentsConstants.merchantRefNum, STRING_TYPE},
+ {CardPaymentsConstants.amount, INT_TYPE},
+ {CardPaymentsConstants.childAccountNum, STRING_TYPE},
+ {CardPaymentsConstants.dupCheck, BOOL_TYPE},
+ {CardPaymentsConstants.txnTime, typeof(System.DateTime)},
+ {CardPaymentsConstants.status, CardPaymentsConstants.enumStatus},
+ {CardPaymentsConstants.riskReasonCode, typeof(List)},
+ {CardPaymentsConstants.acquirerResponse, typeof(AcquirerResponse)},
+ {CardPaymentsConstants.error, typeof(OptError)},
+ {CardPaymentsConstants.links, typeof(List)},
+ {CardPaymentsConstants.settlementId, STRING_TYPE}
+ };
+
+ ///
+ /// Get the id
+ ///
+ /// string
+ public string id()
+ {
+ return this.getProperty(CardPaymentsConstants.id);
+ }
+
+ ///
+ /// Set the id
+ ///
+ /// void
+ public void id(string data)
+ {
+ this.setProperty(CardPaymentsConstants.id, data);
+ }
+
+ ///
+ /// Get the merchantRefNum
+ ///
+ /// string
+ public string merchantRefNum()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantRefNum);
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// void
+ public void merchantRefNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantRefNum, data);
+ }
+
+ ///
+ /// Get the amount
+ ///
+ /// int
+ public int amount()
+ {
+ return this.getProperty(CardPaymentsConstants.amount);
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// void
+ public void amount(int data)
+ {
+ this.setProperty(CardPaymentsConstants.amount, data);
+ }
+
+ ///
+ /// Get the childAccountNum
+ ///
+ /// string
+ public string childAccountNum()
+ {
+ return this.getProperty(CardPaymentsConstants.childAccountNum);
+ }
+
+ ///
+ /// Set the childAccountNum
+ ///
+ /// void
+ public void childAccountNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.childAccountNum, data);
+ }
+
+ ///
+ /// Get the dupCheck
+ ///
+ /// bool
+ public bool dupCheck()
+ {
+ return this.getProperty(CardPaymentsConstants.dupCheck);
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// void
+ public void dupCheck(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.dupCheck, data);
+ }
+
+ ///
+ /// Get the txnTime
+ ///
+ /// System.DateTime
+ public System.DateTime txnTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnTime);
+ }
+
+ ///
+ /// Set the txnTime
+ ///
+ /// void
+ public void txnTime(System.DateTime data)
+ {
+ this.setProperty(CardPaymentsConstants.txnTime, data);
+ }
+
+ ///
+ /// Get the status
+ ///
+ /// String
+ public string status()
+ {
+ return this.getProperty(CardPaymentsConstants.status);
+ }
+
+ ///
+ /// Set the status
+ ///
+ /// void
+ public void status(string data)
+ {
+ this.setProperty(CardPaymentsConstants.status, data);
+ }
+
+ ///
+ /// Get the riskReasonCode
+ ///
+ /// List
+ public List riskReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.riskReasonCode);
+ }
+
+ ///
+ /// Set the riskReasonCode
+ ///
+ /// void
+ public void riskReasonCode(List data)
+ {
+ this.setProperty(CardPaymentsConstants.riskReasonCode, data);
+ }
+
+ ///
+ /// Get the acquireResponse
+ ///
+ /// AcquirerResponse
+ public AcquirerResponse acquireResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.acquirerResponse);
+ }
+
+ ///
+ /// Set the acquireResponse
+ ///
+ /// void
+ public void acquireResponse(AcquirerResponse data)
+ {
+ this.setProperty(CardPaymentsConstants.acquirerResponse, data);
+ }
+
+ ///
+ /// Get the error
+ ///
+ /// OptError
+ public OptError error()
+ {
+ return this.getProperty(CardPaymentsConstants.error);
+ }
+
+ ///
+ /// Set the error
+ ///
+ /// void
+ public void error(OptError data)
+ {
+ this.setProperty(CardPaymentsConstants.error, data);
+ }
+
+ ///
+ /// Get the links
+ ///
+ /// List
+ public List links()
+ {
+ return this.getProperty(CardPaymentsConstants.links);
+ }
+
+ ///
+ /// Set the links
+ ///
+ /// void
+ public void links(List data)
+ {
+ this.setProperty(CardPaymentsConstants.links, data);
+ }
+
+ ///
+ /// Get the settlementId
+ ///
+ /// string
+ public string settlementId()
+ {
+ return this.getProperty(CardPaymentsConstants.settlementId);
+ }
+
+ ///
+ /// Set the settlementId
+ ///
+ /// void
+ public void settlementId(string data)
+ {
+ this.setProperty(CardPaymentsConstants.settlementId, data);
+ }
+
+ ///
+ /// Get a new RefundBuilder
+ ///
+ /// RefundBuilder
+ public static RefundBuilder Builder()
+ {
+ return new RefundBuilder();
+ }
+
+ ///
+ /// RefundBuilder will allow an Refund to be initialized.
+ /// set all properties and subpropeties, then trigger .Build() to
+ /// get the generated Authorization object
+ ///
+ public class RefundBuilder : BaseJSONBuilder
+ {
+ ///
+ /// Set the id
+ ///
+ /// string
+ /// RefundBuilder
+ public RefundBuilder id(string data)
+ {
+ this.properties[CardPaymentsConstants.id] = data;
+ return this;
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// string
+ /// RefundBuilder
+ public RefundBuilder merchantRefNum(string data)
+ {
+ this.properties[CardPaymentsConstants.merchantRefNum] = data;
+ return this;
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// int
+ /// RefundBuilder
+ public RefundBuilder amount(int data)
+ {
+ this.properties[CardPaymentsConstants.amount] = data;
+ return this;
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// bool
+ /// RefundBuilder
+ public RefundBuilder dupCheck(bool data)
+ {
+ this.properties[CardPaymentsConstants.dupCheck] = data;
+ return this;
+ }
+
+ ///
+ /// Set the settlementId
+ ///
+ /// bool
+ /// RefundBuilder
+ public RefundBuilder settlementId(String data)
+ {
+ this.properties[CardPaymentsConstants.settlementId] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/Settlement.cs b/Paysafe/CardPayments/Settlement.cs
new file mode 100644
index 0000000..59efa62
--- /dev/null
+++ b/Paysafe/CardPayments/Settlement.cs
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Settlement : JSONObject
+ {
+ ///
+ /// Initialize the Settlement object with some set of properties
+ ///
+ /// Dictionary
+ public Settlement(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// Initialize a settlement object with an id
+ ///
+ ///
+ public Settlement(String id)
+ : base(fieldTypes)
+ {
+ this.id(id);
+ }
+
+ ///
+ /// Gets the array key to access the array of settlements
+ ///
+ /// The key to be checked in the returning JSON
+ public static string getPageableArrayKey()
+ {
+ return CardPaymentsConstants.settlements;
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.id, STRING_TYPE},
+ {CardPaymentsConstants.merchantRefNum, STRING_TYPE},
+ {CardPaymentsConstants.amount, INT_TYPE},
+ {CardPaymentsConstants.availableToRefund, INT_TYPE},
+ {CardPaymentsConstants.childAccountNum, STRING_TYPE},
+ {CardPaymentsConstants.txnTime, typeof(System.DateTime)},
+ {CardPaymentsConstants.dupCheck, BOOL_TYPE},
+ {CardPaymentsConstants.status, CardPaymentsConstants.enumStatus},
+ {CardPaymentsConstants.riskReasonCode, typeof(List)},
+ {CardPaymentsConstants.acquirerResponse, typeof(AcquirerResponse)},
+ {CardPaymentsConstants.error, typeof(OptError)},
+ {CardPaymentsConstants.links, typeof(List)},
+ {CardPaymentsConstants.authorizationId, STRING_TYPE}
+ };
+
+
+ ///
+ /// Get the id
+ ///
+ /// string
+ public string id()
+ {
+ return this.getProperty(CardPaymentsConstants.id);
+ }
+
+ ///
+ /// Set the id
+ ///
+ /// void
+ public void id(string data)
+ {
+ this.setProperty(CardPaymentsConstants.id, data);
+ }
+
+ ///
+ /// Get the merchantRefNum
+ ///
+ /// string
+ public string merchantRefNum()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantRefNum);
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// void
+ public void merchantRefNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantRefNum, data);
+ }
+
+ ///
+ /// Get the amount
+ ///
+ /// int
+ public int amount()
+ {
+ return this.getProperty(CardPaymentsConstants.amount);
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// void
+ public void amount(int data)
+ {
+ this.setProperty(CardPaymentsConstants.amount, data);
+ }
+
+ ///
+ /// Get the availableToRefund
+ ///
+ /// int
+ public int availableToRefund()
+ {
+ return this.getProperty(CardPaymentsConstants.availableToRefund);
+ }
+
+ ///
+ /// Set the availableToRefund
+ ///
+ /// void
+ public void availableToRefund(int data)
+ {
+ this.setProperty(CardPaymentsConstants.availableToRefund, data);
+ }
+
+ ///
+ /// Get the childAccountNum
+ ///
+ /// string
+ public string childAccountNum()
+ {
+ return this.getProperty(CardPaymentsConstants.childAccountNum);
+ }
+
+ ///
+ /// Set the childAccountNum
+ ///
+ /// void
+ public void childAccountNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.childAccountNum, data);
+ }
+
+ ///
+ /// Get the txnTime
+ ///
+ /// System.DateTime
+ public System.DateTime txnTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnTime);
+ }
+
+ ///
+ /// Set the txnTime
+ ///
+ /// void
+ public void txnTime(System.DateTime data)
+ {
+ this.setProperty(CardPaymentsConstants.txnTime, data);
+ }
+
+ ///
+ /// Get the dupCheck
+ ///
+ /// bool
+ public bool dupCheck()
+ {
+ return this.getProperty(CardPaymentsConstants.dupCheck);
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// void
+ public void dupCheck(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.dupCheck, data);
+ }
+
+ ///
+ /// Get the status
+ ///
+ /// List
+ public string status()
+ {
+ return this.getProperty(CardPaymentsConstants.status);
+ }
+
+ ///
+ /// Set the status
+ ///
+ /// void
+ public void status(string data)
+ {
+ this.setProperty(CardPaymentsConstants.status, data);
+ }
+
+ ///
+ /// Get the riskReasonCode
+ ///
+ /// List
+ public List riskReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.riskReasonCode);
+ }
+
+ ///
+ /// Set the riskReasonCode
+ ///
+ /// void
+ public void riskReasonCode(List data)
+ {
+ this.setProperty(CardPaymentsConstants.riskReasonCode, data);
+ }
+
+ ///
+ /// Get the acquireResponse
+ ///
+ /// AcquirerResponse
+ public AcquirerResponse acquireResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.acquirerResponse);
+ }
+
+ ///
+ /// Set the acquireResponse
+ ///
+ /// void
+ public void acquireResponse(AcquirerResponse data)
+ {
+ this.setProperty(CardPaymentsConstants.acquirerResponse, data);
+ }
+
+ ///
+ /// Get the error
+ ///
+ /// OptError
+ public OptError error()
+ {
+ return this.getProperty(CardPaymentsConstants.error);
+ }
+
+ ///
+ /// Set the error
+ ///
+ /// void
+ public void error(OptError data)
+ {
+ this.setProperty(CardPaymentsConstants.error, data);
+ }
+
+ ///
+ /// Get the links
+ ///
+ /// List
+ public List links()
+ {
+ return this.getProperty(CardPaymentsConstants.links);
+ }
+
+ ///
+ /// Set the links
+ ///
+ /// void
+ public void links(List data)
+ {
+ this.setProperty(CardPaymentsConstants.links, data);
+ }
+
+ ///
+ /// Get the authorizationId
+ ///
+ /// string
+ public string authorizationId()
+ {
+ return this.getProperty(CardPaymentsConstants.authorizationId);
+ }
+
+ ///
+ /// Set the authorizationId
+ ///
+ /// void
+ public void authorizationId(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authorizationId, data);
+ }
+
+ ///
+ /// Get a new SettlementBuilder
+ ///
+ /// SettlementBuilder
+ public static SettlementBuilder Builder()
+ {
+ return new SettlementBuilder();
+ }
+
+ ///
+ /// SettlementBuilder will allow an Settlement to be initialized.
+ /// set all properties and subpropeties, then trigger .Build() to
+ /// get the generated Authorization object
+ ///
+ public class SettlementBuilder : BaseJSONBuilder
+ {
+ ///
+ /// Set the id
+ ///
+ /// string
+ /// SettlementBuilder
+ public SettlementBuilder id(string data)
+ {
+ this.properties[CardPaymentsConstants.id] = data;
+ return this;
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// string
+ /// SettlementBuilder
+ public SettlementBuilder merchantRefNum(string data)
+ {
+ this.properties[CardPaymentsConstants.merchantRefNum] = data;
+ return this;
+ }
+
+ ///
+ /// Set the amount
+ ///
+ /// int
+ /// SettlementBuilder
+ public SettlementBuilder amount(int data)
+ {
+ this.properties[CardPaymentsConstants.amount] = data;
+ return this;
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// bool
+ /// SettlementBuilder
+ public SettlementBuilder dupCheck(bool data)
+ {
+ this.properties[CardPaymentsConstants.dupCheck] = data;
+ return this;
+ }
+
+ ///
+ /// Set the authorizationId
+ ///
+ /// string
+ /// SettlementBuilder
+ public SettlementBuilder authorizationId(string data)
+ {
+ this.properties[CardPaymentsConstants.authorizationId] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/ShippingDetails.cs b/Paysafe/CardPayments/ShippingDetails.cs
new file mode 100644
index 0000000..3b2576b
--- /dev/null
+++ b/Paysafe/CardPayments/ShippingDetails.cs
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class ShippingDetails : AddressDetails
+ {
+ ///
+ /// Initialize the ShippingDetails object with some set of properties
+ ///
+ /// Dictionary
+ public ShippingDetails(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary(addressFieldTypes)
+ {
+ {CardPaymentsConstants.recipientName, STRING_TYPE},
+ {CardPaymentsConstants.carrier, CardPaymentsConstants.enumCarrier},
+ {CardPaymentsConstants.shipMethod, CardPaymentsConstants.enumShipMethod}
+ };
+
+ ///
+ /// Get the recipientName
+ ///
+ /// string
+ public string recipientName()
+ {
+ return this.getProperty(CardPaymentsConstants.recipientName);
+ }
+
+ ///
+ /// Set the recipientName
+ ///
+ /// void
+ public void recipientName(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recipientName, data);
+ }
+
+ ///
+ /// Get the carrier
+ ///
+ /// List
+ public List carrier()
+ {
+ return this.getProperty(CardPaymentsConstants.carrier);
+ }
+
+ ///
+ /// Set the carrier
+ ///
+ /// void
+ public void carrier(string data)
+ {
+ this.setProperty(CardPaymentsConstants.carrier, data);
+ }
+
+ ///
+ /// Get the shipMethod
+ ///
+ /// string
+ public string shipMethod()
+ {
+ return this.getProperty(CardPaymentsConstants.shipMethod);
+ }
+
+ ///
+ /// Set the shipMethod
+ ///
+ /// void
+ public void shipMethod(string data)
+ {
+ this.setProperty(CardPaymentsConstants.shipMethod, data);
+ }
+
+ ///
+ /// ShippingDetailsBuilder will allow a ShippingDetails to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class ShippingDetailsBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the ShippingDetails builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public ShippingDetailsBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the recipientName
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder recipientName(string data)
+ {
+ this.properties[CardPaymentsConstants.recipientName] = data;
+ return this;
+ }
+
+ ///
+ /// Set the street
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder street(string data)
+ {
+ this.properties[CardPaymentsConstants.street] = data;
+ return this;
+ }
+
+ ///
+ /// Set the street2
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder street2(string data)
+ {
+ this.properties[CardPaymentsConstants.street2] = data;
+ return this;
+ }
+
+ ///
+ /// Set the city
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder city(string data)
+ {
+ this.properties[CardPaymentsConstants.city] = data;
+ return this;
+ }
+
+ ///
+ /// Set the state
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder state(string data)
+ {
+ this.properties[CardPaymentsConstants.state] = data;
+ return this;
+ }
+
+ ///
+ /// Set the country
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder country(string data)
+ {
+ this.properties[CardPaymentsConstants.country] = data;
+ return this;
+ }
+
+ ///
+ /// Set the zip
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder zip(string data)
+ {
+ this.properties[CardPaymentsConstants.zip] = data;
+ return this;
+ }
+
+ ///
+ /// Set the phone
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder phone(string data)
+ {
+ this.properties[CardPaymentsConstants.phone] = data;
+ return this;
+ }
+
+ ///
+ /// Set the carrier
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder carrier(string data)
+ {
+ this.properties[CardPaymentsConstants.carrier] = data;
+ return this;
+ }
+
+ ///
+ /// Set the shipMethod
+ ///
+ /// string
+ /// ShippingDetailsBuilder
+ public ShippingDetailsBuilder shipMethod(string data)
+ {
+ this.properties[CardPaymentsConstants.shipMethod] = data;
+ return this;
+ }
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/Verification.cs b/Paysafe/CardPayments/Verification.cs
new file mode 100644
index 0000000..4c630e8
--- /dev/null
+++ b/Paysafe/CardPayments/Verification.cs
@@ -0,0 +1,571 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class Verification : JSONObject
+ {
+ ///
+ /// Initialize the Verification object with some set of properties
+ ///
+ /// Dictionary
+ public Verification(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ ///
+ /// Initialize a verification object with an id
+ ///
+ ///
+ public Verification(String id)
+ : base(fieldTypes)
+ {
+ this.id(id);
+ }
+
+ ///
+ /// Gets the array key to access the array of verifications
+ ///
+ /// The key to be checked in the returning JSON
+ public static string getPageableArrayKey()
+ {
+ return "verifications";
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.id, STRING_TYPE},
+ {CardPaymentsConstants.merchantRefNum, STRING_TYPE},
+ {CardPaymentsConstants.childAccountNum, STRING_TYPE},
+ {CardPaymentsConstants.card, typeof(Card)},
+ {CardPaymentsConstants.authCode, STRING_TYPE},
+ {CardPaymentsConstants.profile, typeof(Profile)},
+ {CardPaymentsConstants.billingDetails, typeof(BillingDetails)},
+ {CardPaymentsConstants.customerIp, STRING_TYPE},
+ {CardPaymentsConstants.dupCheck, BOOL_TYPE},
+ {CardPaymentsConstants.merchantDescriptor, typeof(MerchantDescriptor)},
+ {CardPaymentsConstants.description, STRING_TYPE},
+ {CardPaymentsConstants.txnTime, typeof(System.DateTime)},
+ {CardPaymentsConstants.currencyCode, STRING_TYPE},
+ {CardPaymentsConstants.avsResponse, CardPaymentsConstants.enumAVSResponse},
+ {CardPaymentsConstants.cvvVerification, CardPaymentsConstants.enumCVVVerification},
+ {CardPaymentsConstants.status, CardPaymentsConstants.enumStatus},
+ {CardPaymentsConstants.riskReasonCode, typeof(List)},
+ {CardPaymentsConstants.acquirerResponse, typeof(AcquirerResponse)},
+ {CardPaymentsConstants.error, typeof(OptError)},
+ {CardPaymentsConstants.links, typeof(List)}
+ };
+
+
+ ///
+ /// Get the id
+ ///
+ /// string
+ public string id()
+ {
+ return this.getProperty(CardPaymentsConstants.id);
+ }
+
+ ///
+ /// Set the id
+ ///
+ /// void
+ public void id(string data)
+ {
+ this.setProperty(CardPaymentsConstants.id, data);
+ }
+
+ ///
+ /// Get the merchantRefNum
+ ///
+ /// string
+ public string merchantRefNum()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantRefNum);
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// void
+ public void merchantRefNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantRefNum, data);
+ }
+
+
+ ///
+ /// Get the childAccountNum
+ ///
+ /// string
+ public string childAccountNum()
+ {
+ return this.getProperty(CardPaymentsConstants.childAccountNum);
+ }
+
+ ///
+ /// Set the childAccountNum
+ ///
+ /// void
+ public void childAccountNum(string data)
+ {
+ this.setProperty(CardPaymentsConstants.childAccountNum, data);
+ }
+
+ ///
+ /// Get the card
+ ///
+ /// Card
+ public Card card()
+ {
+ return this.getProperty(CardPaymentsConstants.card);
+ }
+
+ ///
+ /// Set the card
+ ///
+ /// void
+ public void card(Card data)
+ {
+ this.setProperty(CardPaymentsConstants.card, data);
+ }
+
+
+ ///
+ /// Get the authCode
+ ///
+ /// string
+ public string authCode()
+ {
+ return this.getProperty(CardPaymentsConstants.authCode);
+ }
+
+ ///
+ /// Set the authCode
+ ///
+ /// void
+ public void authCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.authCode, data);
+ }
+
+ ///
+ /// Get the profile
+ ///
+ /// Profile
+ public Profile profile()
+ {
+ return this.getProperty(CardPaymentsConstants.profile);
+
+ }
+
+ ///
+ /// Set the profile
+ ///
+ /// void
+ public void profile(Profile data)
+ {
+ this.setProperty(CardPaymentsConstants.profile, data);
+ }
+
+ ///
+ /// Get the billing details
+ ///
+ /// BillingDetails
+ public BillingDetails billingDetails()
+ {
+ return this.getProperty(CardPaymentsConstants.billingDetails);
+ }
+
+ ///
+ /// Set the billingDetails
+ ///
+ /// void
+ public void billingDetails(BillingDetails data)
+ {
+ this.setProperty(CardPaymentsConstants.billingDetails, data);
+ }
+
+ ///
+ /// Get the customerIp
+ ///
+ /// string
+ public string customerIp()
+ {
+ return this.getProperty(CardPaymentsConstants.customerIp);
+ }
+
+ ///
+ /// Set the customerIp
+ ///
+ /// void
+ public void customerIp(string data)
+ {
+ this.setProperty(CardPaymentsConstants.customerIp, data);
+ }
+
+ ///
+ /// Get the dupCheck
+ ///
+ /// bool
+ public bool dupCheck()
+ {
+ return this.getProperty(CardPaymentsConstants.dupCheck);
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// void
+ public void dupCheck(bool data)
+ {
+ this.setProperty(CardPaymentsConstants.dupCheck, data);
+ }
+
+ ///
+ /// Get the merchantDescriptor
+ ///
+ /// MerchantDescriptor
+ public MerchantDescriptor merchantDescriptor()
+ {
+ return this.getProperty(CardPaymentsConstants.merchantDescriptor);
+ }
+
+ ///
+ /// Set the merchantDescriptor
+ ///
+ /// void
+ public void merchantDescriptor(MerchantDescriptor data)
+ {
+ this.setProperty(CardPaymentsConstants.merchantDescriptor, data);
+ }
+
+ ///
+ /// Get the description
+ ///
+ /// string
+ public string description()
+ {
+ return this.getProperty(CardPaymentsConstants.description);
+ }
+
+ ///
+ /// Set the description
+ ///
+ /// void
+ public void description(string data)
+ {
+ this.setProperty(CardPaymentsConstants.description, data);
+ }
+
+ ///
+ /// Get the txnTime
+ ///
+ /// System.DateTime
+ public System.DateTime txnTime()
+ {
+ return this.getProperty(CardPaymentsConstants.txnTime);
+ }
+
+ ///
+ /// Set the txnTime
+ ///
+ /// void
+ public void txnTime(System.DateTime data)
+ {
+ this.setProperty(CardPaymentsConstants.txnTime, data);
+ }
+
+ ///
+ /// Get the currencyCode
+ ///
+ /// string
+ public string currencyCode()
+ {
+ return this.getProperty(CardPaymentsConstants.currencyCode);
+ }
+
+ ///
+ /// Set the currencyCode
+ ///
+ /// void
+ public void currencyCode(string data)
+ {
+ this.setProperty(CardPaymentsConstants.currencyCode, data);
+ }
+
+ ///
+ /// Get the avsResponse
+ ///
+ /// string
+ public string avsResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.avsResponse);
+ }
+
+ ///
+ /// Set the avsResponse
+ ///
+ /// void
+ public void avsResponse(string data)
+ {
+ this.setProperty(CardPaymentsConstants.avsResponse, data);
+ }
+
+ ///
+ /// Get the cvvVerification
+ ///
+ /// string
+ public string cvvVerification()
+ {
+ return this.getProperty(CardPaymentsConstants.cvvVerification);
+ }
+
+ ///
+ /// Set the cvvVerification
+ ///
+ /// void
+ public void cvvVerification(string data)
+ {
+ this.setProperty(CardPaymentsConstants.cvvVerification, data);
+ }
+
+ ///
+ /// Get the status
+ ///
+ /// string
+ public string status()
+ {
+ return this.getProperty(CardPaymentsConstants.status);
+ }
+
+ ///
+ /// Set the status
+ ///
+ /// void
+ public void status(string data)
+ {
+ this.setProperty(CardPaymentsConstants.status, data);
+ }
+
+ ///
+ /// Get the riskReasonCode
+ ///
+ /// List
+ public List riskReasonCode()
+ {
+ return this.getProperty(CardPaymentsConstants.riskReasonCode);
+ }
+
+ ///
+ /// Set the riskReasonCode
+ ///
+ /// void
+ public void riskReasonCode(List data)
+ {
+ this.setProperty(CardPaymentsConstants.riskReasonCode, data);
+ }
+
+ ///
+ /// Get the acquireResponse
+ ///
+ /// AcquirerResponse
+ public AcquirerResponse acquireResponse()
+ {
+ return this.getProperty(CardPaymentsConstants.acquirerResponse);
+ }
+
+ ///
+ /// Set the acquireResponse
+ ///
+ /// void
+ public void acquireResponse(AcquirerResponse data)
+ {
+ this.setProperty(CardPaymentsConstants.acquirerResponse, data);
+ }
+
+ ///
+ /// Get the error
+ ///
+ /// OptError
+ public OptError error()
+ {
+ return this.getProperty(CardPaymentsConstants.error);
+ }
+
+ ///
+ /// Set the error
+ ///
+ /// void
+ public void error(OptError data)
+ {
+ this.setProperty(CardPaymentsConstants.error, data);
+ }
+
+ ///
+ /// Get the links
+ ///
+ /// List
+ public List links()
+ {
+ return this.getProperty(CardPaymentsConstants.links);
+ }
+
+ ///
+ /// Set the links
+ ///
+ /// void
+ public void links(List data)
+ {
+ this.setProperty(CardPaymentsConstants.links, data);
+ }
+
+ ///
+ /// Get a new VerificationBuilder
+ ///
+ /// VerificationBuilder
+ public static VerificationBuilder Builder()
+ {
+ return new VerificationBuilder();
+ }
+
+ ///
+ /// VerificationBuilder will allow an Verification to be initialized.
+ /// set all properties and subpropeties, then trigger .Build() to
+ /// get the generated Verification object
+ ///
+ public class VerificationBuilder : BaseJSONBuilder
+ {
+ ///
+ /// Set the id
+ ///
+ /// string
+ /// VerificationBuilder
+ public VerificationBuilder id(string data)
+ {
+ this.properties[CardPaymentsConstants.id] = data;
+ return this;
+ }
+
+ ///
+ /// Set the merchantRefNum
+ ///
+ /// string
+ /// VerificationBuilder
+ public VerificationBuilder merchantRefNum(string data)
+ {
+ this.properties[CardPaymentsConstants.merchantRefNum] = data;
+ return this;
+ }
+
+ ///
+ /// Build a card object within this Verification.
+ ///
+ /// Profile.profileBuilder
+ public Card.CardBuilder card()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.card))
+ {
+ this.properties[CardPaymentsConstants.card] = new Card.CardBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.card] as Card.CardBuilder;
+ }
+
+ ///
+ /// Set the dupCheck
+ ///
+ /// bool
+ /// VerificationBuilder
+ public VerificationBuilder dupCheck(bool data)
+ {
+ this.properties[CardPaymentsConstants.dupCheck] = data;
+ return this;
+ }
+
+ ///
+ /// Build a profile object within this Verification.
+ ///
+ /// Profile.profileBuilder
+ public Profile.ProfileBuilder profile()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.profile))
+ {
+ this.properties[CardPaymentsConstants.profile] = new Profile.ProfileBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.profile] as Profile.ProfileBuilder;
+ }
+
+ ///
+ /// Build a billing details object within this Verification.
+ ///
+ /// BillingDetails.BillingDetailsBuilder
+ public BillingDetails.BillingDetailsBuilder billingDetails()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.billingDetails))
+ {
+ this.properties[CardPaymentsConstants.billingDetails] = new BillingDetails.BillingDetailsBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.billingDetails] as BillingDetails.BillingDetailsBuilder;
+ }
+
+ ///
+ /// Set the customerIp
+ ///
+ /// string
+ /// VerificationBuilder
+ public VerificationBuilder customerIp(string data)
+ {
+ this.properties[CardPaymentsConstants.customerIp] = data;
+ return this;
+ }
+
+ ///
+ /// Build a merchant descriptor object within this Verification.
+ ///
+ /// MerchantDescriptor.MerchantDescriptorBuilder
+ public MerchantDescriptor.MerchantDescriptorBuilder merchantDescriptor()
+ {
+ if (!this.properties.ContainsKey(CardPaymentsConstants.merchantDescriptor))
+ {
+ this.properties[CardPaymentsConstants.merchantDescriptor] = new MerchantDescriptor.MerchantDescriptorBuilder(this);
+ }
+ return this.properties[CardPaymentsConstants.merchantDescriptor] as MerchantDescriptor.MerchantDescriptorBuilder;
+ }
+
+ ///
+ /// Set the description
+ ///
+ /// string
+ /// VerificationBuilder
+ public VerificationBuilder description(string data)
+ {
+ this.properties[CardPaymentsConstants.description] = data;
+ return this;
+ }
+
+ }
+ }
+}
diff --git a/Paysafe/CardPayments/VisaAdditionalAuthData.cs b/Paysafe/CardPayments/VisaAdditionalAuthData.cs
new file mode 100644
index 0000000..dc3a4db
--- /dev/null
+++ b/Paysafe/CardPayments/VisaAdditionalAuthData.cs
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Paysafe.Common;
+
+namespace Paysafe.CardPayments
+{
+ public class VisaAdditionalAuthData : JSONObject
+ {
+ ///
+ /// Initialize the VisaAdditionalAuthData object with some set of properties
+ ///
+ /// Dictionary
+ public VisaAdditionalAuthData(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CardPaymentsConstants.recipientDateOfBirth, typeof(RecipientDateOfBirth)},
+ {CardPaymentsConstants.recipientZip, STRING_TYPE},
+ {CardPaymentsConstants.recipientLastName, STRING_TYPE},
+ {CardPaymentsConstants.recipientAccountNumber, STRING_TYPE}
+ };
+
+ ///
+ /// Get the recipientDateOfBirth
+ ///
+ /// string
+ public string recipientDateOfBirth()
+ {
+ return this.getProperty(CardPaymentsConstants.recipientDateOfBirth);
+ }
+
+ ///
+ /// Set the recipientDateOfBirth
+ ///
+ /// void
+ public void recipientDateOfBirth(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recipientDateOfBirth, data);
+ }
+
+ ///
+ /// Get the recipientZip
+ ///
+ /// string
+ public string recipientZip()
+ {
+ return this.getProperty(CardPaymentsConstants.recipientZip);
+ }
+
+ ///
+ /// Set the recipientZip
+ ///
+ /// void
+ public void recipientZip(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recipientZip, data);
+ }
+
+ ///
+ /// Get the recipientLastName
+ ///
+ /// string
+ public string recipientLastName()
+ {
+ return this.getProperty(CardPaymentsConstants.recipientLastName);
+ }
+
+ ///
+ /// Set the recipientLastName
+ ///
+ /// void
+ public void recipientLastName(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recipientLastName, data);
+ }
+
+ ///
+ /// Get the recipientAccountNumber
+ ///
+ /// string
+ public string recipientAccountNumbere()
+ {
+ return this.getProperty(CardPaymentsConstants.recipientAccountNumber);
+ }
+
+ ///
+ /// Set the recipientAccountNumber
+ ///
+ /// void
+ public void recipientAccountNumber(string data)
+ {
+ this.setProperty(CardPaymentsConstants.recipientAccountNumber, data);
+ }
+ }
+}
diff --git a/Paysafe/Common/APIException.cs b/Paysafe/Common/APIException.cs
new file mode 100644
index 0000000..6753e96
--- /dev/null
+++ b/Paysafe/Common/APIException.cs
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.Common
+{
+ public class APIException : PaysafeException
+ {
+ public APIException()
+ : base()
+ {
+
+ }
+
+ public APIException(string message)
+ : base(message)
+ {
+
+ }
+
+ public APIException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+
+ }
+ }
+}
diff --git a/Paysafe/Common/AbstractPagerator.cs b/Paysafe/Common/AbstractPagerator.cs
new file mode 100644
index 0000000..14f5b77
--- /dev/null
+++ b/Paysafe/Common/AbstractPagerator.cs
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+//Modified by Manjiri.Bankar on 02.08.2016. This is Pagerator class.
+namespace Paysafe.Common
+{
+ public abstract class AbstractPagerator : IEnumerable
+ {
+
+ ///
+ /// The result set so far retrieved
+ ///
+ protected List results = new List();
+
+ ///
+ /// The key in the returned array to be added to the resutl set
+ ///
+ protected string arrayKey = null;
+
+ ///
+ /// The type to instantiate
+ ///
+ protected Type classType;
+
+ ///
+ /// The url to the next page, if we haven't yet retrieved all results
+ ///
+ protected String nextPage = null;
+
+ ///
+ /// The url to the self page
+ ///
+ protected String selfPage = null;
+
+ ///
+ /// The url to the previous page
+ ///
+ protected String previousPage = null;
+
+ ///
+ /// The client
+ ///
+ protected PaysafeApiClient client = null;
+
+
+ public AbstractPagerator(PaysafeApiClient apiClient, Type pagingClassType)
+ {
+ this.arrayKey = pagingClassType.GetMethod("getPageableArrayKey").Invoke(null, null) as string;
+
+ this.client = apiClient;
+ this.classType = pagingClassType;
+ }
+
+ ///
+ /// Get the current set of elements
+ ///
+ /// List
+ public List getResults()
+ {
+ return this.results;
+ }
+
+ ///
+ /// Used by PageratorEnumerator to get result
+ ///
+ ///
+ ///
+ protected T get(int index)
+ {
+ return this.results.ElementAt(index);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ ///
+ /// Implemented to extended IEnumerable
+ ///
+ ///
+ public IEnumerator GetEnumerator()
+ {
+ return new PageratorEnumerator(this.classType, this);
+ }
+
+
+ protected abstract void parseResponse(Dictionary data);
+
+ public class PageratorEnumerator : IEnumerator
+ {
+ AbstractPagerator parent = null;
+
+ private int position = -1;
+
+ public PageratorEnumerator(Type classType, AbstractPagerator parent)
+ {
+ this.parent = parent;
+ }
+
+ public bool MoveNext()
+ {
+ this.position++;
+ if (this.parent.results.Count >= this.position && !String.IsNullOrWhiteSpace(this.parent.nextPage))
+ {
+ Request request = new Request(url: this.parent.nextPage);
+ this.parent.parseResponse(this.parent.client.processRequest(request));
+ }
+ return this.position < this.parent.results.Count;
+ }
+
+ public void Reset()
+ {
+ position = -1;
+ }
+
+ object IEnumerator.Current
+ {
+ get
+ {
+ return Current;
+ }
+ }
+
+ public T Current
+ {
+ get
+ {
+ return this.parent.get(position);
+ }
+ }
+ }
+ }
+}
diff --git a/Paysafe/Common/AddressDetails.cs b/Paysafe/Common/AddressDetails.cs
new file mode 100644
index 0000000..18a6152
--- /dev/null
+++ b/Paysafe/Common/AddressDetails.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.Common
+{
+ public abstract class AddressDetails: JSONObject
+ {
+ ///
+ /// Initialize the BillingDetails object with some set of properties
+ ///
+ /// Dictionary
+ public AddressDetails(Dictionary fieldTypes , Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+
+ }
+
+ ///
+ /// This object is used to validate any properties set within the object
+ ///
+ protected static Dictionary addressFieldTypes = new Dictionary
+ {
+ {CommonConstants.street, STRING_TYPE},
+ {CommonConstants.street2, STRING_TYPE},
+ {CommonConstants.city, STRING_TYPE},
+ {CommonConstants.state, STRING_TYPE},
+ {CommonConstants.country, STRING_TYPE},
+ {CommonConstants.zip, STRING_TYPE},
+ {CommonConstants.phone, STRING_TYPE}
+ };
+
+ ///
+ /// Get the street
+ ///
+ /// string
+ public string street()
+ {
+ return this.getProperty(CommonConstants.street);
+ }
+
+ ///
+ /// Set the street
+ ///
+ /// void
+ public void street(string data)
+ {
+ this.setProperty(CommonConstants.street, data);
+ }
+
+ ///
+ /// Get the street2
+ ///
+ /// string
+ public string street2()
+ {
+ return this.getProperty(CommonConstants.street2);
+ }
+
+ ///
+ /// Set the street2
+ ///
+ /// void
+ public void street2(string data)
+ {
+ this.setProperty(CommonConstants.street2, data);
+ }
+
+ ///
+ /// Get the city
+ ///
+ /// string
+ public string city()
+ {
+ return this.getProperty(CommonConstants.city);
+ }
+
+ ///
+ /// Set the city
+ ///
+ /// void
+ public void city(string data)
+ {
+ this.setProperty(CommonConstants.city, data);
+ }
+
+ ///
+ /// Get the state
+ ///
+ /// string
+ public string state()
+ {
+ return this.getProperty(CommonConstants.state);
+ }
+
+ ///
+ /// Set the state
+ ///
+ /// void
+ public void state(string data)
+ {
+ this.setProperty(CommonConstants.state, data);
+ }
+
+ ///
+ /// Get the country
+ ///
+ /// string
+ public string country()
+ {
+ return this.getProperty(CommonConstants.country);
+ }
+
+ ///
+ /// Set the country
+ ///
+ /// void
+ public void country(string data)
+ {
+ this.setProperty(CommonConstants.country, data);
+ }
+
+ ///
+ /// Get the zip
+ ///
+ /// string
+ public string zip()
+ {
+ return this.getProperty(CommonConstants.zip);
+ }
+
+ ///
+ /// Set the zip
+ ///
+ /// void
+ public void zip(string data)
+ {
+ this.setProperty(CommonConstants.zip, data);
+ }
+
+ ///
+ /// Get the phone
+ ///
+ /// string
+ public string phone()
+ {
+ return this.getProperty(CommonConstants.phone);
+ }
+
+ ///
+ /// Set the phone
+ ///
+ /// void
+ public void phone(string data)
+ {
+ this.setProperty(CommonConstants.phone, data);
+ }
+ }
+}
diff --git a/Paysafe/Common/BaseJSONBuilder.cs b/Paysafe/Common/BaseJSONBuilder.cs
new file mode 100644
index 0000000..ddb16e4
--- /dev/null
+++ b/Paysafe/Common/BaseJSONBuilder.cs
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.Common
+{
+ public abstract class BaseJSONBuilder : GenericJSONBuilder
+ where TRTN : JSONObject
+ {
+ ///
+ /// Build the final object of type RTN
+ ///
+ /// RTN
+ public TRTN Build()
+ {
+ Object[] args = { this.properties };
+ return Activator.CreateInstance(typeof(TRTN), args) as TRTN;
+ }
+ }
+}
diff --git a/Paysafe/Common/CardExpiry.cs b/Paysafe/Common/CardExpiry.cs
new file mode 100644
index 0000000..eaed203
--- /dev/null
+++ b/Paysafe/Common/CardExpiry.cs
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014 Optimal Payments
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Paysafe.Common
+{
+ public class CardExpiry : Paysafe.Common.JSONObject
+ {
+ ///
+ /// Initialize the CardExpiry object with some set of properties
+ ///
+ /// Dictionary
+ public CardExpiry(Dictionary properties = null)
+ : base(fieldTypes, properties)
+ {
+ }
+
+ private static new Dictionary fieldTypes = new Dictionary
+ {
+ {CommonConstants.month, INT_TYPE},
+ {CommonConstants.year, INT_TYPE}
+ };
+
+ ///
+ /// Get the month
+ ///
+ /// int
+ public int month()
+ {
+ return this.getProperty(CommonConstants.month);
+ }
+
+ ///
+ /// Set the month
+ ///
+ /// void
+ public void month(int data)
+ {
+ this.setProperty(CommonConstants.month, data);
+ }
+
+ ///
+ /// Get the year
+ ///
+ /// int
+ public int year()
+ {
+ return this.getProperty(CommonConstants.year);
+ }
+
+ ///
+ /// Set the year
+ ///
+ /// void
+ public void year(int data)
+ {
+ this.setProperty(CommonConstants.year, data);
+ }
+
+ ///
+ /// CardExpiryBuilder will allow a CardExpiry to be initialized
+ /// within another builder. Set properties and subpropeties, then trigger .Done() to
+ /// get back to the parent builder
+ ///
+ public class CardExpiryBuilder : NestedJSONBuilder
+ where TBLDR : GenericJSONBuilder
+ {
+ ///
+ /// Initialize the CardExpiry builder within the context of a parent builder
+ ///
+ /// TBLDR
+ public CardExpiryBuilder(TBLDR parent)
+ : base(parent)
+ {
+ this.parent = parent;
+ }
+
+ ///
+ /// Set the month
+ ///
+ /// int
+ /// CardExpiryBuilder