當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Order::total方法代碼示例

本文整理匯總了PHP中app\Order::total方法的典型用法代碼示例。如果您正苦於以下問題:PHP Order::total方法的具體用法?PHP Order::total怎麽用?PHP Order::total使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Order的用法示例。


在下文中一共展示了Order::total方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(Order $order)
 {
     if (!$order) {
         dd('vantar pöntun');
     }
     $this->order = $order;
     $this->testing = false;
     if (env('BORGUN_TEST') == true) {
         $this->site = 'https://test.borgun.is/SecurePay/default.aspx';
         $this->testing = true;
         $this->PaymentGatewayId = '16';
         $this->MerchantId = '9275444';
         $this->SecretKey = '99887766';
     } else {
         $this->site = 'https://securepay.borgun.is/securepay/default.aspx';
         $this->PaymentGatewayId = env('BORGUN_PAYMENTGATEWAYID');
         $this->MerchantId = env('BORGUN_MERCHANTID');
         $this->SecretKey = env('BORGUN_SECRETKEY');
     }
     $this->ReturnUrlSuccess = \Request::root() . '/payment/borgun/success';
     $this->ReturnUrlSuccessServer = \Request::root() . '/payment/borgun/successserver';
     $this->ReturnUrlCancel = \Request::root() . '/payment/borgun/cancel';
     $this->ReturnUrlError = '';
     $this->OrderId = $order->reference;
     $this->Amount = $order->total();
     $this->Currency = 'ISK';
     $this->Language = 'IS';
 }
開發者ID:stjanilofts,項目名稱:cp,代碼行數:28,代碼來源:Borgun.php

示例2: collect

 function test_an_order_is_discounted_by_a_percentage_when_a_percent_off_coupon_is_applied()
 {
     $books = collect([new Book(['price' => 2000]), new Book(['price' => 3000]), new Book(['price' => 4000])]);
     $coupon = new Coupon(['value' => 30, 'is_percent' => true]);
     $order = new Order($books);
     $order->applyCoupon($coupon);
     $this->assertEquals(6300, $order->total());
 }
開發者ID:adamwathan,項目名稱:lets-refactor-zendcon,代碼行數:8,代碼來源:AddCouponToOrderTest.php

示例3: Order

 /** @test */
 function an_order_can_determine_the_total_cost_of_all_its_products()
 {
     $order = new Order();
     $product = new Product('Fallout 4', 59);
     $product2 = new Product('pillowcase', 7);
     $order->add($product);
     $order->add($product2);
     $this->assertEquals(66, $order->total());
 }
開發者ID:pranayaryal,項目名稱:phptesting,代碼行數:10,代碼來源:OrderTest.php


注:本文中的app\Order::total方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。