Created
March 19, 2019 07:31
-
-
Save cergey-obr/2da5cbb95f0e940754e2774568dbb34f to your computer and use it in GitHub Desktop.
Bill with payments os
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function billAction() | |
{ | |
/** @var Glassesusa_Sales_Model_Order $order */ | |
$order = Mage::getModel('sales/order')->load(136); | |
if (!$order->getId() && $order->isHto() | |
&& $order->getStatus() !== Glassesusa_Sales_Model_Order::STATUS_HTO_PERIOD_OVER) { | |
Mage::throwException('Order not available for billing'); | |
} | |
/** @var Glassesusa_Sales_Model_Order_Payment $payment */ | |
$payment = $order->getPayment(); | |
$payment->setData([ | |
'method' => 'ms_paymentsos', | |
'token' => getenv('MS_PAYMENTSOS_TOKEN'), | |
]); | |
$payment->save(); | |
$payment->place(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment