protected InvoiceItem GetDomainSvcSetupFee(DomainNameSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.Quantity = 1; line.UnitPrice = service.SetupFee; line.TypeName = "Setup Fee"; return line; }
protected InvoiceItem GetSetupFeeInvoiceLine(HostingPackageSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.Quantity = 1; line.UnitPrice = service.SetupFee; line.TypeName = "Setup Fee"; return line; }
protected InvoiceItem GetRecurringFeeInvoiceLine(HostingPackageSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.ServiceId = service.ServiceId; line.Quantity = 1; line.UnitPrice = service.RecurringFee; line.TypeName = (service.Status == ServiceStatus.Ordered) ? Product.HOSTING_PLAN_NAME : "Recurring Fee"; return line; }
protected InvoiceItem GetAddonSvcFee(HostingAddonSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.ServiceId = service.ServiceId; line.Quantity = service.Quantity; line.UnitPrice = service.CyclePrice; if (service.Recurring && service.Status != ServiceStatus.Ordered) line.TypeName = "Recurring Fee"; else line.TypeName = Product.HOSTING_ADDON_NAME; return line; }
protected InvoiceItem GetAddonSvcFee(HostingAddonSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.ServiceId = service.ServiceId; line.Quantity = service.Quantity; line.UnitPrice = service.CyclePrice; if (service.Recurring && service.Status != ServiceStatus.Ordered) { line.TypeName = "Recurring Fee"; } else { line.TypeName = Product.HOSTING_ADDON_NAME; } return(line); }
public CheckoutFormParams GetCheckoutFormParams(FormParameters formParams, InvoiceItem[] invoiceLines) { // normalize target site variable string targetSite = formParams["target_site"].EndsWith("/") ? formParams["target_site"] : formParams["target_site"] + "/"; CheckoutFormParams outputParams = new CheckoutFormParams(); // setup service url outputParams.Action = ServiceUrl; outputParams.Method = CheckoutFormParams.POST_METHOD; // copy command outputParams["cmd"] = CART_COMMAND; // workaround to make IPN callbacks work outputParams["rm"] = "2"; // set upload value to indicate a third-party shopping cart outputParams["upload"] = "1"; // set business outputParams["business"] = Business; // set cancel return url outputParams["cancel_return"] = String.Concat(targetSite, "?pid=ecOnlineStore&ContractId=", formParams[FormParameters.CONTRACT]); // set return url outputParams["return"] = targetSite; // set IPN-Endpoint url outputParams["notify_url"] = String.Concat(targetSite, IPN_PROCESSOR_ENDPOINT); // set invoice number outputParams["invoice"] = formParams[FormParameters.INVOICE]; // set contract number outputParams["custom"] = formParams[FormParameters.CONTRACT]; // set invoice currency outputParams["currency_code"] = formParams[FormParameters.CURRENCY]; // set formatted invoice number outputParams["item_name_1"] = String.Format("{0} #{1}", FormParameters.INVOICE, formParams[FormParameters.INVOICE]); // set invoice amount outputParams["amount_1"] = formParams[FormParameters.AMOUNT]; // copy first name AddParameter(formParams, outputParams, FormParameters.FIRST_NAME, "first_name"); // copy last name AddParameter(formParams, outputParams, FormParameters.LAST_NAME, "last_name"); // copy address AddParameter(formParams, outputParams, FormParameters.ADDRESS, "address1"); // copy city AddParameter(formParams, outputParams, FormParameters.CITY, "city"); // copy state AddParameter(formParams, outputParams, FormParameters.STATE, "state"); // copy country AddParameter(formParams, outputParams, FormParameters.COUNTRY, "country"); // copy zip AddParameter(formParams, outputParams, FormParameters.ZIP, "zip"); // copty email AddParameter(formParams, outputParams, FormParameters.EMAIL, "email"); // copy phone number if (formParams[FormParameters.COUNTRY] != "US" && formParams[FormParameters.COUNTRY] != "CA") { // phone numbers outside U.S copy as is outputParams["night_phone_b"] = formParams[FormParameters.PHONE]; } // return whole set of params return outputParams; }
public CheckoutFormParams GetCheckoutFormParams(FormParameters inputParams, InvoiceItem[] invoiceLines) { // check invoice currency against 2CO settings if (!CI_ValuesEqual(TCO_Currency, inputParams[FormParameters.CURRENCY])) throw new Exception(CURRENCY_NOT_MATCH_MSG); // fill checkout params CheckoutFormParams outputParams = new CheckoutFormParams(); // sets serviced props outputParams.Action = PAYMENT_ROUTINE; outputParams.Method = CheckoutFormParams.POST_METHOD; // copy target_site variable outputParams["target_site"] = inputParams["target_site"]; // copy invoice amount outputParams["sid"] = AccountSID; // copy contract number outputParams["contract_id"] = inputParams[FormParameters.CONTRACT]; // copy invoice number outputParams["merchant_order_id"] = inputParams[FormParameters.INVOICE]; // copy invoice currency outputParams["tco_currency"] = inputParams[FormParameters.CURRENCY]; // copy continue shopping button url // outputParams["return_url"] = ContinueShoppingUrl + "&ContractId=" + inputParams[FormParameters.CONTRACT]; // copy fixed cart option if (FixedCart) outputParams["fixed"] = "Y"; // copy pay method (credit card) outputParams["pay_method"] = "CC"; // copy live mode flag if (!LiveMode) outputParams["demo"] = "Y"; // copy card holder name outputParams["card_holder_name"] = inputParams[FormParameters.FIRST_NAME] + " " + inputParams[FormParameters.LAST_NAME]; // copy email outputParams["email"] = inputParams[FormParameters.EMAIL]; // copy street address outputParams["street_address"] = inputParams[FormParameters.ADDRESS]; // copy country outputParams["country"] = inputParams[FormParameters.COUNTRY]; // copy city outputParams["city"] = inputParams[FormParameters.CITY]; // copy state & phone if (!CI_ValuesEqual(inputParams[FormParameters.COUNTRY], "US") && !CI_ValuesEqual(inputParams[FormParameters.COUNTRY], "CA")) { // state is outside US & CA outputParams["state"] = OUTSIDE_US_CA; // copy outside US phone as is outputParams["phone"] = inputParams[FormParameters.PHONE]; } else { // copy state outputParams["state"] = inputParams[FormParameters.STATE]; // convert phone to US format outputParams["phone"] = ConvertPhone2US(inputParams[FormParameters.PHONE]); } // copy zip outputParams["zip"] = inputParams[FormParameters.ZIP]; // copy invoice amount outputParams["total"] = inputParams[FormParameters.AMOUNT]; // copy invoice number outputParams["cart_order_id"] = inputParams[FormParameters.INVOICE]; return outputParams; }
public GenericSvcResult ActivateInvoiceItem(InvoiceItem item) { GenericSvcResult svc_result = ActivateService(item.ServiceId, true, true); // if (svc_result.Succeed) InvoiceController.SetInvoiceItemProcessed(item.InvoiceId, item.ItemId); // return svc_result; }
protected InvoiceItem GetDomainSvcFee(DomainNameSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.ServiceId = service.ServiceId; line.Quantity = 1; line.UnitPrice = service.RecurringFee; // define line type if (service.Status != ServiceStatus.Ordered) { line.TypeName = "Recurring Fee"; } else { switch (service["SPF_ACTION"]) { case DomainNameSvc.SPF_TRANSFER_ACTION: line.TypeName = String.Concat(Product.TOP_LEVEL_DOMAIN_NAME, " Transfer"); break; case DomainNameSvc.SPF_REGISTER_ACTION: line.TypeName = String.Concat(Product.TOP_LEVEL_DOMAIN_NAME, " Registration"); break; } } return line; }
protected InvoiceItem GetAddonSvcSetupFee(HostingAddonSvc service) { InvoiceItem line = new InvoiceItem(); line.ItemName = service.ServiceName; line.Quantity = service.Quantity; line.UnitPrice = service.SetupFee; line.TypeName = "Setup Fee"; return line; }