laybuy / Magento-2-Latest

2 stars 9 forks source link

Order email long laybuy_order_id pushes everything to the right. #19

Closed LiamKarlMitchell closed 4 years ago

LiamKarlMitchell commented 4 years ago

Suggest to store laybuy_order_id as what is actually shown on the Laybuy Merchant screen.

Model/Laybuy.php

    /**
     * @param \Magento\Sales\Model\Order $order
     * @param $txnId
     */
    public function updatePayment(\Magento\Sales\Model\Order $order, $txnId)
    {
        $payment = $order->getPayment();
        $payment->setTransactionId($txnId);
        $parts = explode('_', $txnId);
        $laybuyOrderId = $parts[0];
        $payment->setAdditionalInformation('laybuy_order_id', $laybuyOrderId);
        $payment->save();
    }

laybuy_grand_total also seems to be pointless it is not used?

If the point is to use these for storing data to later be refunded, maybe it could store it in attributes so that they are not visible on the order emails e.g. $payment->setTransactionId is already set.

E.g. 9501271_maO03gjAYudBieBud3N0Axpalj1OR4M22G3Tqt1P

If you only set the number, it takes up much less space horizontally and the email will look okay. image

LiamKarlMitchell commented 4 years ago

Ok I take that back, laybuy_order_id appears to be used in the Response.php in a condition for ACTION_AUTHORIZE_CAPTURE, LAYBUY_SUCCESS to confirm the price matches.