Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php use Illuminate\Support\Facades\Mail; use Webkul\Admin\Mail\Order\CanceledNotificati..

Decoded Output download

<?php
 use Illuminate\Support\Facades\Mail; use Webkul\Admin\Mail\Order\CanceledNotification as AdminOrderCanceledNotification; use Webkul\Checkout\Models\Cart; use Webkul\Checkout\Models\CartAddress; use Webkul\Checkout\Models\CartItem; use Webkul\Checkout\Models\CartPayment; use Webkul\Checkout\Models\CartShippingRate; use Webkul\Core\Models\CoreConfig; use Webkul\Customer\Models\Customer; use Webkul\Customer\Models\CustomerAddress; use Webkul\Faker\Helpers\Product as ProductFaker; use Webkul\Sales\Models\Order; use Webkul\Sales\Models\OrderAddress; use Webkul\Sales\Models\OrderComment; use Webkul\Sales\Models\OrderItem; use Webkul\Sales\Models\OrderPayment; use Webkul\Shop\Mail\Order\CanceledNotification as ShopOrderCanceledNotification; use Webkul\Shop\Mail\Order\CommentedNotification; use function Pest\Laravel\get; use function Pest\Laravel\postJson; goto lE5TJ; oHmrR: it("should return the view page of order", function () { $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); get(route("admin.sales.orders.view", $order->id))->assertOk()->assertSeeText(trans("admin::app.sales.orders.view." . $order->status))->assertSeeText(trans("admin::app.sales.orders.view.title", array("order_id" => $order->increment_id)))->assertSeeText(trans("admin::app.sales.orders.view.summary-tax"))->assertSeeText(trans("admin::app.sales.orders.view.summary-grand-total"))->assertSeeText(trans("admin::app.sales.orders.view.comments")); }); goto IaG1v; qO6FH: it("should comment to the order and send mail to the customer", function () { Mail::fake(); $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("admin.sales.orders.comment", $order->id), array("comment" => $comment = fake()->word(), "customer_notified" => 1))->assertRedirect(route("admin.sales.orders.view", $order->id))->isRedirection(); $this->assertModelWise(array(OrderComment::class => array(array("order_id" => $order->id, "comment" => $comment)))); Mail::assertQueued(CommentedNotification::class); Mail::assertQueuedCount(1); }); goto ZI17z; IaG1v: it("should cancel the order", function () { $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("admin.sales.orders.cancel", $order->id))->assertRedirect(route("admin.sales.orders.view", $order->id))->isRedirection(); $this->assertModelWise(array(Order::class => array(array("id" => $order->id, "status" => "canceled")))); }); goto e3Q7J; dALT2: it("should comment to the order", function () { $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("admin.sales.orders.comment", $order->id), array("comment" => $comment = fake()->word()))->assertRedirect(route("admin.sales.orders.view", $order->id))->isRedirection(); $this->assertModelWise(array(OrderComment::class => array(array("order_id" => $order->id, "comment" => $comment)))); }); goto qO6FH; LyyYe: it("should give validation error when store the comment to the order", function () { $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("admin.sales.orders.comment", $order->id))->assertJsonValidationErrorFor("comment")->assertUnprocessable(); }); goto dALT2; e3Q7J: it("should cancel the order and send the notification to the customer", function () { Mail::fake(); CoreConfig::factory()->create(array("code" => "emails.general.notifications.emails.general.notifications.cancel_order", "value" => 1)); CoreConfig::factory()->create(array("code" => "emails.general.notifications.emails.general.notifications.cancel_order", "value" => 1)); $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("admin.sales.orders.cancel", $order->id))->assertRedirect(route("admin.sales.orders.view", $order->id))->isRedirection(); $this->assertModelWise(array(Order::class => array(array("id" => $order->id, "status" => "canceled")))); Mail::assertQueued(ShopOrderCanceledNotification::class); Mail::assertQueued(AdminOrderCanceledNotification::class); Mail::assertQueuedCount(2); }); goto LyyYe; lE5TJ: it("should return the index page of Orders page", function () { $this->loginAsAdmin(); get(route("admin.sales.orders.index"))->assertOk()->assertSeeText(trans("admin::app.sales.orders.index.title")); }); goto oHmrR; ZI17z: it("should search the order", function () { $product = (new ProductFaker(array("attributes" => array(5 => "new"), "attribute_value" => array("new" => array("boolean_value" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("channel_id" => core()->getCurrentChannel()->id, "global_currency_code" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "base_currency_code" => $baseCurrencyCode, "channel_currency_code" => core()->getChannelBaseCurrencyCode(), "cart_currency_code" => core()->getCurrentCurrencyCode(), "items_count" => 1, "items_qty" => 1, "grand_total" => $price = $product->price, "base_grand_total" => $price, "sub_total" => $price, "base_sub_total" => $price, "shipping_method" => "free_free", "customer_id" => $customer->id, "is_active" => 1, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); CartItem::factory()->create(array("quantity" => $quantity = 1, "product_id" => $product->id, "sku" => $product->sku, "name" => $product->name, "type" => $product->type, "cart_id" => $cart->id, "price" => $convertedPrice = core()->convertPrice($price), "base_price" => $price, "total" => $convertedPrice * $quantity, "base_total" => $price * $quantity, "weight" => $product->weight ?? 0, "total_weight" => ($product->weight ?? 0) * $quantity, "base_total_weight" => ($product->weight ?? 0) * $quantity, "additional" => array("quantity" => $quantity, "product_id" => $product->id))); CustomerAddress::factory()->create(array("customer_id" => $customer->id, "address_type" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "address_type" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("method" => $paymentMethod = "cashondelivery", "method_title" => core()->getConfigData("sales.payment_methods." . $paymentMethod . ".title"), "cart_id" => $cart->id)); CartShippingRate::factory()->create(array("carrier" => "free", "carrier_title" => "Free shipping", "method" => "free_free", "method_title" => "Free Shipping", "method_description" => "Free Shipping", "cart_address_id" => $cartBillingAddress->id)); $order = Order::factory()->create(array("cart_id" => $cart->id, "customer_id" => $customer->id, "customer_email" => $customer->email, "customer_first_name" => $customer->first_name, "customer_last_name" => $customer->last_name)); OrderItem::factory()->create(array("product_id" => $product->id, "order_id" => $order->id, "sku" => $product->sku, "type" => $product->type, "name" => $product->name)); OrderPayment::factory()->create(array("order_id" => $order->id)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("order_id" => $order->id, "cart_id" => $cart->id, "address_type" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); get(route("admin.sales.orders.search"), array("query" => fake()->randomElement(array("pending", "completed", "processing"))))->assertOk()->assertJsonPath("path", route("admin.sales.orders.search"))->assertJsonPath("data.0.id", $order->id)->assertJsonPath("data.0.status", $order->status)->assertJsonPath("data.0.customer_email", $order->customer_email); }); ?>

Did this file decode correctly?

Original Code

<?php
 use Illuminate\Support\Facades\Mail; use Webkul\Admin\Mail\Order\CanceledNotification as AdminOrderCanceledNotification; use Webkul\Checkout\Models\Cart; use Webkul\Checkout\Models\CartAddress; use Webkul\Checkout\Models\CartItem; use Webkul\Checkout\Models\CartPayment; use Webkul\Checkout\Models\CartShippingRate; use Webkul\Core\Models\CoreConfig; use Webkul\Customer\Models\Customer; use Webkul\Customer\Models\CustomerAddress; use Webkul\Faker\Helpers\Product as ProductFaker; use Webkul\Sales\Models\Order; use Webkul\Sales\Models\OrderAddress; use Webkul\Sales\Models\OrderComment; use Webkul\Sales\Models\OrderItem; use Webkul\Sales\Models\OrderPayment; use Webkul\Shop\Mail\Order\CanceledNotification as ShopOrderCanceledNotification; use Webkul\Shop\Mail\Order\CommentedNotification; use function Pest\Laravel\get; use function Pest\Laravel\postJson; goto lE5TJ; oHmrR: it("\163\150\x6f\x75\x6c\144\40\162\x65\x74\x75\x72\156\x20\164\150\145\x20\166\x69\145\x77\40\160\141\147\x65\40\157\x66\x20\x6f\162\144\x65\x72", function () { $product = (new ProductFaker(array("\141\164\164\x72\151\x62\x75\164\x65\163" => array(5 => "\156\x65\x77"), "\x61\x74\x74\162\151\x62\165\164\145\x5f\x76\x61\x6c\x75\x65" => array("\x6e\145\x77" => array("\142\157\157\154\x65\141\x6e\137\166\141\154\x75\145" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\143\x68\x61\x6e\x6e\145\154\x5f\x69\x64" => core()->getCurrentChannel()->id, "\x67\x6c\x6f\142\x61\154\x5f\x63\x75\162\162\x65\156\x63\x79\x5f\143\157\x64\145" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\x62\x61\163\x65\137\143\165\x72\162\145\x6e\143\x79\x5f\x63\x6f\144\x65" => $baseCurrencyCode, "\143\150\141\x6e\x6e\145\x6c\137\143\x75\162\162\x65\x6e\143\171\137\x63\x6f\144\x65" => core()->getChannelBaseCurrencyCode(), "\x63\x61\162\164\137\143\x75\x72\162\x65\x6e\143\171\x5f\x63\157\x64\x65" => core()->getCurrentCurrencyCode(), "\151\164\145\x6d\x73\x5f\x63\x6f\165\156\164" => 1, "\151\164\x65\155\163\137\x71\x74\x79" => 1, "\147\x72\141\x6e\144\137\x74\x6f\164\x61\x6c" => $price = $product->price, "\x62\x61\163\x65\x5f\147\162\141\156\144\x5f\x74\x6f\x74\x61\x6c" => $price, "\163\x75\x62\x5f\x74\x6f\x74\141\x6c" => $price, "\x62\141\163\x65\137\x73\x75\142\137\164\x6f\x74\x61\x6c" => $price, "\x73\150\151\x70\160\x69\156\147\x5f\x6d\145\x74\x68\x6f\144" => "\146\162\x65\145\137\146\x72\145\145", "\143\x75\163\164\157\x6d\x65\x72\137\151\x64" => $customer->id, "\151\x73\x5f\x61\x63\164\x69\166\145" => 1, "\x63\165\163\x74\x6f\155\145\x72\137\x65\155\x61\x69\x6c" => $customer->email, "\x63\165\163\164\x6f\155\145\162\137\146\x69\x72\163\164\x5f\156\x61\x6d\x65" => $customer->first_name, "\143\x75\x73\x74\157\155\x65\162\x5f\x6c\141\x73\164\x5f\156\x61\x6d\145" => $customer->last_name)); CartItem::factory()->create(array("\161\x75\x61\156\164\x69\164\x79" => $quantity = 1, "\x70\x72\x6f\x64\165\x63\x74\137\x69\144" => $product->id, "\163\153\x75" => $product->sku, "\x6e\141\x6d\145" => $product->name, "\x74\x79\160\145" => $product->type, "\x63\141\x72\x74\x5f\151\x64" => $cart->id, "\160\x72\151\x63\145" => $convertedPrice = core()->convertPrice($price), "\142\141\163\x65\x5f\x70\162\151\143\x65" => $price, "\164\157\x74\x61\x6c" => $convertedPrice * $quantity, "\x62\x61\163\145\137\x74\x6f\164\141\154" => $price * $quantity, "\167\x65\x69\147\150\164" => $product->weight ?? 0, "\164\157\164\x61\154\137\x77\x65\151\x67\150\x74" => ($product->weight ?? 0) * $quantity, "\x62\x61\163\x65\137\164\x6f\x74\141\154\137\x77\145\x69\x67\150\x74" => ($product->weight ?? 0) * $quantity, "\141\x64\x64\x69\x74\151\157\x6e\141\154" => array("\161\x75\x61\156\x74\x69\x74\x79" => $quantity, "\x70\x72\157\x64\x75\143\164\x5f\x69\x64" => $product->id))); CustomerAddress::factory()->create(array("\143\165\163\x74\157\155\145\x72\137\x69\x64" => $customer->id, "\141\x64\x64\x72\x65\163\x73\x5f\x74\171\x70\x65" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\141\162\164\137\151\x64" => $cart->id, "\143\165\163\164\x6f\155\145\162\137\x69\x64" => $customer->id, "\x61\144\x64\162\145\163\163\137\164\171\x70\145" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\x63\141\162\x74\137\x69\144" => $cart->id, "\x63\165\163\x74\157\x6d\x65\162\137\151\144" => $customer->id, "\141\144\144\x72\x65\163\163\x5f\x74\x79\x70\x65" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\145\x74\x68\157\x64" => $paymentMethod = "\143\x61\x73\x68\157\156\x64\x65\154\151\x76\x65\x72\x79", "\155\145\164\x68\x6f\144\137\x74\x69\x74\x6c\x65" => core()->getConfigData("\x73\x61\154\x65\163\x2e\x70\141\x79\x6d\x65\x6e\164\x5f\155\145\164\150\157\144\163\56" . $paymentMethod . "\x2e\x74\x69\164\154\145"), "\143\141\162\164\137\x69\x64" => $cart->id)); CartShippingRate::factory()->create(array("\x63\141\162\x72\151\145\162" => "\x66\162\x65\x65", "\x63\141\162\x72\151\x65\x72\137\x74\x69\164\x6c\x65" => "\x46\162\x65\145\x20\163\x68\x69\160\160\151\x6e\147", "\155\145\x74\150\157\144" => "\x66\x72\x65\145\137\x66\162\x65\145", "\155\x65\x74\150\157\x64\137\x74\151\x74\154\x65" => "\106\162\145\x65\x20\123\150\x69\160\x70\151\156\x67", "\x6d\x65\164\x68\x6f\x64\x5f\x64\x65\x73\143\x72\x69\160\164\x69\157\x6e" => "\106\162\x65\x65\x20\x53\150\151\160\x70\x69\x6e\147", "\x63\141\x72\x74\137\141\144\x64\162\145\163\x73\x5f\151\x64" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\143\141\162\x74\x5f\151\x64" => $cart->id, "\143\165\163\x74\x6f\x6d\145\x72\137\151\144" => $customer->id, "\143\165\x73\x74\157\x6d\x65\x72\x5f\x65\155\x61\151\154" => $customer->email, "\143\x75\163\x74\157\155\145\162\137\146\x69\162\x73\164\x5f\156\141\155\x65" => $customer->first_name, "\x63\165\x73\x74\x6f\x6d\145\x72\137\x6c\141\163\164\x5f\156\x61\155\x65" => $customer->last_name)); OrderItem::factory()->create(array("\x70\162\157\144\x75\143\x74\137\x69\x64" => $product->id, "\157\x72\x64\x65\x72\x5f\151\144" => $order->id, "\x73\x6b\x75" => $product->sku, "\164\x79\x70\145" => $product->type, "\x6e\141\155\145" => $product->name)); OrderPayment::factory()->create(array("\157\162\144\145\162\137\151\144" => $order->id)); OrderAddress::factory()->create(array("\157\162\144\145\x72\137\x69\144" => $order->id, "\143\141\x72\164\137\151\144" => $cart->id, "\141\144\144\x72\x65\x73\163\137\164\171\160\x65" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\x6f\x72\x64\145\162\137\x69\x64" => $order->id, "\143\141\x72\x74\137\x69\144" => $cart->id, "\141\144\144\162\145\163\x73\x5f\164\171\160\145" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); get(route("\141\x64\x6d\151\156\x2e\163\141\x6c\145\163\56\x6f\162\144\145\162\163\56\x76\x69\x65\167", $order->id))->assertOk()->assertSeeText(trans("\141\x64\x6d\x69\156\x3a\x3a\141\160\x70\x2e\x73\x61\154\145\x73\56\x6f\x72\x64\145\162\163\x2e\x76\x69\x65\x77\x2e" . $order->status))->assertSeeText(trans("\141\x64\x6d\x69\x6e\72\x3a\141\x70\160\56\163\141\x6c\145\163\x2e\157\x72\144\145\x72\x73\x2e\x76\151\145\167\x2e\164\x69\164\x6c\145", array("\157\162\x64\145\162\137\x69\x64" => $order->increment_id)))->assertSeeText(trans("\x61\x64\155\x69\156\x3a\72\x61\x70\x70\x2e\x73\x61\x6c\x65\x73\56\157\x72\x64\145\162\x73\x2e\166\x69\x65\167\56\163\x75\155\155\141\x72\171\x2d\x74\141\170"))->assertSeeText(trans("\141\144\155\x69\x6e\x3a\x3a\141\160\160\x2e\x73\x61\x6c\x65\x73\56\157\162\144\x65\x72\163\x2e\166\151\x65\167\56\x73\x75\x6d\x6d\141\x72\x79\x2d\x67\162\141\156\x64\x2d\x74\157\164\141\x6c"))->assertSeeText(trans("\x61\144\x6d\151\156\x3a\72\x61\x70\160\56\163\141\x6c\x65\163\56\157\x72\x64\x65\x72\163\56\166\151\x65\167\x2e\x63\157\155\x6d\x65\x6e\164\163")); }); goto IaG1v; qO6FH: it("\x73\150\157\165\x6c\x64\x20\143\157\x6d\x6d\x65\156\164\40\164\157\40\x74\150\145\40\x6f\x72\144\x65\162\40\141\x6e\144\40\x73\x65\x6e\x64\40\155\x61\x69\154\40\164\x6f\40\x74\150\145\x20\143\165\163\164\157\155\145\x72", function () { Mail::fake(); $product = (new ProductFaker(array("\x61\164\164\162\151\142\x75\x74\x65\x73" => array(5 => "\x6e\145\167"), "\141\164\x74\x72\151\142\165\164\x65\137\x76\x61\154\165\x65" => array("\156\145\x77" => array("\x62\x6f\x6f\x6c\145\x61\156\x5f\x76\141\154\165\x65" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\143\x68\141\156\x6e\x65\154\137\x69\x64" => core()->getCurrentChannel()->id, "\x67\154\x6f\142\141\154\137\143\x75\162\162\x65\x6e\143\171\x5f\x63\x6f\x64\x65" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\x62\141\163\145\137\x63\x75\x72\x72\145\156\143\171\x5f\143\157\x64\x65" => $baseCurrencyCode, "\143\150\x61\x6e\x6e\x65\154\137\143\x75\x72\162\145\x6e\x63\171\137\x63\157\144\145" => core()->getChannelBaseCurrencyCode(), "\x63\x61\x72\164\137\143\165\x72\162\145\156\x63\171\x5f\143\157\144\145" => core()->getCurrentCurrencyCode(), "\151\164\145\155\163\137\143\x6f\165\156\164" => 1, "\x69\x74\145\155\x73\x5f\x71\x74\x79" => 1, "\147\162\141\156\x64\137\164\x6f\164\x61\x6c" => $price = $product->price, "\142\x61\x73\145\x5f\x67\162\141\x6e\144\137\164\157\x74\141\154" => $price, "\x73\x75\x62\137\164\x6f\164\141\x6c" => $price, "\142\141\163\145\137\163\x75\142\x5f\164\157\x74\141\154" => $price, "\x73\x68\151\x70\160\151\x6e\147\137\x6d\x65\164\x68\157\144" => "\x66\x72\145\145\x5f\146\x72\x65\145", "\x63\165\x73\164\x6f\x6d\x65\162\x5f\x69\144" => $customer->id, "\x69\163\137\x61\143\x74\x69\166\145" => 1, "\x63\165\163\164\x6f\x6d\145\x72\x5f\x65\x6d\141\x69\x6c" => $customer->email, "\143\x75\163\x74\157\x6d\145\162\137\146\x69\162\163\x74\137\x6e\x61\x6d\x65" => $customer->first_name, "\143\165\x73\x74\x6f\155\x65\162\x5f\x6c\x61\x73\164\137\x6e\x61\155\145" => $customer->last_name)); CartItem::factory()->create(array("\161\165\141\x6e\x74\151\164\171" => $quantity = 1, "\x70\x72\157\144\x75\x63\x74\x5f\x69\x64" => $product->id, "\163\153\165" => $product->sku, "\x6e\141\x6d\145" => $product->name, "\164\x79\x70\145" => $product->type, "\143\141\x72\x74\x5f\151\x64" => $cart->id, "\160\162\x69\143\x65" => $convertedPrice = core()->convertPrice($price), "\x62\x61\x73\145\137\x70\162\x69\x63\145" => $price, "\x74\157\164\x61\154" => $convertedPrice * $quantity, "\x62\x61\x73\145\x5f\164\x6f\164\141\154" => $price * $quantity, "\x77\145\x69\147\150\x74" => $product->weight ?? 0, "\x74\x6f\164\x61\154\137\x77\x65\151\x67\150\164" => ($product->weight ?? 0) * $quantity, "\x62\x61\x73\x65\x5f\164\157\x74\141\154\137\x77\145\151\147\150\x74" => ($product->weight ?? 0) * $quantity, "\x61\x64\144\151\x74\151\x6f\156\x61\x6c" => array("\x71\165\141\156\x74\151\164\x79" => $quantity, "\160\162\157\144\165\x63\164\137\x69\144" => $product->id))); CustomerAddress::factory()->create(array("\x63\x75\163\x74\157\155\145\162\x5f\x69\x64" => $customer->id, "\141\x64\144\162\145\163\x73\137\x74\x79\160\145" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\141\x72\164\137\x69\x64" => $cart->id, "\143\x75\x73\164\157\155\x65\162\x5f\151\144" => $customer->id, "\141\144\x64\162\145\x73\163\x5f\164\171\160\145" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\x63\x61\162\x74\x5f\x69\x64" => $cart->id, "\x63\165\x73\x74\157\x6d\145\x72\x5f\151\144" => $customer->id, "\x61\144\x64\x72\x65\163\x73\137\x74\171\160\x65" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\145\164\150\157\x64" => $paymentMethod = "\143\x61\x73\150\x6f\156\x64\x65\x6c\151\166\145\x72\x79", "\155\145\x74\150\x6f\x64\137\164\x69\x74\x6c\145" => core()->getConfigData("\163\x61\154\x65\163\x2e\160\141\x79\155\x65\156\164\137\x6d\x65\164\150\x6f\144\x73\56" . $paymentMethod . "\56\x74\x69\164\154\145"), "\143\x61\x72\x74\137\151\144" => $cart->id)); CartShippingRate::factory()->create(array("\143\x61\x72\x72\x69\x65\x72" => "\x66\x72\x65\145", "\143\x61\x72\162\x69\x65\x72\x5f\x74\x69\164\x6c\x65" => "\106\x72\x65\x65\x20\163\x68\151\160\x70\151\156\147", "\155\145\164\150\x6f\144" => "\146\162\145\145\x5f\x66\162\145\145", "\x6d\145\x74\x68\x6f\144\137\x74\151\164\154\145" => "\x46\162\x65\145\40\123\x68\151\x70\160\151\156\x67", "\x6d\145\x74\150\x6f\x64\137\144\x65\163\143\162\151\x70\164\151\157\x6e" => "\x46\x72\x65\145\40\x53\x68\x69\x70\160\151\156\147", "\143\141\162\x74\x5f\x61\144\144\x72\x65\163\x73\137\x69\144" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\x63\141\x72\x74\x5f\151\x64" => $cart->id, "\143\x75\x73\164\x6f\155\x65\162\137\151\144" => $customer->id, "\143\x75\x73\x74\x6f\x6d\145\162\x5f\145\155\141\x69\x6c" => $customer->email, "\x63\x75\x73\164\157\155\145\162\x5f\x66\x69\162\x73\x74\x5f\x6e\x61\x6d\145" => $customer->first_name, "\x63\165\x73\164\157\155\x65\162\137\154\141\x73\164\137\x6e\141\155\x65" => $customer->last_name)); OrderItem::factory()->create(array("\x70\162\157\144\165\143\164\x5f\x69\x64" => $product->id, "\157\162\144\145\162\x5f\x69\144" => $order->id, "\x73\x6b\165" => $product->sku, "\x74\171\160\x65" => $product->type, "\x6e\x61\155\145" => $product->name)); OrderPayment::factory()->create(array("\157\x72\x64\x65\x72\137\x69\x64" => $order->id)); OrderAddress::factory()->create(array("\157\162\x64\x65\162\x5f\x69\144" => $order->id, "\143\x61\x72\x74\137\151\144" => $cart->id, "\141\x64\x64\162\x65\x73\x73\x5f\164\171\x70\145" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\x6f\162\x64\x65\x72\137\151\144" => $order->id, "\143\x61\x72\x74\x5f\x69\144" => $cart->id, "\141\x64\144\x72\145\163\x73\137\x74\171\160\x65" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("\141\x64\155\x69\x6e\x2e\x73\x61\x6c\145\163\56\157\x72\x64\145\162\x73\x2e\x63\x6f\x6d\155\x65\156\x74", $order->id), array("\143\157\155\155\x65\156\x74" => $comment = fake()->word(), "\x63\165\163\x74\157\x6d\145\162\137\x6e\157\164\x69\146\151\x65\x64" => 1))->assertRedirect(route("\141\x64\155\151\156\x2e\x73\x61\154\x65\163\x2e\157\162\144\145\x72\163\56\x76\151\x65\167", $order->id))->isRedirection(); $this->assertModelWise(array(OrderComment::class => array(array("\x6f\x72\144\145\x72\x5f\x69\144" => $order->id, "\143\x6f\155\x6d\145\x6e\164" => $comment)))); Mail::assertQueued(CommentedNotification::class); Mail::assertQueuedCount(1); }); goto ZI17z; IaG1v: it("\163\150\x6f\165\x6c\144\40\x63\141\x6e\x63\x65\x6c\40\x74\150\145\40\x6f\162\144\145\x72", function () { $product = (new ProductFaker(array("\141\164\x74\x72\x69\x62\x75\x74\x65\163" => array(5 => "\156\x65\x77"), "\x61\x74\164\x72\x69\142\165\x74\145\137\x76\x61\154\165\x65" => array("\156\145\167" => array("\x62\x6f\157\154\x65\141\156\137\166\141\154\165\145" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\x63\x68\141\x6e\x6e\145\x6c\x5f\x69\x64" => core()->getCurrentChannel()->id, "\x67\154\x6f\x62\141\x6c\x5f\x63\165\162\162\x65\156\x63\171\137\143\x6f\x64\145" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\142\141\163\x65\137\143\x75\x72\162\145\x6e\x63\171\137\143\157\x64\x65" => $baseCurrencyCode, "\x63\x68\x61\x6e\156\x65\154\137\143\x75\x72\x72\x65\156\143\x79\137\143\x6f\x64\145" => core()->getChannelBaseCurrencyCode(), "\x63\x61\162\x74\x5f\143\x75\x72\162\145\x6e\143\x79\x5f\x63\157\144\x65" => core()->getCurrentCurrencyCode(), "\151\x74\145\x6d\163\x5f\143\157\165\156\x74" => 1, "\151\164\x65\155\163\x5f\161\164\x79" => 1, "\147\162\x61\156\144\x5f\164\x6f\x74\141\154" => $price = $product->price, "\142\141\163\145\x5f\147\x72\141\156\144\x5f\x74\157\164\x61\154" => $price, "\163\x75\142\x5f\164\157\164\141\154" => $price, "\142\x61\x73\145\137\x73\x75\x62\137\x74\x6f\x74\x61\154" => $price, "\x73\x68\151\160\x70\x69\x6e\x67\x5f\x6d\145\x74\x68\x6f\144" => "\146\x72\145\145\137\146\162\x65\x65", "\x63\165\x73\x74\157\x6d\145\162\137\x69\144" => $customer->id, "\x69\163\137\141\x63\164\151\166\x65" => 1, "\143\x75\163\x74\157\x6d\x65\x72\x5f\x65\155\x61\x69\x6c" => $customer->email, "\143\165\163\x74\x6f\x6d\145\162\x5f\x66\151\x72\x73\x74\x5f\156\x61\x6d\145" => $customer->first_name, "\143\165\163\x74\x6f\x6d\145\x72\x5f\x6c\141\x73\164\x5f\x6e\141\x6d\x65" => $customer->last_name)); CartItem::factory()->create(array("\x71\x75\x61\x6e\x74\151\164\171" => $quantity = 1, "\x70\x72\157\x64\x75\x63\x74\137\151\144" => $product->id, "\163\153\165" => $product->sku, "\x6e\x61\155\x65" => $product->name, "\x74\171\x70\x65" => $product->type, "\x63\141\162\164\137\x69\x64" => $cart->id, "\160\162\x69\143\145" => $convertedPrice = core()->convertPrice($price), "\142\141\163\x65\137\x70\x72\151\143\x65" => $price, "\164\157\x74\x61\x6c" => $convertedPrice * $quantity, "\142\x61\x73\x65\137\x74\x6f\164\141\154" => $price * $quantity, "\167\145\151\x67\x68\x74" => $product->weight ?? 0, "\x74\x6f\164\141\154\137\167\x65\x69\x67\x68\x74" => ($product->weight ?? 0) * $quantity, "\142\141\x73\145\x5f\164\x6f\x74\x61\154\137\167\145\x69\147\150\x74" => ($product->weight ?? 0) * $quantity, "\x61\x64\x64\151\x74\151\x6f\156\x61\154" => array("\161\x75\141\x6e\x74\x69\x74\x79" => $quantity, "\x70\162\157\144\x75\x63\164\137\151\x64" => $product->id))); CustomerAddress::factory()->create(array("\x63\x75\163\164\157\155\x65\162\137\151\x64" => $customer->id, "\x61\144\x64\162\x65\163\x73\137\164\x79\160\145" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\141\x72\x74\137\151\144" => $cart->id, "\143\x75\x73\x74\x6f\x6d\x65\162\137\x69\x64" => $customer->id, "\141\144\x64\162\x65\163\x73\x5f\x74\x79\160\x65" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\143\141\x72\x74\137\x69\144" => $cart->id, "\x63\x75\163\x74\157\155\x65\162\x5f\151\x64" => $customer->id, "\141\144\x64\x72\145\x73\x73\137\164\x79\160\145" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\145\x74\x68\x6f\x64" => $paymentMethod = "\143\x61\163\150\157\x6e\144\x65\154\x69\x76\x65\162\x79", "\155\145\x74\x68\x6f\x64\137\x74\151\164\154\145" => core()->getConfigData("\163\x61\154\145\x73\56\x70\141\171\x6d\145\156\164\137\x6d\145\164\x68\157\144\163\x2e" . $paymentMethod . "\56\x74\x69\x74\x6c\145"), "\x63\141\x72\164\137\x69\144" => $cart->id)); CartShippingRate::factory()->create(array("\x63\141\162\162\x69\x65\162" => "\146\162\145\145", "\x63\141\x72\x72\x69\145\162\x5f\164\151\x74\154\145" => "\106\162\x65\145\x20\163\x68\x69\160\160\x69\x6e\147", "\155\145\164\150\x6f\144" => "\146\162\x65\x65\137\x66\162\145\145", "\x6d\145\164\150\x6f\x64\x5f\x74\x69\x74\154\145" => "\106\x72\145\145\40\123\x68\x69\x70\x70\151\x6e\x67", "\x6d\145\164\150\157\x64\x5f\144\145\x73\x63\162\151\x70\164\151\157\156" => "\x46\x72\145\x65\40\x53\x68\x69\160\x70\x69\156\x67", "\x63\141\162\x74\137\141\144\x64\x72\145\x73\x73\137\151\x64" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\x63\x61\x72\x74\x5f\x69\144" => $cart->id, "\x63\165\163\164\157\x6d\145\x72\x5f\x69\144" => $customer->id, "\x63\x75\163\x74\x6f\155\x65\x72\137\145\x6d\141\x69\x6c" => $customer->email, "\x63\x75\163\164\157\155\x65\x72\x5f\x66\151\162\163\164\x5f\156\141\x6d\145" => $customer->first_name, "\x63\165\x73\x74\x6f\x6d\145\x72\137\154\x61\x73\164\x5f\156\x61\155\x65" => $customer->last_name)); OrderItem::factory()->create(array("\x70\x72\157\144\x75\143\x74\x5f\x69\x64" => $product->id, "\x6f\162\x64\145\162\137\151\144" => $order->id, "\x73\x6b\165" => $product->sku, "\x74\x79\160\145" => $product->type, "\x6e\141\155\x65" => $product->name)); OrderPayment::factory()->create(array("\x6f\x72\144\x65\x72\137\151\144" => $order->id)); OrderAddress::factory()->create(array("\157\162\x64\145\162\x5f\x69\x64" => $order->id, "\143\x61\162\164\x5f\x69\x64" => $cart->id, "\x61\144\x64\162\145\x73\x73\137\x74\x79\160\145" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\x6f\x72\x64\145\162\137\151\x64" => $order->id, "\x63\x61\162\164\x5f\x69\x64" => $cart->id, "\x61\144\144\x72\145\163\163\x5f\x74\171\160\145" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("\141\x64\155\x69\x6e\56\x73\141\x6c\145\x73\56\x6f\162\144\x65\162\163\x2e\143\141\156\143\x65\x6c", $order->id))->assertRedirect(route("\x61\144\x6d\x69\x6e\56\163\141\154\x65\163\56\x6f\162\x64\145\x72\x73\56\166\151\145\x77", $order->id))->isRedirection(); $this->assertModelWise(array(Order::class => array(array("\x69\x64" => $order->id, "\163\164\141\x74\x75\163" => "\x63\141\156\x63\x65\154\145\x64")))); }); goto e3Q7J; dALT2: it("\163\150\x6f\x75\x6c\144\40\143\157\155\155\145\x6e\164\x20\164\x6f\x20\164\150\x65\40\157\x72\144\x65\162", function () { $product = (new ProductFaker(array("\x61\164\164\162\151\x62\165\164\x65\163" => array(5 => "\x6e\145\167"), "\141\x74\x74\162\x69\142\165\164\145\137\166\141\154\165\145" => array("\x6e\145\167" => array("\x62\x6f\157\154\145\x61\156\x5f\x76\141\154\165\145" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\x63\150\x61\156\x6e\x65\x6c\137\151\x64" => core()->getCurrentChannel()->id, "\x67\154\157\x62\x61\x6c\137\x63\165\x72\x72\145\x6e\143\x79\137\143\157\x64\x65" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\x62\x61\163\145\137\x63\x75\x72\162\x65\x6e\143\x79\137\143\x6f\x64\x65" => $baseCurrencyCode, "\143\150\x61\x6e\156\x65\154\x5f\x63\165\x72\x72\145\156\143\171\x5f\x63\x6f\144\145" => core()->getChannelBaseCurrencyCode(), "\143\x61\162\x74\x5f\x63\165\162\162\145\x6e\143\x79\x5f\143\157\144\x65" => core()->getCurrentCurrencyCode(), "\x69\x74\x65\x6d\x73\x5f\143\157\165\x6e\x74" => 1, "\x69\x74\145\x6d\163\x5f\161\164\x79" => 1, "\147\x72\x61\156\144\x5f\x74\x6f\164\x61\x6c" => $price = $product->price, "\142\x61\x73\145\x5f\x67\162\x61\x6e\x64\x5f\x74\x6f\x74\141\154" => $price, "\163\165\142\x5f\x74\157\x74\141\x6c" => $price, "\x62\x61\x73\x65\137\163\x75\x62\x5f\x74\157\164\x61\x6c" => $price, "\163\150\151\x70\x70\x69\156\147\x5f\155\x65\164\x68\x6f\x64" => "\x66\x72\145\x65\137\146\x72\x65\145", "\x63\165\163\164\x6f\x6d\x65\162\x5f\151\144" => $customer->id, "\151\x73\x5f\x61\x63\x74\x69\166\x65" => 1, "\x63\x75\x73\164\x6f\x6d\x65\x72\x5f\x65\155\x61\151\x6c" => $customer->email, "\143\x75\163\164\x6f\x6d\x65\x72\137\146\x69\162\x73\x74\x5f\156\x61\155\x65" => $customer->first_name, "\143\x75\x73\164\x6f\155\x65\162\137\154\x61\x73\x74\137\x6e\141\155\x65" => $customer->last_name)); CartItem::factory()->create(array("\161\x75\141\156\164\x69\x74\x79" => $quantity = 1, "\160\x72\x6f\x64\x75\x63\x74\137\151\x64" => $product->id, "\x73\x6b\x75" => $product->sku, "\x6e\x61\x6d\x65" => $product->name, "\164\x79\160\145" => $product->type, "\143\141\x72\164\x5f\x69\144" => $cart->id, "\x70\162\151\x63\x65" => $convertedPrice = core()->convertPrice($price), "\142\141\163\x65\137\x70\x72\x69\x63\x65" => $price, "\x74\x6f\x74\x61\x6c" => $convertedPrice * $quantity, "\x62\x61\163\145\137\164\157\164\x61\x6c" => $price * $quantity, "\x77\x65\151\147\x68\x74" => $product->weight ?? 0, "\x74\157\x74\x61\154\x5f\167\145\151\x67\x68\x74" => ($product->weight ?? 0) * $quantity, "\x62\141\163\x65\x5f\164\x6f\x74\141\x6c\x5f\x77\x65\151\147\x68\164" => ($product->weight ?? 0) * $quantity, "\x61\x64\x64\151\x74\x69\x6f\x6e\141\154" => array("\161\165\141\x6e\x74\151\x74\171" => $quantity, "\160\162\157\x64\x75\x63\164\x5f\x69\144" => $product->id))); CustomerAddress::factory()->create(array("\x63\x75\x73\164\x6f\x6d\x65\162\137\x69\144" => $customer->id, "\141\x64\144\x72\145\x73\x73\x5f\164\x79\x70\x65" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\141\162\164\x5f\x69\x64" => $cart->id, "\x63\x75\163\164\157\x6d\145\162\x5f\151\144" => $customer->id, "\x61\144\x64\162\x65\x73\x73\137\x74\171\160\145" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\143\x61\162\x74\x5f\x69\144" => $cart->id, "\143\x75\163\x74\157\x6d\x65\x72\137\x69\x64" => $customer->id, "\x61\x64\144\x72\145\163\x73\x5f\x74\x79\x70\x65" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\145\x74\x68\x6f\144" => $paymentMethod = "\143\x61\163\150\x6f\x6e\144\145\154\151\x76\x65\x72\171", "\155\145\164\x68\157\x64\137\x74\x69\164\154\145" => core()->getConfigData("\x73\x61\x6c\145\163\x2e\x70\141\x79\155\145\x6e\x74\x5f\x6d\x65\164\x68\157\144\x73\56" . $paymentMethod . "\x2e\x74\151\164\x6c\x65"), "\x63\141\x72\x74\x5f\151\144" => $cart->id)); CartShippingRate::factory()->create(array("\x63\x61\162\x72\x69\145\162" => "\x66\x72\x65\x65", "\x63\141\162\162\x69\x65\162\137\164\x69\x74\x6c\x65" => "\106\x72\145\145\x20\x73\x68\x69\x70\160\x69\156\147", "\155\x65\164\150\x6f\144" => "\146\162\x65\145\x5f\146\x72\x65\145", "\x6d\x65\164\150\157\144\137\x74\x69\164\x6c\145" => "\x46\x72\145\x65\40\123\x68\x69\160\x70\x69\156\x67", "\155\145\164\x68\157\x64\x5f\x64\145\163\143\162\151\x70\164\x69\x6f\x6e" => "\x46\162\145\x65\x20\x53\150\151\x70\160\151\x6e\147", "\143\141\162\x74\137\141\x64\x64\x72\145\x73\163\x5f\151\144" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\143\x61\162\164\137\x69\144" => $cart->id, "\143\x75\x73\x74\157\x6d\x65\x72\x5f\x69\144" => $customer->id, "\x63\165\163\x74\x6f\x6d\x65\162\137\145\155\x61\x69\154" => $customer->email, "\143\x75\163\x74\157\x6d\x65\162\x5f\146\x69\162\163\x74\x5f\156\141\155\145" => $customer->first_name, "\143\x75\x73\x74\157\x6d\145\162\x5f\x6c\141\163\164\x5f\x6e\141\x6d\x65" => $customer->last_name)); OrderItem::factory()->create(array("\160\x72\x6f\144\165\143\x74\x5f\151\144" => $product->id, "\157\x72\x64\145\x72\137\151\144" => $order->id, "\163\x6b\165" => $product->sku, "\164\171\160\x65" => $product->type, "\x6e\x61\x6d\x65" => $product->name)); OrderPayment::factory()->create(array("\x6f\x72\144\145\x72\137\x69\x64" => $order->id)); OrderAddress::factory()->create(array("\x6f\x72\144\x65\162\137\x69\x64" => $order->id, "\x63\x61\162\164\137\x69\x64" => $cart->id, "\141\x64\144\x72\x65\163\x73\x5f\x74\171\160\x65" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\157\162\144\x65\x72\137\x69\x64" => $order->id, "\143\141\162\x74\x5f\x69\144" => $cart->id, "\x61\x64\144\x72\145\163\x73\x5f\x74\171\x70\145" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("\x61\x64\x6d\x69\156\56\x73\x61\154\x65\x73\x2e\x6f\162\144\145\162\163\x2e\x63\x6f\x6d\155\145\156\164", $order->id), array("\x63\x6f\x6d\155\x65\156\x74" => $comment = fake()->word()))->assertRedirect(route("\141\144\155\x69\156\56\163\141\154\145\x73\56\x6f\162\x64\145\x72\x73\56\166\151\145\x77", $order->id))->isRedirection(); $this->assertModelWise(array(OrderComment::class => array(array("\x6f\162\144\145\x72\x5f\151\x64" => $order->id, "\x63\157\x6d\x6d\145\x6e\x74" => $comment)))); }); goto qO6FH; LyyYe: it("\163\150\157\165\x6c\x64\40\x67\x69\166\x65\40\166\x61\x6c\151\x64\x61\164\151\157\x6e\40\x65\x72\x72\157\162\40\x77\150\145\156\x20\x73\164\157\x72\x65\40\164\x68\145\40\143\157\x6d\x6d\145\x6e\164\40\164\157\40\x74\x68\x65\x20\x6f\x72\144\145\x72", function () { $product = (new ProductFaker(array("\141\x74\x74\162\151\x62\165\x74\145\x73" => array(5 => "\156\x65\x77"), "\141\164\x74\x72\x69\142\165\164\x65\x5f\x76\141\154\165\145" => array("\156\x65\167" => array("\142\x6f\157\154\x65\141\x6e\x5f\166\141\154\x75\x65" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\x63\150\141\156\x6e\x65\x6c\137\x69\x64" => core()->getCurrentChannel()->id, "\147\154\x6f\x62\141\x6c\137\143\165\162\162\145\156\x63\171\x5f\x63\157\x64\x65" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\x62\x61\163\x65\x5f\143\165\x72\x72\x65\156\x63\x79\137\143\157\x64\x65" => $baseCurrencyCode, "\143\150\141\x6e\156\x65\x6c\137\x63\x75\162\162\x65\156\x63\x79\x5f\x63\x6f\x64\145" => core()->getChannelBaseCurrencyCode(), "\x63\141\x72\x74\x5f\143\x75\x72\x72\145\x6e\x63\171\x5f\x63\x6f\x64\145" => core()->getCurrentCurrencyCode(), "\x69\164\145\155\163\137\143\x6f\x75\156\x74" => 1, "\x69\164\x65\155\163\137\161\164\171" => 1, "\147\x72\x61\156\144\x5f\x74\157\x74\x61\154" => $price = $product->price, "\x62\x61\163\145\x5f\147\x72\x61\156\144\x5f\x74\x6f\x74\x61\x6c" => $price, "\x73\x75\142\x5f\164\x6f\164\141\x6c" => $price, "\x62\x61\x73\145\x5f\x73\165\142\x5f\x74\157\164\x61\154" => $price, "\x73\150\151\x70\160\151\156\x67\x5f\x6d\x65\x74\x68\157\x64" => "\x66\162\145\x65\x5f\x66\162\145\x65", "\143\165\163\164\x6f\155\145\x72\137\x69\144" => $customer->id, "\151\163\137\x61\143\x74\151\166\145" => 1, "\143\165\x73\x74\157\x6d\x65\162\x5f\x65\155\141\151\154" => $customer->email, "\143\165\163\164\157\155\145\162\137\146\x69\x72\x73\x74\137\x6e\x61\x6d\x65" => $customer->first_name, "\x63\165\x73\164\x6f\155\145\162\137\x6c\x61\x73\164\x5f\x6e\141\155\145" => $customer->last_name)); CartItem::factory()->create(array("\161\165\141\x6e\x74\x69\164\171" => $quantity = 1, "\x70\x72\x6f\144\165\143\164\137\151\x64" => $product->id, "\163\153\165" => $product->sku, "\156\141\155\x65" => $product->name, "\x74\x79\160\145" => $product->type, "\x63\141\x72\164\137\x69\144" => $cart->id, "\x70\x72\151\143\x65" => $convertedPrice = core()->convertPrice($price), "\x62\x61\163\x65\x5f\x70\162\151\143\145" => $price, "\x74\157\x74\x61\x6c" => $convertedPrice * $quantity, "\x62\x61\x73\x65\137\x74\x6f\x74\141\154" => $price * $quantity, "\x77\x65\x69\147\150\164" => $product->weight ?? 0, "\164\157\x74\x61\154\137\x77\145\151\x67\x68\164" => ($product->weight ?? 0) * $quantity, "\x62\141\x73\145\137\164\157\164\x61\154\x5f\167\145\151\147\x68\x74" => ($product->weight ?? 0) * $quantity, "\x61\144\144\x69\x74\151\157\156\x61\x6c" => array("\x71\165\x61\156\x74\151\164\x79" => $quantity, "\160\x72\157\x64\165\143\x74\137\x69\x64" => $product->id))); CustomerAddress::factory()->create(array("\143\x75\x73\x74\x6f\155\145\162\137\x69\144" => $customer->id, "\141\144\x64\162\145\163\x73\x5f\x74\171\x70\x65" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\x63\141\x72\x74\x5f\x69\144" => $cart->id, "\143\x75\163\164\157\x6d\x65\162\x5f\151\144" => $customer->id, "\x61\144\144\162\145\163\x73\x5f\x74\171\160\x65" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\143\141\162\164\137\151\x64" => $cart->id, "\143\x75\x73\164\x6f\x6d\145\162\137\x69\144" => $customer->id, "\141\x64\144\x72\145\163\x73\137\164\x79\x70\145" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\x65\164\x68\157\x64" => $paymentMethod = "\x63\141\x73\150\x6f\x6e\x64\x65\154\x69\166\145\162\171", "\x6d\x65\x74\x68\x6f\144\x5f\x74\x69\x74\x6c\145" => core()->getConfigData("\x73\141\154\145\163\x2e\160\x61\171\x6d\x65\x6e\164\137\x6d\x65\x74\x68\x6f\x64\163\56" . $paymentMethod . "\x2e\164\x69\x74\154\x65"), "\x63\141\162\164\x5f\151\x64" => $cart->id)); CartShippingRate::factory()->create(array("\x63\x61\x72\162\x69\x65\x72" => "\146\x72\x65\145", "\x63\x61\x72\x72\151\x65\162\137\x74\151\164\x6c\145" => "\106\162\145\145\40\x73\150\151\x70\160\x69\x6e\x67", "\x6d\x65\164\150\x6f\144" => "\146\162\145\x65\137\146\x72\145\x65", "\155\145\x74\x68\x6f\x64\137\164\151\164\154\x65" => "\106\x72\145\x65\x20\123\x68\151\x70\x70\x69\156\147", "\x6d\145\x74\150\x6f\x64\x5f\144\x65\x73\143\162\x69\x70\x74\151\x6f\x6e" => "\x46\162\145\145\x20\x53\x68\x69\160\160\151\x6e\x67", "\143\x61\x72\x74\x5f\x61\144\144\162\145\163\x73\x5f\151\144" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\x63\x61\162\164\x5f\x69\x64" => $cart->id, "\x63\165\x73\x74\157\155\145\162\137\x69\x64" => $customer->id, "\x63\x75\x73\x74\x6f\x6d\x65\x72\137\x65\x6d\141\x69\x6c" => $customer->email, "\x63\x75\x73\x74\157\x6d\x65\162\x5f\146\x69\x72\x73\x74\x5f\156\141\x6d\x65" => $customer->first_name, "\x63\x75\163\x74\x6f\155\145\x72\137\x6c\x61\x73\164\x5f\156\141\155\145" => $customer->last_name)); OrderItem::factory()->create(array("\160\x72\157\144\165\143\x74\x5f\x69\144" => $product->id, "\x6f\162\144\x65\162\137\151\144" => $order->id, "\163\153\x75" => $product->sku, "\x74\171\x70\145" => $product->type, "\156\x61\155\145" => $product->name)); OrderPayment::factory()->create(array("\157\162\144\145\162\137\x69\144" => $order->id)); OrderAddress::factory()->create(array("\157\162\144\x65\x72\x5f\151\144" => $order->id, "\143\141\x72\x74\137\x69\x64" => $cart->id, "\x61\x64\144\x72\145\x73\x73\137\x74\171\160\145" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\x6f\x72\x64\x65\x72\137\x69\144" => $order->id, "\x63\x61\x72\164\x5f\x69\x64" => $cart->id, "\141\x64\x64\x72\145\x73\x73\137\x74\171\160\x65" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("\141\x64\x6d\151\156\x2e\x73\141\x6c\145\x73\x2e\x6f\x72\144\145\x72\163\56\143\x6f\x6d\155\145\x6e\x74", $order->id))->assertJsonValidationErrorFor("\143\x6f\x6d\155\x65\x6e\x74")->assertUnprocessable(); }); goto dALT2; e3Q7J: it("\x73\150\x6f\165\154\x64\x20\143\x61\x6e\143\x65\x6c\x20\164\x68\x65\40\x6f\x72\144\x65\162\x20\x61\156\144\x20\x73\x65\156\144\x20\164\150\145\40\x6e\x6f\x74\151\146\x69\143\x61\164\x69\157\x6e\x20\x74\x6f\40\164\150\x65\x20\x63\x75\x73\x74\157\x6d\145\x72", function () { Mail::fake(); CoreConfig::factory()->create(array("\143\157\144\x65" => "\145\155\x61\151\154\163\x2e\147\x65\x6e\145\162\141\x6c\x2e\156\157\x74\151\146\x69\143\141\164\151\157\156\x73\56\145\x6d\x61\x69\x6c\163\x2e\x67\x65\156\145\x72\141\154\x2e\156\x6f\164\151\146\x69\143\141\164\151\157\156\x73\x2e\x63\141\x6e\143\x65\x6c\137\157\x72\x64\145\x72", "\166\141\x6c\165\x65" => 1)); CoreConfig::factory()->create(array("\143\x6f\144\145" => "\145\155\141\x69\x6c\x73\56\x67\x65\x6e\x65\162\141\x6c\x2e\x6e\x6f\164\x69\x66\151\143\x61\x74\151\157\156\163\56\x65\155\141\x69\x6c\x73\56\x67\145\x6e\x65\x72\x61\154\56\156\157\164\151\146\151\143\141\x74\x69\x6f\156\x73\56\x63\x61\156\x63\145\x6c\137\x6f\162\x64\x65\x72", "\166\x61\154\x75\145" => 1)); $product = (new ProductFaker(array("\141\164\164\162\151\142\165\164\x65\x73" => array(5 => "\156\145\167"), "\x61\164\164\x72\151\142\x75\x74\x65\137\166\141\154\x75\145" => array("\x6e\x65\x77" => array("\142\x6f\x6f\x6c\145\141\156\137\166\x61\x6c\165\145" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\143\x68\x61\x6e\156\x65\154\x5f\x69\x64" => core()->getCurrentChannel()->id, "\147\x6c\x6f\142\x61\154\x5f\143\x75\x72\162\x65\156\143\171\x5f\143\157\x64\145" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\x62\141\x73\145\137\x63\x75\x72\x72\145\156\143\x79\137\x63\x6f\x64\x65" => $baseCurrencyCode, "\143\150\x61\x6e\156\145\154\x5f\143\x75\x72\162\145\x6e\143\x79\137\x63\x6f\x64\x65" => core()->getChannelBaseCurrencyCode(), "\143\x61\162\x74\137\143\165\162\x72\145\x6e\143\x79\x5f\143\157\x64\x65" => core()->getCurrentCurrencyCode(), "\x69\164\x65\x6d\163\137\x63\x6f\x75\156\164" => 1, "\x69\164\145\155\163\137\x71\x74\x79" => 1, "\x67\162\x61\x6e\144\x5f\164\157\x74\141\x6c" => $price = $product->price, "\142\x61\x73\x65\x5f\147\162\141\x6e\x64\x5f\164\x6f\164\141\154" => $price, "\163\x75\142\137\164\x6f\x74\x61\154" => $price, "\142\x61\x73\145\x5f\x73\165\x62\x5f\164\x6f\164\141\x6c" => $price, "\163\x68\151\160\x70\x69\156\147\137\155\x65\164\x68\x6f\144" => "\146\x72\145\x65\x5f\x66\x72\x65\145", "\x63\165\x73\x74\157\155\145\162\x5f\151\144" => $customer->id, "\x69\163\137\141\143\x74\x69\166\145" => 1, "\x63\x75\163\164\x6f\155\145\162\137\145\x6d\x61\x69\x6c" => $customer->email, "\x63\165\x73\x74\157\x6d\x65\162\137\146\151\162\x73\x74\x5f\156\x61\155\x65" => $customer->first_name, "\x63\x75\x73\164\x6f\155\145\x72\137\x6c\141\163\164\137\156\141\x6d\145" => $customer->last_name)); CartItem::factory()->create(array("\x71\165\x61\156\x74\151\x74\x79" => $quantity = 1, "\160\x72\157\x64\165\143\164\137\151\x64" => $product->id, "\163\x6b\165" => $product->sku, "\156\141\x6d\x65" => $product->name, "\164\x79\160\x65" => $product->type, "\143\141\x72\164\137\151\x64" => $cart->id, "\160\162\x69\143\145" => $convertedPrice = core()->convertPrice($price), "\142\141\x73\145\137\160\162\151\143\x65" => $price, "\x74\x6f\164\x61\154" => $convertedPrice * $quantity, "\x62\141\163\x65\x5f\164\x6f\x74\141\x6c" => $price * $quantity, "\167\145\151\x67\x68\164" => $product->weight ?? 0, "\x74\157\x74\x61\x6c\137\167\x65\151\x67\150\x74" => ($product->weight ?? 0) * $quantity, "\142\141\x73\x65\x5f\164\157\164\x61\x6c\x5f\167\x65\x69\147\150\x74" => ($product->weight ?? 0) * $quantity, "\141\x64\x64\151\x74\151\157\x6e\x61\x6c" => array("\x71\165\141\156\164\x69\164\x79" => $quantity, "\160\162\x6f\144\x75\x63\x74\x5f\x69\144" => $product->id))); CustomerAddress::factory()->create(array("\x63\165\x73\x74\157\155\145\162\x5f\x69\144" => $customer->id, "\x61\144\144\x72\x65\163\163\137\x74\171\x70\145" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\x61\x72\164\x5f\151\x64" => $cart->id, "\143\x75\x73\164\x6f\155\145\162\137\151\144" => $customer->id, "\141\x64\144\x72\145\x73\163\137\164\x79\x70\145" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\x63\x61\162\164\137\151\144" => $cart->id, "\x63\165\163\x74\157\155\145\x72\137\x69\x64" => $customer->id, "\x61\x64\x64\x72\x65\x73\x73\137\164\x79\x70\x65" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\x65\164\150\x6f\144" => $paymentMethod = "\x63\141\x73\150\157\156\x64\x65\154\151\x76\145\162\x79", "\155\x65\164\150\157\x64\x5f\164\x69\x74\154\x65" => core()->getConfigData("\163\x61\154\145\163\x2e\x70\x61\171\155\x65\156\x74\x5f\x6d\x65\x74\x68\x6f\144\163\56" . $paymentMethod . "\56\164\151\x74\154\145"), "\x63\x61\162\x74\137\x69\144" => $cart->id)); CartShippingRate::factory()->create(array("\143\141\x72\x72\151\145\162" => "\146\x72\145\x65", "\143\x61\x72\x72\x69\x65\162\137\x74\x69\164\x6c\145" => "\106\x72\x65\145\40\x73\x68\x69\x70\x70\x69\156\x67", "\x6d\145\164\150\x6f\x64" => "\146\x72\x65\x65\x5f\146\x72\x65\145", "\155\145\164\150\x6f\144\x5f\164\x69\x74\154\x65" => "\106\162\145\x65\40\123\x68\x69\160\160\x69\x6e\x67", "\155\145\164\x68\157\x64\x5f\144\145\163\x63\162\x69\160\x74\151\x6f\156" => "\106\162\x65\x65\40\x53\150\x69\x70\160\x69\156\147", "\x63\141\x72\164\137\141\x64\x64\x72\x65\163\163\x5f\x69\x64" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\x63\x61\x72\164\x5f\x69\x64" => $cart->id, "\x63\165\x73\164\x6f\x6d\145\x72\137\x69\x64" => $customer->id, "\x63\x75\163\x74\157\155\145\162\x5f\145\155\141\151\154" => $customer->email, "\143\x75\x73\164\x6f\x6d\x65\x72\137\146\151\x72\163\x74\x5f\x6e\141\155\x65" => $customer->first_name, "\143\x75\163\164\x6f\155\145\x72\x5f\154\x61\x73\164\137\156\x61\x6d\145" => $customer->last_name)); OrderItem::factory()->create(array("\x70\162\157\144\x75\x63\x74\137\x69\144" => $product->id, "\157\162\144\145\x72\137\x69\x64" => $order->id, "\x73\153\165" => $product->sku, "\164\x79\x70\x65" => $product->type, "\x6e\x61\x6d\x65" => $product->name)); OrderPayment::factory()->create(array("\157\162\x64\145\x72\137\x69\x64" => $order->id)); OrderAddress::factory()->create(array("\x6f\x72\x64\x65\x72\137\151\144" => $order->id, "\x63\141\x72\164\x5f\151\144" => $cart->id, "\141\144\x64\162\145\x73\x73\137\164\x79\160\145" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\157\x72\144\145\162\137\x69\x64" => $order->id, "\143\x61\x72\164\x5f\151\144" => $cart->id, "\141\x64\144\162\x65\163\x73\137\164\x79\x70\x65" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); postJson(route("\x61\144\155\x69\156\56\163\141\154\145\163\56\x6f\x72\x64\x65\162\x73\x2e\143\x61\156\143\x65\x6c", $order->id))->assertRedirect(route("\141\x64\155\x69\x6e\56\x73\x61\154\145\163\x2e\157\x72\x64\x65\x72\163\x2e\x76\151\x65\167", $order->id))->isRedirection(); $this->assertModelWise(array(Order::class => array(array("\x69\x64" => $order->id, "\163\164\x61\x74\x75\163" => "\143\141\x6e\143\x65\x6c\145\144")))); Mail::assertQueued(ShopOrderCanceledNotification::class); Mail::assertQueued(AdminOrderCanceledNotification::class); Mail::assertQueuedCount(2); }); goto LyyYe; lE5TJ: it("\x73\150\x6f\x75\154\144\40\x72\x65\164\x75\162\x6e\40\164\150\145\40\x69\156\144\145\170\40\160\141\x67\x65\40\x6f\x66\x20\x4f\x72\144\x65\162\163\40\x70\x61\147\x65", function () { $this->loginAsAdmin(); get(route("\x61\x64\x6d\x69\156\56\163\141\154\x65\x73\56\157\162\144\x65\162\163\56\151\156\144\145\x78"))->assertOk()->assertSeeText(trans("\x61\x64\x6d\151\156\72\72\x61\x70\x70\x2e\163\141\154\145\163\x2e\x6f\x72\144\x65\162\x73\56\x69\x6e\x64\x65\170\x2e\x74\x69\x74\x6c\x65")); }); goto oHmrR; ZI17z: it("\163\x68\x6f\x75\154\x64\x20\163\x65\x61\x72\143\150\40\x74\150\x65\40\157\x72\144\145\x72", function () { $product = (new ProductFaker(array("\x61\164\164\162\151\x62\x75\x74\x65\163" => array(5 => "\156\145\167"), "\x61\x74\x74\162\x69\142\165\164\x65\x5f\x76\x61\x6c\x75\145" => array("\156\x65\167" => array("\x62\x6f\157\x6c\x65\141\156\x5f\166\141\154\165\145" => true)))))->getSimpleProductFactory()->create(); $customer = Customer::factory()->create(); $cart = Cart::factory()->create(array("\x63\150\141\x6e\x6e\145\154\137\x69\x64" => core()->getCurrentChannel()->id, "\147\154\157\x62\141\154\x5f\x63\165\x72\162\x65\156\x63\x79\137\x63\157\144\x65" => $baseCurrencyCode = core()->getBaseCurrencyCode(), "\142\x61\x73\x65\x5f\x63\x75\x72\162\145\156\143\x79\137\143\157\x64\x65" => $baseCurrencyCode, "\143\150\141\156\156\x65\154\137\143\x75\162\162\145\x6e\x63\x79\137\143\157\144\x65" => core()->getChannelBaseCurrencyCode(), "\143\x61\162\164\137\x63\x75\x72\x72\x65\x6e\143\x79\x5f\x63\x6f\144\145" => core()->getCurrentCurrencyCode(), "\x69\x74\145\155\163\137\x63\x6f\165\156\164" => 1, "\x69\164\x65\x6d\x73\137\161\164\171" => 1, "\x67\x72\x61\x6e\144\x5f\164\157\164\141\154" => $price = $product->price, "\142\x61\x73\145\137\147\x72\x61\x6e\144\137\x74\157\x74\141\154" => $price, "\163\x75\x62\x5f\x74\x6f\164\141\x6c" => $price, "\x62\x61\163\x65\137\163\x75\x62\137\164\157\164\141\154" => $price, "\163\x68\151\x70\x70\151\x6e\x67\137\155\x65\x74\150\157\144" => "\146\162\x65\x65\137\146\x72\x65\145", "\x63\x75\163\164\x6f\x6d\145\x72\137\151\x64" => $customer->id, "\151\x73\x5f\141\x63\164\x69\166\145" => 1, "\143\x75\x73\164\x6f\x6d\x65\162\137\x65\x6d\141\x69\154" => $customer->email, "\x63\x75\x73\164\157\155\x65\x72\x5f\146\x69\x72\163\164\x5f\x6e\x61\x6d\x65" => $customer->first_name, "\143\165\x73\164\x6f\155\x65\x72\137\154\141\x73\164\137\156\x61\x6d\145" => $customer->last_name)); CartItem::factory()->create(array("\161\165\141\156\164\x69\x74\171" => $quantity = 1, "\x70\x72\157\x64\165\x63\x74\137\151\x64" => $product->id, "\x73\x6b\x75" => $product->sku, "\156\x61\x6d\x65" => $product->name, "\164\x79\160\145" => $product->type, "\143\x61\x72\164\137\151\144" => $cart->id, "\x70\x72\151\143\x65" => $convertedPrice = core()->convertPrice($price), "\x62\141\163\x65\x5f\x70\x72\x69\x63\x65" => $price, "\164\157\x74\x61\x6c" => $convertedPrice * $quantity, "\142\141\163\x65\137\x74\157\x74\x61\x6c" => $price * $quantity, "\x77\x65\151\147\150\164" => $product->weight ?? 0, "\164\x6f\164\141\154\x5f\167\145\x69\x67\150\164" => ($product->weight ?? 0) * $quantity, "\x62\141\163\x65\137\164\157\x74\x61\x6c\x5f\167\145\x69\147\x68\164" => ($product->weight ?? 0) * $quantity, "\141\144\x64\x69\x74\151\x6f\156\141\x6c" => array("\x71\x75\x61\156\x74\x69\164\171" => $quantity, "\x70\x72\x6f\144\x75\x63\164\x5f\151\x64" => $product->id))); CustomerAddress::factory()->create(array("\143\x75\x73\x74\x6f\x6d\145\162\137\151\x64" => $customer->id, "\x61\x64\x64\x72\145\x73\x73\x5f\x74\171\x70\x65" => CustomerAddress::ADDRESS_TYPE)); $cartBillingAddress = CartAddress::factory()->create(array("\143\141\162\x74\137\x69\x64" => $cart->id, "\x63\165\x73\x74\x6f\155\x65\x72\x5f\151\x64" => $customer->id, "\x61\144\144\x72\145\x73\163\x5f\x74\171\x70\145" => CartAddress::ADDRESS_TYPE_BILLING)); CartAddress::factory()->create(array("\143\141\x72\x74\x5f\151\x64" => $cart->id, "\x63\x75\x73\164\157\x6d\145\162\x5f\x69\144" => $customer->id, "\x61\144\x64\162\x65\163\x73\137\x74\x79\x70\x65" => CartAddress::ADDRESS_TYPE_SHIPPING)); CartPayment::factory()->create(array("\x6d\x65\x74\x68\157\x64" => $paymentMethod = "\143\141\163\x68\157\x6e\x64\145\154\151\x76\145\x72\x79", "\155\145\x74\x68\x6f\x64\137\164\x69\x74\x6c\145" => core()->getConfigData("\163\141\154\145\163\56\160\x61\x79\x6d\x65\x6e\x74\137\155\x65\164\x68\x6f\x64\163\56" . $paymentMethod . "\x2e\x74\151\164\x6c\x65"), "\143\x61\x72\164\x5f\x69\x64" => $cart->id)); CartShippingRate::factory()->create(array("\x63\141\162\x72\x69\145\162" => "\146\x72\145\145", "\x63\141\x72\x72\151\x65\x72\137\164\151\164\x6c\x65" => "\106\x72\145\x65\x20\x73\x68\151\160\160\x69\x6e\x67", "\x6d\x65\x74\150\x6f\x64" => "\146\x72\145\145\137\146\x72\x65\145", "\155\x65\164\x68\x6f\144\137\164\x69\164\x6c\x65" => "\106\162\145\145\x20\123\x68\151\x70\160\x69\x6e\147", "\x6d\x65\x74\150\157\144\x5f\144\145\x73\143\162\x69\x70\x74\151\x6f\x6e" => "\106\x72\x65\x65\40\x53\150\x69\160\160\151\156\147", "\143\141\x72\x74\137\x61\x64\144\162\x65\x73\x73\x5f\x69\144" => $cartBillingAddress->id)); $order = Order::factory()->create(array("\143\x61\162\164\x5f\151\144" => $cart->id, "\143\x75\x73\x74\x6f\155\x65\x72\x5f\x69\x64" => $customer->id, "\143\165\163\164\x6f\x6d\145\162\x5f\x65\x6d\x61\x69\x6c" => $customer->email, "\143\x75\x73\164\x6f\x6d\145\162\x5f\x66\x69\x72\x73\164\x5f\x6e\x61\x6d\x65" => $customer->first_name, "\x63\165\x73\x74\x6f\155\x65\162\137\154\x61\x73\x74\137\156\141\x6d\145" => $customer->last_name)); OrderItem::factory()->create(array("\160\162\157\144\165\x63\164\137\x69\144" => $product->id, "\157\x72\x64\145\162\x5f\151\x64" => $order->id, "\x73\x6b\165" => $product->sku, "\x74\x79\x70\x65" => $product->type, "\156\141\x6d\145" => $product->name)); OrderPayment::factory()->create(array("\x6f\x72\x64\145\x72\137\x69\x64" => $order->id)); OrderAddress::factory()->create(array("\157\x72\144\x65\162\137\151\144" => $order->id, "\x63\x61\162\x74\x5f\151\x64" => $cart->id, "\x61\x64\144\x72\x65\x73\x73\x5f\164\x79\160\145" => OrderAddress::ADDRESS_TYPE_BILLING)); OrderAddress::factory()->create(array("\157\162\x64\x65\x72\x5f\x69\144" => $order->id, "\x63\x61\x72\164\137\x69\144" => $cart->id, "\141\x64\144\162\x65\163\163\x5f\164\171\160\x65" => OrderAddress::ADDRESS_TYPE_SHIPPING)); $this->loginAsAdmin(); get(route("\x61\144\155\151\x6e\56\x73\x61\x6c\x65\x73\56\x6f\x72\x64\145\x72\x73\x2e\x73\145\141\x72\143\150"), array("\x71\x75\145\162\171" => fake()->randomElement(array("\x70\x65\156\x64\x69\x6e\147", "\143\157\x6d\x70\154\145\164\x65\144", "\x70\162\x6f\x63\145\x73\163\151\x6e\x67"))))->assertOk()->assertJsonPath("\160\141\x74\x68", route("\141\x64\x6d\151\x6e\x2e\163\141\154\x65\163\56\157\162\x64\145\x72\x73\56\x73\x65\x61\x72\x63\150"))->assertJsonPath("\x64\141\164\141\56\60\56\151\x64", $order->id)->assertJsonPath("\x64\141\164\141\56\x30\x2e\x73\164\141\164\165\x73", $order->status)->assertJsonPath("\144\141\x74\x61\x2e\x30\x2e\143\x75\x73\x74\x6f\155\x65\162\137\145\155\141\151\154", $order->customer_email); });

Function Calls

None

Variables

None

Stats

MD5 87be6690b1d78f475c73f4e75732d93d
Eval Count 0
Decode Time 98 ms