public void saveCallBack() { billing = settings.billingInfo; credit = settings.ccInfo; colorRelevant = settings.colorRelevant; sizeRelevant = settings.sizeRelevant; color = settings.color; size = settings.size; keywords = settings.keywords; category = settings.category; btnOrder.Enabled = true; }
private static String checkOut(Product product, BillingInformation billingInfo, CreditcardDetails ccInfo) { SupremeRequest sr = new SupremeRequest(new Uri("https://www.supremenewyork.com/checkout"), ref product.getCookieReference()); String checkOutPageSrc = sr.GET(true); String authenticity_token = ExHelper.getAuthenticity_token(checkOutPageSrc); String postString = SupremeRequest.generatePostString(authenticity_token, billingInfo, ccInfo); sr = new SupremeRequest(new Uri("https://www.supremenewyork.com/checkout"), ref product.getCookieReference()); String successPageSrc = sr.POST(postString, true, true, true, "https://www.supremenewyork.com/checkout"); return(successPageSrc); }
public static OrderResult Order(Product product, BillingInformation billingInfo, CreditcardDetails ccInfo) { OrderResult oReturn = new OrderResult(); if (addToCart(product)) { String successPageSrc = checkOut(product, billingInfo, ccInfo); if (successPageSrc.Contains("successfully")) { oReturn.success = true; oReturn.ccInfo = ccInfo; oReturn.billingInfo = billingInfo; oReturn.rawResult = successPageSrc; } else { oReturn.success = false; oReturn.ccInfo = ccInfo; oReturn.billingInfo = billingInfo; oReturn.rawResult = successPageSrc; } } else { oReturn.success = false; } return(oReturn); }
public static String generatePostString(String authenticity_token, BillingInformation billingInfo, CreditcardDetails ccInfo) { StringBuilder postString = new StringBuilder(); postString.Append("utf8="); postString.Append(Constants.UTF8); postString.Append("&authenticity_token="); postString.Append(Uri.EscapeDataString(authenticity_token)); postString.Append("&order%5Bbilling_name%5D="); postString.Append(billingInfo.FullName.Replace(" ", "+")); postString.Append("&order%5Bemail%5D="); postString.Append(billingInfo.Email.Replace("@", "%40")); postString.Append("&order%5Btel%5D="); postString.Append(billingInfo.Telephone.Replace("+", "%2B")); postString.Append("&order%5Bbilling_address%5D="); postString.Append(billingInfo.Address_1.Replace(" ", "+")); postString.Append("&order%5Bbilling_address_2%5D="); postString.Append(billingInfo.Address_2.Replace(" ", "+")); postString.Append("&order%5Bbilling_address_3%5D="); postString.Append(billingInfo.Address_3.Replace(" ", "+")); postString.Append("&order%5Bbilling_city%5D="); postString.Append(billingInfo.City.Replace(" ", "+")); postString.Append("&order%5Bbilling_zip%5D="); postString.Append(billingInfo.ZipCode); postString.Append("&order%5Bbilling_country%5D="); postString.Append(billingInfo.Country.Value); postString.Append("&same_as_billing_address=1&store_credit_id="); postString.Append("&credit_card%5Btype%5D="); postString.Append(ccInfo.Type.Value); postString.Append("&credit_card%5Bcnb%5D="); postString.Append(ccInfo.Number); postString.Append("&credit_card%5Bmonth%5D="); postString.Append(ccInfo.Month); postString.Append("&credit_card%5Byear%5D="); postString.Append(ccInfo.Year); postString.Append("&credit_card%5Bvval%5D="); postString.Append(ccInfo.CVV2); postString.Append("&order%5Bterms%5D=0&order%5Bterms%5D=1&hpcvv="); postString.Append("&commit="); postString.Append(Constants.en_commit); return(postString.ToString()); }