-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hpreslier/master
Thanks Heather, all the very best of luck for next year. Thanks again for all the code :-)
- Loading branch information
Showing
9 changed files
with
226 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,54 @@ | |
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using AuthorizeNet.Api.Contracts.V1; | ||
using AuthorizeNet.Api.Controllers; | ||
using AuthorizeNet.Api.Controllers.Bases; | ||
|
||
namespace net.authorize.sample | ||
{ | ||
class UpdateCustomerProfile | ||
{ | ||
public static void Run(String ApiLoginID, String ApiTransactionKey) | ||
{ | ||
Console.WriteLine("Update customer profile sample"); | ||
|
||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; | ||
// define the merchant information (authentication / transaction id) | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType() | ||
{ | ||
name = ApiLoginID, | ||
ItemElementName = ItemChoiceType.transactionKey, | ||
Item = ApiTransactionKey, | ||
}; | ||
|
||
var profile = new customerProfileExType | ||
{ | ||
merchantCustomerId = "custId123", | ||
description = "some description", | ||
email = "[email protected]", | ||
customerProfileId = "36605093" | ||
}; | ||
|
||
var request = new updateCustomerProfileRequest(); | ||
request.profile = profile; | ||
|
||
// instantiate the controller that will call the service | ||
var controller = new updateCustomerProfileController(request); | ||
controller.Execute(); | ||
|
||
// get the response from the service (errors contained if any) | ||
var response = controller.GetApiResponse(); | ||
|
||
if (response.messages.resultCode == messageTypeEnum.Ok) | ||
{ | ||
Console.WriteLine(response.messages.message[0].text); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Error: " + response.messages.message[0].code + " " + | ||
response.messages.message[0].text); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.