/// <summary> /// Returns batch settlements for the specified date range /// </summary> public List <Batch> GetSettledBatchList(DateTime from, DateTime to) { var req = new getSettledBatchListRequest(); req.firstSettlementDate = from; req.lastSettlementDate = to; req.includeStatistics = true; var response = (getSettledBatchListResponse)_gateway.Send(req); return(Batch.NewFromResponse(response)); }
/// <summary> /// Creates a new subscription /// </summary> /// <param name="subscription">The subscription to create - requires that you add a credit card and billing first and last.</param> public ISubscriptionRequest CreateSubscription(ISubscriptionRequest subscription) { var sub = subscription.ToAPI(); var req = new ARBCreateSubscriptionRequest(); req.subscription = sub; var response = (ARBCreateSubscriptionResponse)_gateway.Send(req); subscription.SubscriptionID = response.subscriptionId; return(subscription); }
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; }
public Customer CreateCustomer(string email, string description, string merchantCustomerId) { //use the XSD class to create the profile var newCustomer = new customerProfileType(); newCustomer.description = description; newCustomer.email = email; newCustomer.merchantCustomerId = merchantCustomerId; var req = new createCustomerProfileRequest(); req.profile = newCustomer; //serialize and send var response = (createCustomerProfileResponse)_gateway.Send(req); //set the profile ID return(new Customer { Email = email, Description = description, ProfileID = response.customerProfileId, ID = merchantCustomerId != "" ? merchantCustomerId : "MerchantCustomerID" }); }
/// <summary> /// returns the most recent 1000 transactions that are unsettled /// </summary> /// <returns></returns> public List <Transaction> GetUnsettledTransactionList() { var response = (getUnsettledTransactionListResponse)_gateway.Send(new getUnsettledTransactionListRequest()); return(Transaction.NewListFromResponse(response.transactions)); }
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); }