We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit f54b3df6 authored by Rik ter Beek's avatar Rik ter Beek

#67 set paybymail payments in pending mode so they can be cancelled

parent 85d9a6d7
...@@ -66,16 +66,20 @@ class PayByMailCommand implements CommandInterface ...@@ -66,16 +66,20 @@ class PayByMailCommand implements CommandInterface
*/ */
public function execute(array $commandSubject) public function execute(array $commandSubject)
{ {
$stateObject = \Magento\Payment\Gateway\Helper\SubjectReader::readStateObject($commandSubject);
$payment =\Magento\Payment\Gateway\Helper\SubjectReader::readPayment($commandSubject); $payment =\Magento\Payment\Gateway\Helper\SubjectReader::readPayment($commandSubject);
$payment = $payment->getPayment(); $payment = $payment->getPayment();
// do not let magento set status to processing // do not let magento set status to processing
$payment->setIsTransactionPending(true); $payment->setIsTransactionPending(true);
// generateUrl // generateUrl
$payment->setAdditionalInformation('payment_url', $this->_generatePaymentUrl($payment)); $payment->setAdditionalInformation('payment_url', $this->_generatePaymentUrl($payment));
// update status and state
$stateObject->setState(\Magento\Sales\Model\Order::STATE_NEW);
$stateObject->setStatus($this->_adyenHelper->getAdyenAbstractConfigData('order_status'));
$stateObject->setIsNotified(false);
return $this; return $this;
} }
......
...@@ -160,10 +160,10 @@ ...@@ -160,10 +160,10 @@
<allowspecific>0</allowspecific> <allowspecific>0</allowspecific>
<sort_order>6</sort_order> <sort_order>6</sort_order>
<session_validity>3</session_validity> <session_validity>3</session_validity>
<payment_action>authorize</payment_action> <payment_action>order</payment_action>
<is_gateway>1</is_gateway> <is_gateway>1</is_gateway>
<can_use_checkout>0</can_use_checkout> <can_use_checkout>0</can_use_checkout>
<can_authorize>1</can_authorize> <can_initialize>1</can_initialize>
<can_capture>1</can_capture> <can_capture>1</can_capture>
<can_capture_partial>1</can_capture_partial> <can_capture_partial>1</can_capture_partial>
<can_use_internal>1</can_use_internal> <can_use_internal>1</can_use_internal>
......
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
<virtualType name="AdyenPaymentPayByMailCommandPool" type="Magento\Payment\Gateway\Command\CommandPool"> <virtualType name="AdyenPaymentPayByMailCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
<arguments> <arguments>
<argument name="commands" xsi:type="array"> <argument name="commands" xsi:type="array">
<item name="authorize" xsi:type="string">Adyen\Payment\Gateway\Command\PayByMailCommand</item> <item name="initialize" xsi:type="string">Adyen\Payment\Gateway\Command\PayByMailCommand</item>
<item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item> <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
<item name="void" xsi:type="string">AdyenPaymentCancelCommand</item> <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
<item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item> <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment