本文整理汇总了PHP中Magento\Sales\Model\Order\Payment::getBaseAmountAuthorized方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::getBaseAmountAuthorized方法的具体用法?PHP Payment::getBaseAmountAuthorized怎么用?PHP Payment::getBaseAmountAuthorized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Sales\Model\Order\Payment
的用法示例。
在下文中一共展示了Payment::getBaseAmountAuthorized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPlaceActionAuthorizeCapture
public function testPlaceActionAuthorizeCapture()
{
$newOrderStatus = 'new_status';
$customerNote = 'blabla';
$sum = 10;
$this->orderMock->expects($this->any())->method('getTotalDue')->willReturn($sum);
$this->orderMock->expects($this->any())->method('getBaseTotalDue')->willReturn($sum);
$this->helperMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($this->paymentMethodMock));
$this->paymentMethodMock->expects($this->once())->method('getConfigPaymentAction')->willReturn(\Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE);
$this->paymentMethodMock->expects($this->any())->method('getConfigData')->with('order_status', null)->willReturn($newOrderStatus);
$statusHistory = $this->getMockForAbstractClass('Magento\\Sales\\Api\\Data\\OrderStatusHistoryInterface');
$this->invoiceMock->expects($this->once())->method('register')->willReturnSelf();
$this->invoiceMock->expects($this->once())->method('capture')->willReturnSelf();
$this->paymentMethodMock->expects($this->once())->method('canCapture')->willReturn(true);
$this->orderMock->expects($this->any())->method('prepareInvoice')->willReturn($this->invoiceMock);
$this->orderMock->expects($this->once())->method('addRelatedObject')->with($this->invoiceMock);
$this->orderMock->expects($this->any())->method('getCustomerNote')->willReturn($customerNote);
$this->orderMock->expects($this->any())->method('addStatusHistoryComment')->with($customerNote)->willReturn($statusHistory);
$this->mockGetDefaultStatus(Order::STATE_PROCESSING, $newOrderStatus, ['first', 'second']);
$this->orderMock->expects($this->any())->method('setState')->with(Order::STATE_PROCESSING)->willReturnSelf();
$this->orderMock->expects($this->any())->method('setStatus')->with($newOrderStatus)->willReturnSelf();
$this->paymentMethodMock->expects($this->once())->method('getConfigPaymentAction')->willReturn(null);
$this->assertEquals($this->payment, $this->payment->place());
$this->assertEquals($this->invoiceMock, $this->payment->getCreatedInvoice());
$this->assertEquals($sum, $this->payment->getAmountAuthorized());
$this->assertEquals($sum, $this->payment->getBaseAmountAuthorized());
}
示例2: getBaseAmountAuthorized
/**
* {@inheritdoc}
*/
public function getBaseAmountAuthorized()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getBaseAmountAuthorized');
if (!$pluginInfo) {
return parent::getBaseAmountAuthorized();
} else {
return $this->___callPlugins('getBaseAmountAuthorized', func_get_args(), $pluginInfo);
}
}