Skip to content

Commit c410932

Browse files
authored
Merge branch 'dotnet-core' into master
2 parents 1ffa57a + 3187ad0 commit c410932

29 files changed

+9857
-124
lines changed

AuthorizeNet.dll

219 KB
Binary file not shown.

AuthorizeNet.xml

+9,637
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CustomerProfiles/CreateCustomerProfile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static ANetApiResponse Run(string ApiLoginID, string ApiTransactionKey, s
2626
var creditCard = new creditCardType
2727
{
2828
cardNumber = "4111111111111111",
29-
expirationDate = "0718"
29+
expirationDate = "1018"
3030
};
3131

3232
var bankAccount = new bankAccountType

CustomerProfiles/GetCustomerProfile.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, s
2525
Item = ApiTransactionKey,
2626
};
2727

28-
var request = new getCustomerProfileRequest();
28+
var request = new getCustomerProfileRequest();
2929
request.customerProfileId = customerProfileId;
3030

3131
// instantiate the controller that will call the service
3232
var controller = new getCustomerProfileController(request);
33-
controller.Execute();
33+
controller.Execute();
3434

3535
// get the response from the service (errors contained if any)
3636
var response = controller.GetApiResponse();

CustomerProfiles/UpdateCustomerPaymentProfile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, s
2727
var creditCard = new creditCardType
2828
{
2929
cardNumber = "4111111111111111",
30-
expirationDate = "0718"
30+
expirationDate = "1018"
3131
};
3232

3333
//===========================================================================

CustomerProfiles/UpdateCustomerShippingAddress.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, s
2727
var creditCard = new creditCardType
2828
{
2929
cardNumber = "4111111111111111",
30-
expirationDate = "0718"
30+
expirationDate = "1018"
3131
};
3232

3333
var paymentType = new paymentType { Item = creditCard };

FraudManagement/ApproveOrDeclineHeldTransaction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)
2929
request.heldTransactionRequest = new heldTransactionRequestType
3030
{
3131
action = afdsTransactionEnum.approve,
32-
refTransId = "60012192922"
32+
refTransId = "60108066607"
3333
};
3434

3535
// instantiate the controller that will call the service

PaymentTransactions/AuthorizeCreditCard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, d
2727
var creditCard = new creditCardType
2828
{
2929
cardNumber = "4111111111111111",
30-
expirationDate = "0718"
30+
expirationDate = "1018"
3131
};
3232

3333
//standard api call to retrieve response

PaymentTransactions/CaptureFundsAuthorizedThroughAnotherChannel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, d
2929
{
3030
// Change the cardNumber and expiration Date as required
3131
cardNumber = "4111111111111111",
32-
expirationDate = "0718"
32+
expirationDate = "1018"
3333
};
3434

3535
//standard api call to retrieve response

PaymentTransactions/ChargeCreditCard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, d
2828
var creditCard = new creditCardType
2929
{
3030
cardNumber = "4111111111111111",
31-
expirationDate = "0718",
31+
expirationDate = "1018",
3232
cardCode = "123"
3333
};
3434

PaymentTransactions/ChargeTokenizedCreditCard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)
2828
var creditCard = new creditCardType
2929
{
3030
cardNumber = "4111111111111111",
31-
expirationDate = "0718",
31+
expirationDate = "1018",
3232
// Set the token specific info
3333
isPaymentToken = true,
3434
cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA=" // Set this to the value of the cryptogram received from the token provide

PaymentTransactions/DebitBankAccount.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, d
2424
Item = ApiTransactionKey
2525
};
2626

27+
Random rand = new Random();
28+
int randomAccountNumber = rand.Next(10000, int.MaxValue);
29+
2730
var bankAccount = new bankAccountType
2831
{
2932
accountType = bankAccountTypeEnum.checking,
30-
routingNumber = "125000105",
31-
accountNumber = "1234567890",
33+
routingNumber = "125008547",
34+
accountNumber = randomAccountNumber.ToString(),
3235
nameOnAccount = "John Doe",
3336
echeckType = echeckTypeEnum.WEB, // change based on how you take the payment (web, telephone, etc)
3437
bankName = "Wells Fargo Bank NA",
3538
// checkNumber = "101" // needed if echeckType is "ARC" or "BOC"
3639
};
37-
3840
// standard api call to retrieve response
3941
var paymentType = new paymentType { Item = bankAccount };
4042

Properties/AssemblyInfo.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("SampleCode")]
9-
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyDescription("0.9.0.0")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Microsoft")]
1212
[assembly: AssemblyProduct("SampleCode")]
@@ -32,5 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("0.9.0.0")]
36+
[assembly: AssemblyFileVersion("0.9.0.0")]
37+

RecurringBilling/CreateSubscription.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, s
4040
var creditCard = new creditCardType
4141
{
4242
cardNumber = "4111111111111111",
43-
expirationDate = "0718"
43+
expirationDate = "1018"
4444
};
4545

4646
//standard api call to retrieve response

RecurringBilling/CreateSubscriptionFromCustomerProfile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, s
4141
var creditCard = new creditCardType
4242
{
4343
cardNumber = "4111111111111111",
44-
expirationDate = "0718"
44+
expirationDate = "1018"
4545
};
4646

4747
//standard api call to retrieve response

RecurringBilling/UpdateSubscription.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static ANetApiResponse Run(string ApiLoginID, string ApiTransactionKey, s
3232
var creditCard = new creditCardType
3333
{
3434
cardNumber = "4111111111111111",
35-
expirationDate = "0718"
35+
expirationDate = "1018"
3636
};
3737

3838
//standard api call to retrieve response

SampleCode.cs

+37-18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
using System.Text;
77
using System.Threading.Tasks;
88
using net.authorize.sample.CustomerProfiles;
9+
using AuthorizeNet.Api.Controllers.Bases;
10+
using AuthorizeNet.Api.Contracts.V1;
11+
#if NETCOREAPP2_0
12+
using AuthorizeNet.Utilities;
13+
#endif
914

1015
namespace net.authorize.sample
1116
{
@@ -38,7 +43,7 @@ static void Main(string[] args)
3843
Console.WriteLine("");
3944
Console.Write("Press <Return> to finish ...");
4045
Console.ReadLine();
41-
46+
4247
}
4348

4449
private static void ShowUsage()
@@ -65,7 +70,7 @@ private static void SelectMethod()
6570

6671
private static void ShowMethods()
6772
{
68-
73+
6974
Console.WriteLine(" ChargeCreditCard");
7075
Console.WriteLine(" AuthorizeCreditCard");
7176
Console.WriteLine(" CapturePreviouslyAuthorizedAmount");
@@ -146,14 +151,34 @@ private static void RunMethod(String methodName)
146151
//Update PayerID for which you want to run the sample code
147152
const string payerId = "M8R9JRNJ3R28Y";
148153

149-
const string customerProfileId = "213213";
150-
const string customerPaymentProfileId = "2132345";
154+
const string customerProfileId = "1915435550"; //"213213";
155+
const string customerPaymentProfileId = "1828811149"; //"2132345";
156+
151157
const string shippingAddressId = "1223213";
152158
const decimal amount = 12.34m;
153159
const string subscriptionId = "1223213";
154160
const short day = 45;
155161
const string emailId = "[email protected]";
156162

163+
#if NETCOREAPP2_0
164+
// DOTNET CORE SPECIFIC
165+
#region DOTNET CORE SPECIFIC
166+
167+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
168+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpUseProxy = AuthorizeNet.Environment.getBooleanProperty(Constants.HttpsUseProxy);
169+
170+
if (ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpUseProxy)
171+
{
172+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpUseProxy = AuthorizeNet.Environment.getBooleanProperty(Constants.HttpsUseProxy);
173+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpsProxyUsername = AuthorizeNet.Environment.GetProperty(Constants.HttpsProxyUsername);
174+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpsProxyPassword = AuthorizeNet.Environment.GetProperty(Constants.HttpsProxyPassword);
175+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpProxyHost = AuthorizeNet.Environment.GetProperty(Constants.HttpsProxyHost);
176+
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment.HttpProxyPort = AuthorizeNet.Environment.getIntProperty(Constants.HttpsProxyPort);
177+
}
178+
179+
#endregion
180+
#endif
181+
157182
switch (methodName)
158183
{
159184
case "ValidateCustomerPaymentProfile":
@@ -264,7 +289,7 @@ private static void RunMethod(String methodName)
264289
case "PayPalAuthorizeCapture":
265290
PayPalAuthorizeCapture.Run(apiLoginId, transactionKey, amount);
266291
break;
267-
case "PayPalAuthorizeCaptureContinued":
292+
case "PayPalAuthorizeCaptureContinued":
268293
PayPalAuthorizeCaptureContinued.Run(apiLoginId, transactionKey, transactionId, payerId);
269294
break;
270295
case "PayPalAuthorizeOnly":
@@ -289,7 +314,7 @@ private static void RunMethod(String methodName)
289314
CreateSubscription.Run(apiLoginId, transactionKey, day);
290315
break;
291316
case "CreateSubscriptionFromCustomerProfile":
292-
CreateSubscriptionFromCustomerProfile.Run(apiLoginId, transactionKey, day, "12322","232321","123232");
317+
CreateSubscriptionFromCustomerProfile.Run(apiLoginId, transactionKey, day, "12322", "232321", "123232");
293318
break;
294319
case "GetListOfSubscriptions":
295320
GetListOfSubscriptions.Run(apiLoginId, transactionKey);
@@ -316,29 +341,23 @@ private static void RunMethod(String methodName)
316341
GetBatchStatistics.Run(apiLoginId, transactionKey);
317342
break;
318343
case "GetSettledBatchList":
319-
GetSettledBatchList.Run(apiLoginId,transactionKey);
320-
break;
344+
GetSettledBatchList.Run(apiLoginId, transactionKey);
345+
break;
321346
case "UpdateSplitTenderGroup":
322-
UpdateSplitTenderGroup.Run(apiLoginId, transactionKey);
323-
break;
347+
UpdateSplitTenderGroup.Run(apiLoginId, transactionKey);
348+
break;
324349
case "GetHeldTransactionList":
325350
GetHeldTransactionList.Run(apiLoginId, transactionKey);
326351
break;
327352
case "ApproveOrDeclineHeldTransaction":
328353
ApproveOrDeclineHeldTransaction.Run(apiLoginId, transactionKey);
329354
break;
330355
case "GetMerchantDetails":
331-
GetMerchantDetails.Run(apiLoginId, transactionKey);
332-
break;
356+
GetMerchantDetails.Run(apiLoginId, transactionKey);
357+
break;
333358
case "GetAnAcceptPaymentPage":
334359
GetAnAcceptPaymentPage.Run(apiLoginId, transactionKey, 12.23m);
335360
break;
336-
case "GetCustomerProfileTransactionList":
337-
GetCustomerProfileTransactionList.Run(apiLoginId, transactionKey, customerProfileId);
338-
break;
339-
//case "GetAccountUpdaterJobSummary":
340-
// GetAccountUpdaterJobSummary.Run(apiLoginId, transactionKey);
341-
// break;
342361
default:
343362
ShowUsage();
344363
break;

SampleCode.csproj

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</PropertyGroup>
3737
<ItemGroup>
3838
<Reference Include="AuthorizeNet">
39-
<HintPath>packages\AuthorizeNet.1.9.4\lib\AuthorizeNet.dll</HintPath>
39+
<HintPath>packages\AuthorizeNet.1.9.6\lib\AuthorizeNet.dll</HintPath>
4040
</Reference>
4141
<Reference Include="System" />
4242
<Reference Include="System.Core" />
@@ -78,7 +78,8 @@
7878
<Compile Include="PaymentTransactions\ChargeTrackData.cs" />
7979
<Compile Include="PaymentTransactions\ChargeEncryptedTrackData.cs" />
8080
<Compile Include="PaymentTransactions\ChargeTokenizedCreditCard.cs" />
81-
<Compile Include="PaymentTransactions\CreditBankAccount.cs" />
81+
<Compile Include="PaymentTransactions\CreditBankAccount.cs" />
82+
<Compile Include="PaymentTransactions\CreateAnAcceptPaymentTransaction.cs" />
8283
<Compile Include="PaymentTransactions\DebitBankAccount.cs" />
8384
<Compile Include="PaymentTransactions\RefundTransaction.cs" />
8485
<Compile Include="PaymentTransactions\UpdateSplitTenderGroup.cs" />
@@ -99,6 +100,8 @@
99100
<Compile Include="RecurringBilling\GetSubscriptionStatus.cs" />
100101
<Compile Include="RecurringBilling\UpdateSubscription.cs" />
101102
<Compile Include="SampleCode.cs" />
103+
<Compile Include="TransactionReporting\GetAccountUpdaterJobDetails.cs" />
104+
<Compile Include="TransactionReporting\GetAccountUpdaterJobSummary.cs" />
102105
<Compile Include="TransactionReporting\GetBatchStatistics.cs" />
103106
<Compile Include="TransactionReporting\GetMerchantDetails.cs" />
104107
<Compile Include="TransactionReporting\GetSettledBatchList.cs" />
@@ -123,4 +126,4 @@
123126
<Target Name="AfterBuild">
124127
</Target>
125128
-->
126-
</Project>
129+
</Project>

SampleCode.exe

96 KB
Binary file not shown.

SampleCode.exe.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5+
</startup>
6+
</configuration>

SampleCode.vshost.exe

22.2 KB
Binary file not shown.

SampleCode.vshost.exe.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5+
</startup>
6+
</configuration>

SampleCodeTest/Properties/AssemblyInfo.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
36+
[assembly: AssemblyVersion("0.9.0.0")]
37+
[assembly: AssemblyFileVersion("0.9.0.0")]
38+
39+

SampleCodeTest/SampleCodeList.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
SampleCode IsDependent RunApi
2-
CreateSubscription 1 1
32
CreateSubscriptionFromCustomerProfile 1 1
43
GetCustomerPaymentProfileList 0 1
54
GetTransactionList 0 1
@@ -55,4 +54,4 @@ CreateCustomerPaymentProfile 1 1
5554
GetMerchantDetails 0 1
5655
GetAnAcceptPaymentPage 1 1
5756
UpdateHeldTransaction 1 0
58-
GetAccountUpdaterJobSummary 1 0
57+
GetAccountUpdaterJobSummary 1 0

0 commit comments

Comments
 (0)