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 ...
Rakesh Jesadiya's user avatar
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 ...
Rudi's user avatar
  • 533
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. ...
Nikul's user avatar
  • 1,306
9 votes

after run bin/magento setup:upgrade got the error

Deleting var/generation, var/cache and var/di solved it for me.
Kaushal Suthar's user avatar
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 ...
Sohel Rana's user avatar
  • 35.6k
9 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 ...
Khoa TruongDinh's user avatar
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\...
Pradeep Kumar's user avatar
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 ...
Owen L.'s user avatar
  • 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&...
joni jones's user avatar
  • 2,539
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 ...
ManiMaran A's user avatar
  • 1,126
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 ...
Ryan Hoerr's user avatar
  • 12.2k
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 ...
zhartaunik's user avatar
  • 3,848
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"...
Matt Silva's user avatar
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 ...
joni jones's user avatar
  • 2,539
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> ...
Ramesh's user avatar
  • 986
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 ...
joni jones's user avatar
  • 2,539
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->...
Abdul's user avatar
  • 9,702
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/...
Sohel Rana's user avatar
  • 35.6k
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 = $...
Padhiyar Gaurang's user avatar
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/...
Divya Muralidharan's user avatar
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 ...
Goose's user avatar
  • 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 ...
ahe_borriglione's user avatar
4 votes
Accepted

Magento 2 Custom Admin Credit Card Form

To me I think you should use the setMethodFormTemplate from \Magento\Payment\Block\Form\Container.php: public function setMethodFormTemplate($method = '', $template = '') { if (!empty($method) &...
Raphael at Digital Pianism's user avatar
4 votes

How to save the custom field data in payment section magento 2 to payment related table?

you can use sales_order_invoice_save_after(if you want to be sure the order is paid) or checkout_onepage_controller_success_action (after order success ) config.xml <config xmlns:xsi="http://www....
Vishwas Bhatnagar's user avatar
4 votes
Accepted

Magento 2 get customer by payment id

Let's say you need to get this in a class. And that class is Vendor\Module\Model\MyClass. Make your class look like this: namespace Vendor\Module\Model; class MyClass { protected $...
Marius's user avatar
  • 198k
4 votes
Accepted

Magento2 : Credit card validations on a custom form not working

For Credit card validations to work you need to have input with value as card type <input type="hidden" value="" id="cc_type"> //value can VI,MC,AI,DN as per card entered <input id="ccno" ...
Vishwas Bhatnagar's user avatar
4 votes
Accepted

Check if a payment method is online or offline

Please take a look at Magento\Payment\Model\MethodInterface::isOffline() :)
sv3n's user avatar
  • 11.6k
3 votes
Accepted

Prevent Magento to empty cart after failed payments

In your payment method's controller you'll have an action for failed/rejected/canceled orders. Let's say it's called failAction(). Then you can add something like the following to your function. ...
Yiorgos Moschovitis's user avatar
3 votes

Magento 2 - Custom payment module

Redirection can be maintained by place order button handler. For example please refer to Paypal Express checkout integration, here are several components required: Payment Method form template - ...
Dmytro Kvashnin's user avatar
3 votes
Accepted

Get Payment Update button not connecting to Authorize.net

I finally found a solution after struggling for a good long time. Solution (At least for me) Login to your merchant account on authorize.net Click 'Account' Tab along top Under 'Security Settings' ...
dmartin's user avatar
  • 46

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