Skip to content

Instantly share code, notes, and snippets.

View mrkhoa99's full-sized avatar
🎯
Don't repeat yourself

Mr Khoa mrkhoa99

🎯
Don't repeat yourself
View GitHub Profile
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.cart.totals">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="block-totals" xsi:type="array">
<item name="children" xsi:type="array">
<item name="before_grandtotal" xsi:type="array">
<item name="children" xsi:type="array">
class Totals extends \Magento\Framework\View\Element\Template
{
/**
* @var \Magento\Sales\Model\Order
*/
protected $_order;
/**
* @var \Magento\Framework\DataObject
@mrkhoa99
mrkhoa99 / GMO Payment Gateway Magento 2
Created July 19, 2016 10:48
The API does not return error messages, so I translated these from the example english-like messages in the GMO documentation
#Resource reference: https://docs.omniref.com/github/veracross/active_merchant/HEAD/symbols/ActiveMerchant::Billing::GmoGateway#line=46
# The API does not return error messages, so I translated these from the
# example english-like messages in the GMO documentation
ERROR_CODES = {
'E01010001' => 'Shop ID not specified',
'E01010008' => 'Shop ID contains invalid characters or is too long',
'E01010010' => 'Shop ID is invalid',
'E01020001' => 'Shop Password not specified',
'E01020008' => 'Shop Password contains invalid characters or is too long',
'E01030002' => 'Shop ID and Password are invalid',