コード例 #1
0
 public static function get_receipt_content($order_number)
 {
     if (empty(self::$receipt_content)) {
         $cloud = new CC_Cloud_API_V1();
         $url = $cloud->subdomain_url() . "receipt/{$order_number}";
         $response = wp_remote_get($url, array('sslverify' => false));
         if (!is_wp_error($response)) {
             if ($response['response']['code'] == '200') {
                 self::$receipt_content = $response['body'];
             }
         } else {
             CC_Log::write('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Unable to locate a receipt with the order number: {$order_number}");
             throw new CC_Exception_Store_ReceiptNotFound('Unable to locate a receipt with the given order number.');
         }
     }
     return self::$receipt_content;
 }
コード例 #2
0
 public function get_receipt_content($order_number)
 {
     return CC_Cloud_Receipt::get_receipt_content($order_number);
 }
コード例 #3
0
 /**
  * Render receipt page when called from API endpoint
  */
 public function show_receipt($order_id)
 {
     $receipt = CC_Cloud_Receipt::get_receipt_content($order_id);
     do_action('cc_load_receipt', $order_id);
     $content = str_replace('{{cart66_content}}', $receipt, $content);
 }