-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt Self-Hosted(Magento Storefront) Checkout for RSA. (#35)
* Adapt Self-Hosted(Magento Storefront) Checkout for RSA. * Adapt Self-Hosted(Magento Storefront) Checkout for RSA. * Adapt FireTm Checkout one-step checkout for RSA. * Move refresh and taxes requests to Magento storefront. * Remove requests queues. * Adapt FireTm Checkout one-step checkout for RSA. * Adapt FireTm Checkout one-step checkout for RSA. * Add translation to payment error message. * Remove redundant variables. --------- Co-authored-by: MykolaMalovanets <[email protected]>
- Loading branch information
1 parent
be63888
commit ccc5ee9
Showing
10 changed files
with
525 additions
and
514 deletions.
There are no files selected for viewing
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* Update Magento order payment information. | ||
*/ | ||
class Bold_Checkout_Service_Order_ProcessOrder | ||
{ | ||
/** | ||
* Update order payment. | ||
* | ||
* Due to order is placed on Magento side in case of self-hosted checkout with Magento storefront | ||
* only payment information should be updated. | ||
* | ||
* @param stdClass $payload | ||
* @return Mage_Sales_Model_Order | ||
* @throws Mage_Core_Exception | ||
*/ | ||
public static function process(stdClass $payload) | ||
{ | ||
//todo: implement. | ||
$attempt = 1; | ||
do { | ||
/** @var Bold_Checkout_Model_Order $extOrderData */ | ||
$extOrderData = Mage::getModel(Bold_Checkout_Model_Order::RESOURCE); | ||
$extOrderData->load($payload->order->publicId, Bold_Checkout_Model_Resource_Order::PUBLIC_ID); | ||
$orderId = $extOrderData->getOrderId(); | ||
if (!$orderId) { | ||
$attempt++; | ||
sleep(1); | ||
} | ||
} while (!$orderId && $attempt < 5); | ||
/** @var Mage_Sales_Model_Order $order */ | ||
$order = Mage::getModel('sales/order')->load($extOrderData->getOrderId()); | ||
if (!$order->getId()) { | ||
Mage::throwException(Mage::helper('core')->__('Order not found')); | ||
} | ||
Bold_Checkout_Service_Order_Payment::processPayment( | ||
$order, | ||
$payload->order->payment, | ||
$payload->order->transaction | ||
); | ||
Mage::dispatchEvent('bold_order_process_after', ['order' => $order, 'payload' => $payload]); | ||
return current(Bold_Checkout_Service_Extractor_Order::extract([$order])); | ||
} | ||
} |
Oops, something went wrong.