Hot answers tagged

29 votes
Accepted

How to enable error and exception logging in Magento2?

Go inside root pub/errors folder, Just copy local.xml.sample to local.xml Also you can enable display_errors from app/bootstrap.php file. At line no. 11 remove # from the start of the line. Now the ...
16 votes

No 'online refund' in Magento2?

There are two ways to do this: 1 - Partial Refund in Braintree Login in to the braintreepayments website Do a transaction search and find the transaction Click the transaction ID to open Press ...
  • 533
11 votes
Accepted

Insert image at the side of payment label on checkout

There are two ways to do this. Both require some work on your theme/template. This is the quick & dirty way and works great if you want to have your image(s) BEFORE the Payment Method name: ...
  • 722
10 votes
Accepted

magento 2 - No Payment Methods

Same issue for me so i have Create checkout_index_index XML file and put to below location theme/Magento_Checkout/layout/override/base/checkout_index_index.xml and Put Below Content in your XML file. ...
  • 1,286
9 votes

after run bin/magento setup:upgrade got the error

Deleting var/generation, var/cache and var/di solved it for me.
9 votes
Accepted

Magento 2.1 Payment Method

initialize: Instantiate state and set it to state object. Method that will be executed instead of authorize or capture if flag isInitializeNeeded set to true. validate: Validate payment method ...
8 votes

New order status staying "pending" instead of processing in Magento 2

We can assign the New Order Status. I will give some basic info: Login to Magento Admin > STORES > Configuration > SALES > Payment Methods > Choose the Payment, you will see the config for the New ...
6 votes
Accepted

Custom payment method like purchase order

have a look at https://github.com/luemic/Magento-Custom-PurchaseOrder which adds a second purchase order payment method. In fact most of the configration is copied from the original purchase method. ...
  • 494
6 votes

How to get SID in magento

You can get the session ID with the below code: $session = Mage::getSingleton('core/session'); $SID = $session->getEncryptedSessionId(); //current session id You can easily get session-id from ...
  • 76.6k
6 votes

Payment module redirect to payment website url in magento2

To create payment module i used below payment module creator: http://cedcommerce.com/magento-2-payment-module-creator Then, for redirection, below is code replaced in app\code\YOUR_NAME_SPACE\...
6 votes

Find Magento 2 API Username to use in Paypal

You'll go into the Profile of the account and request the API Signature that you'll copy and paste into Magento 2. From your PayPal business steps: Tools > All Tools > API Credentials, you'll ...
  • 61
6 votes

Magento2: How to add a payment method to admin create order?

At first, your payment method should be available for usage in Admin panel and you need to specify can_use_internal property in your payment method YourCustomPayment/etc/config.xml file: <payment&...
  • 2,519
6 votes

Shipping Address Missing on Payment Page Refresh

Core file path: vendor/magento/module-checkout/view/frontend/web/js/checkout-data.js Overwrite To: app/design/frontend/VendorName/ThemeName/Magento_Checkout/web/js/checkout-data.js Copy below code ...
  • 1,076
6 votes
Accepted

What is the purpose of the public_hash in Magento 2 payment vault?

The public_hash is used to reference the card from untrusted sources (like on checkout). It gives each card a unique non-sequential identifier that can't be readily guessed, to help curb any possible ...
  • 12.1k
6 votes

Magento cannot override Mage_Payment_Model_Method_Cc.php file

Explanation is easy here. There is a class Mage_Payment_Model_Method_Cc which has a lot of methods. The other class Mage_Payment_Model_Method_Ccsave is extended from it. It has few protected ...
  • 3,838
5 votes
Accepted

refund customer's money through magento site [credit memo ]

From the invoice you want to Refund, click the Credit Memo button. Specify the Qty to Refund and then click the Update Qty's button. Create credit memo You should then see the refund button.
5 votes
Accepted

Payment methods "Wrong content type" after upgrade Magento from 1.6 to 1.9.1.1

As you may have noticed in the given source code, the exception is thrown because null is not an allowed value for $contentType. $contentType is read from the system configuration: $contentType = $...
  • 2,943
5 votes

Got error: CRITICAL: Broken reference: No element found with ID 'checkout.header.wrapper'

I solved this warning message in Magento 2.1.1: Open your file (override file not in vendor) checkout_index_index.xml. In line equals: <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
5 votes

Magento 2.1 Payment Method

It's as deprecated approach to extend \Magento\Payment\Model\Method\AbstractMethod, instead, you should use Magento payment gateway. You can find the step-by-step guide how to implement payment ...
  • 2,519
5 votes
Accepted

Magento cannot override Mage_Payment_Model_Method_Cc.php file

I tried lot of ways finally i got the solution. config.xml <?xml version="1.0"?> <config> <modules> <Naveed_Abbas> <version>0.1.0</version> ...
  • 976
5 votes
Accepted

Magento 2 + Reason behind deprecation of payment method class

Magento provides new way for payment integrations - Magento Payment Provider Gateway. The \Magento\Payment\Model\Method\AbstractMethod is too complicated for customization, requires using inheritance ...
  • 2,519
5 votes
Accepted

Get payment method

Try this code: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId[0]); $payment = $order->...
  • 9,612
5 votes

How to override js functions which is inside the return in magento 2(mixins)

app/code/SR/Stackexchange/view/frontend/requirejs-config.js var config = { config: { mixins: { 'Magento_Checkout/js/model/payment-service': { 'SR_Stackexchange/...
5 votes
Accepted

Magento2 : How to get active payment methods list store wise

class ABC{ protected $paymentMethodList; public function __construct( \Magento\Payment\Model\PaymentMethodList $paymentMethodList ) { $this->paymentMethodList = $...
4 votes

Magento Fatal error: Call to a member function getMethodInstance() on a non-object in app/code/core/Mage/Payment/Model/Observer.php on line 46

Please check if the payment module redirects you to an insecure page (http://). If you're using https in the checkout and the module redirects to a non-secure redirect page, Magento will throw you ...
4 votes

displaying certain payment methods for customer groups

In Magento 2 Let’s create a module. Step 1) Create folders like this. app/code/Pits/PaymentMethod/etc/ app/code/Pits/PaymentMethod/Observer/ Step 2) Declare your module app/code/Pits/PaymentMethod/...
4 votes

Magento Fatal error: Call to a member function getMethodInstance() on a non-object in app/code/core/Mage/Payment/Model/Observer.php on line 46

If order is loaded by loadByIncrementId($orderId) and orderId is not valid, $order->save() will then cause this exact error. Check anywhere in code where an order is being saved, thus causing the ...
  • 428
4 votes

Authorize.net Direct Post hash validation failed

The answer of philwinkle is fine. In my case additionally the md5-hash which I had set in authorize.net and Magento was too long. It caused a different hash calculation in ...
4 votes
Accepted

Which Payment Methods meets payment security standard?

I'm not an expert on PCI compliance by any standard but I've had to deal with it a lot over the years. It has been the subject of debate at work several times. I think people carelessly throw the ...
  • 2,824
4 votes

Convert quote to order generating empty order

One general remark here: You're trying to set the full customer session object (Mage::getSingleton('customer/session')) as the quote's customer. You should do Mage::getSingleton('customer/session')-&...
  • 7,422

Only top scored, non community-wiki answers of a minimum length are eligible