/// <summary> /// Init for a Full Page Stripe Checkout /// </summary> /// <param name="Client">HttpClient that will be used to send requests</param> /// <param name="SI">The Items used to send requests, use StripeHelpers.GetItems to create this</param> /// <param name="Profile">The data submitted at checkout</param> /// <param name="CS_LIVE">The checkout token, THIS IS GENERATED ON SITES AND IS DIFFERENT FOR EACH SITE</param> public StripeFullCheckout(HttpClient Client, StripeItems SI, Profile Profile, string CS_LIVE) { this._StripeItems = SI; this._Profile = Profile; this._Client = Client; this._CS_LIVE = CS_LIVE; }
/// <summary> /// Returns a StripeItems body needed to checkout /// </summary> /// <param name="Items">Parse items</param> /// <param name="UA">The useragent needed to send requests, leaving null will result in a randomly generated User Agent</param> /// <returns></returns> public static StripeItems GetItems(Dictionary <string, string> Items, string UA = null) { var items = new StripeItems() { GUID = Items["amp;mids[guid]"], PKLive = Items["authentication[apiKey]"], MUID = Items["amp;mids[muid]"], SID = Items["amp;mids[muid]"] }; if (UA == null) { items.GenerateRandomUserAgent(); } else { items.UserAgent = UA; } return(items); }