This seems logical if you think about the Paypal payment process: after the checkout you are redirected to the Paypal website for the purchase. This is not possible in a situation, where you are creating an order for a customer, because you do not have his password (e.g. if you talk with the customer on the phone or in person in your local store). This is a general issue for all payment options like Paypal like Sofort.com, Klarna, Billsafe and so on.
But with a little workaround, you can easily let your customers pay with Paypal while you are ordering for him in the Magento Backend.
The solution
We are adding a Backend Payment method which is called "Paypal" with no further program logic. This ensures, the order and invoice information shows the correct payment method.![]() |
BackendPayment provides payment methods like cash, debit and Paypal |
For the developers
It is easy to provide a new payment method which is only available in the admin panel and not on the customers checkout. Just create a new module with the default folders and configuration for at least models, blocks and helpers.The first thing you need is a model which looks like the following (you have to change class names to your correct namespace):
/**
* Grafzahl_BackendPayments
*
* @category Grafzahl
* @package Grafzahl_BackendPayments
* @copyright Copyright (c) 2016 Grafzahl (https://grafzahl.io)
* @license https://grafzahl.io/license
*/
class Grafzahl_BackendPayments_Model_PaypalPayment
extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'backendpayments_paypal';
protected $_infoBlockType = 'backendpayments/info';
protected $_canUseInternal = true;
protected $_canUseCheckout = false;
protected $_canUseForMultishipping = false;
public function __construct()
{
parent::__construct();
}
}
* Grafzahl_BackendPayments
*
* @category Grafzahl
* @package Grafzahl_BackendPayments
* @copyright Copyright (c) 2016 Grafzahl (https://grafzahl.io)
* @license https://grafzahl.io/license
*/
class Grafzahl_BackendPayments_Model_PaypalPayment
extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'backendpayments_paypal';
protected $_infoBlockType = 'backendpayments/info';
protected $_canUseInternal = true;
protected $_canUseCheckout = false;
protected $_canUseForMultishipping = false;
public function __construct()
{
parent::__construct();
}
}
The second thing is to create the related block from the model in the attribute $_infoBlockType. The block just needs to extend the block Mage_Payment_Block_Info. Now check the extending block and update the methods to your needs.
No comments:
Post a Comment