public AuthorizeNet.APICore.getCustomerProfileResponse GetCustomerProfile(long profileId) { AuthorizeNet.APICore.getCustomerProfileRequest req = new AuthorizeNet.APICore.getCustomerProfileRequest(); req.customerProfileId = profileId.ToString(); AuthorizeNet.HttpXmlUtility util = new AuthorizeNet.HttpXmlUtility(ServiceMode, MerchantAuthenticationType.name, MerchantAuthenticationType.transactionKey); return (AuthorizeNet.APICore.getCustomerProfileResponse)util.Send(req); }
public long CreateCustomerProfile(string email, string description,out AuthorizeNet.APICore.messagesType messages) { long result = 0; string profileId = "0"; AuthorizeNet.APICore.customerProfileType profile = new AuthorizeNet.APICore.customerProfileType(); profile.email = email; profile.description = description; AuthorizeNet.APICore.createCustomerProfileRequest req = new AuthorizeNet.APICore.createCustomerProfileRequest(); req.profile = profile; AuthorizeNet.HttpXmlUtility util = new AuthorizeNet.HttpXmlUtility(ServiceMode, MerchantAuthenticationType.name, MerchantAuthenticationType.transactionKey); AuthorizeNet.APICore.createCustomerProfileResponse response = null; try { response = (AuthorizeNet.APICore.createCustomerProfileResponse)util.Send(req); long.TryParse(response.customerProfileId, out result); } catch (System.InvalidOperationException ex) { if (ex.Message.Contains(DUPLICATE_PROFILE_MESSAGE)) { profileId = ex.Message.Replace(DUPLICATE_PROFILE_MESSAGE, String.Empty).Replace(" already exists.", String.Empty); long.TryParse(profileId, out result); } } messages = response.messages; return result; }
/// <summary> /// Initializes a new instance of the <see cref="CustomerGateway"/> class. /// </summary> /// <param name="apiLogin">The API login.</param> /// <param name="transactionKey">The transaction key.</param> /// <param name="mode">Test or Live.</param> public ReportingGateway(string apiLogin, string transactionKey, ServiceMode mode) { if (mode == ServiceMode.Live) { _gateway = new HttpXmlUtility(ServiceMode.Live, apiLogin, transactionKey); } else { _gateway = new HttpXmlUtility(ServiceMode.Test, apiLogin, transactionKey); } }
/// <summary> /// Initializes a new instance of the <see cref="CustomerGateway"/> class. /// </summary> /// <param name="apiLogin">The API login.</param> /// <param name="transactionKey">The transaction key.</param> /// <param name="mode">Test or Live.</param> public CustomerGateway(string apiLogin, string transactionKey, ServiceMode mode) { if (mode == ServiceMode.Live) { _gateway = new HttpXmlUtility(ServiceMode.Live, apiLogin, transactionKey); _mode = validationModeEnum.liveMode; } else { _gateway = new HttpXmlUtility(ServiceMode.Test, apiLogin, transactionKey); _mode = validationModeEnum.testMode; } }
public AuthorizeNet.APICore.createCustomerProfileTransactionResponse CreateProfileTransaction(AuthorizeNet.APICore.profileTransactionType transaction) { AuthorizeNet.APICore.createCustomerProfileTransactionRequest req = new AuthorizeNet.APICore.createCustomerProfileTransactionRequest(); req.transaction = transaction; req.merchantAuthentication = MerchantAuthenticationType; AuthorizeNet.HttpXmlUtility util = new AuthorizeNet.HttpXmlUtility(ServiceMode, MerchantAuthenticationType.name, MerchantAuthenticationType.transactionKey); return (AuthorizeNet.APICore.createCustomerProfileTransactionResponse)util.Send(req); }
public AuthorizeNet.APICore.ARBCancelSubscriptionResponse CancelSubscription(long subscriptionId) { AuthorizeNet.APICore.ARBCancelSubscriptionRequest req = new AuthorizeNet.APICore.ARBCancelSubscriptionRequest(); req.subscriptionId = subscriptionId.ToString(); AuthorizeNet.HttpXmlUtility util = new AuthorizeNet.HttpXmlUtility(ServiceMode, MerchantAuthenticationType.name, MerchantAuthenticationType.transactionKey); return (AuthorizeNet.APICore.ARBCancelSubscriptionResponse)util.Send(req); }
public AuthorizeNet.APICore.ARBCreateSubscriptionResponse CreateARBSubscription(AuthorizeNet.APICore.ARBSubscriptionType subscription) { AuthorizeNet.APICore.ARBCreateSubscriptionRequest req = new AuthorizeNet.APICore.ARBCreateSubscriptionRequest(); req.subscription = subscription; AuthorizeNet.HttpXmlUtility util = new AuthorizeNet.HttpXmlUtility(ServiceMode, MerchantAuthenticationType.name, MerchantAuthenticationType.transactionKey); return (AuthorizeNet.APICore.ARBCreateSubscriptionResponse)util.Send(req); }