PHP_VERSION, 'wp_version' => defined('ZBRIDGE_VERSION') ? ZBRIDGE_VERSION : (defined('WP_ZBRIDGE_VERSION') ? WP_ZBRIDGE_VERSION : (defined('WP_ZARAZ_VERSION') ? WP_ZARAZ_VERSION : '1.2.7')), 'hpos_compatible' => true, 'zaraz_detected' => !empty($_SERVER['HTTP_CF_RAY']) || !empty($_SERVER['HTTP_CF_CONNECTING_IP']), 'curl_supported' => function_exists('curl_version'), 'openssl_crypto' => function_exists('openssl_digest'), ]; } /** * Generates a sample order payload for simulation testing. * * @return array */ public function generateSampleOrder(): array { $randId = wp_rand(10000, 99999); return [ 'id' => $randId, 'total' => 129.50, 'currency' => 'USD', 'items' => [ [ 'product_id' => 401, 'name' => 'Cloudflare Edge Analytics Pro', 'price' => 129.50, 'quantity' => 1, 'sku' => 'CF-EDGE-PRO', ], ], 'customer' => [ 'email' => 'sample@example.com', 'phone' => '+15551234567', 'first_name' => 'Jane', 'last_name' => 'Doe', 'city' => 'San Francisco', 'state' => 'CA', 'postcode' => '94105', 'country' => 'US', ], 'created_at' => gmdate('Y-m-d H:i:s'), ]; } /** * Generates a sample refund payload for simulation testing. * * @return array */ public function generateSampleRefund(): array { $randOrderId = wp_rand(10000, 99999); $randRefundId = wp_rand(1000, 9999); return [ 'order_id' => $randOrderId, 'refund_id' => $randRefundId, 'amount' => 49.99, 'currency' => 'USD', 'reason' => 'Customer return', 'items' => [ [ 'product_id' => 401, 'name' => 'Cloudflare Edge Analytics Pro', 'quantity' => 1, 'price' => 49.99, ], ], 'customer_email' => 'sample@example.com', ]; } }