* \CodesWholesale\Resource\Product::get($url); * */ /** * Sample products */ // $url = "https://sandbox.codeswholesale.com/v1/products/33e3e81d-2b78-475a-8886-9848116f5133"; // - pre order product // $url = "https://sandbox.codeswholesale.com/v1/products/04aeaf1e-f7b5-4ba9-ba19-91003a04db0a"; // - not enough balance // $url = "https://sandbox.codeswholesale.com/v1/products/6313677f-5219-47e4-a067-7401f55c5a3a"; // - image code $url = "https://sandbox.codeswholesale.com/v1/products/ffe2274d-5469-4b0f-b57b-f8d21b09c24c"; // - code text $product = \CodesWholesale\Resource\Product::get($url); /** * Make an order for this particular product */ $code = \CodesWholesale\Resource\Order::createOrder($product); /** * There are 3 possible code types returned from CW. * * Pre Order (when codes are not in stock) */ if ($code->isPreOrder()) { // nothing much to do with PreOrdered code - we are working on Post Back functionality, // CW will send you a post back information // once the code is added to your order, post back will be send directly to your website. // For now you can send an notification email echo "Pre-order"; } /** * Code as a TEXT */