/// <summary> /// Insert or update customer billing address /// </summary> /// <param name="settings">Inserted/updated settings</param> /// <param name="referenceCustomer">(mandatory) the customer reference</param> /// <param name="typePayment">(optional) the payment type</param> /// <param name="dateNextBilling">(optional) next billing date. If null, the customer won't be billed until the next time he subscribes.</param> public virtual RequestReport SaveCustomerPaymentSettings(out SettingsPayment settings, object referenceCustomer, TypePayment typePayment, DateTime?dateNextBilling) { settings = null; // create the request RequestFluent request; var result = this.CreateRequest(out request, EndpointsV1.CustomerSettingsPayment); // if succeeded if (result.IsSuccess()) { // append all parameters request .AddUrlParameter(EndpointParametersV1.ReferenceCustomer, this.ToString(referenceCustomer)); // build the address to send var addressToSend = new SettingsPayment { TypePayment = typePayment, DateNextBilling = dateNextBilling }; // send the request var response = this.Send(request, addressToSend); // handle the response result = this.HandleResponse(out settings, response); } return(result); }
/// <summary> /// Get a customer billing address /// </summary> /// <param name="settings">Found settings, if succeeded</param> /// <param name="referenceCustomer">(mandatory) required customer reference</param> public virtual RequestReport GetCustomerPaymentSettings(out SettingsPayment settings, object referenceCustomer) { settings = null; // create the request RequestFluent request; var result = this.CreateRequest(out request, EndpointsV1.CustomerSettingsPayment); // if succeeded if (result.IsSuccess()) { // append all parameters request .AddUrlParameter(EndpointParametersV1.ReferenceCustomer, this.ToString(referenceCustomer)); // send the request var response = this.Send(request); // handle the response result = this.HandleResponse(out settings, response); } return(result); }