当前位置: 首页>>代码示例>>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;未经允许,请勿转载。