本文整理汇总了PHP中Magento\Sales\Model\Order\Payment::setIsTransactionPending方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::setIsTransactionPending方法的具体用法?PHP Payment::setIsTransactionPending怎么用?PHP Payment::setIsTransactionPending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Sales\Model\Order\Payment
的用法示例。
在下文中一共展示了Payment::setIsTransactionPending方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAuthorizeTransactionPending
public function testAuthorizeTransactionPending()
{
$storeID = 1;
$amount = 10;
$baseCurrencyMock = $this->getMockBuilder('Magento\\Directory\\Model\\Currency')->disableOriginalConstructor()->setMethods(['formatTxt'])->getMock();
$baseCurrencyMock->expects($this->once())->method('formatTxt')->willReturnCallback(function ($value) {
return $value;
});
$this->orderMock->expects($this->once())->method('getStoreId')->willReturn($storeID);
$this->orderMock->expects($this->once())->method('getBaseGrandTotal')->willReturn($amount);
$this->orderMock->expects($this->once())->method('getBaseCurrency')->willReturn($baseCurrencyMock);
$this->orderMock->expects($this->once())->method('setState')->with(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW, true, "We will authorize {$amount} after the payment is approved at the payment gateway.");
$this->paymentMethodMock->expects($this->once())->method('authorize')->with($this->payment)->willReturnSelf();
$this->payment->setIsTransactionPending(true);
$paymentResult = $this->payment->authorize(true, $amount);
$this->assertInstanceOf('Magento\\Sales\\Model\\Order\\Payment', $paymentResult);
$this->assertEquals($amount, $paymentResult->getBaseAmountAuthorized());
$this->assertTrue($paymentResult->getIsTransactionPending());
}
示例2: setIsTransactionPending
/**
* {@inheritdoc}
*/
public function setIsTransactionPending($flag)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'setIsTransactionPending');
if (!$pluginInfo) {
return parent::setIsTransactionPending($flag);
} else {
return $this->___callPlugins('setIsTransactionPending', func_get_args(), $pluginInfo);
}
}