craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
215 stars 169 forks source link

Not able to use Manual gateway to make payment in CP #881

Closed echantigny closed 5 years ago

echantigny commented 5 years ago

Description

I have a Moneris gateway that works for the front-end part of the site.

I also want the manual gateway in the backend because my client uses that sometimes for phone/onsite orders. I am getting an error trying to make that transaction in the CP.

Steps to reproduce

  1. Have the Manual gateway in the Gateways, but do not enable for Customers during checkout
  2. Create a front-end cart, but don't pay for it.
  3. Go in the CP and try to "Make Payment" with the Manual gateway.
  4. Gateway not allowed error
yii\base\InvalidConfigException: Gateway not allowed. in C:\wamp64\www\Great-Boardgames\vendor\craftcms\commerce\src\elements\Order.php:1546
Stack trace:
#0 C:\wamp64\www\Great-Boardgames\vendor\craftcms\commerce\src\controllers\PaymentsController.php(158): craft\commerce\elements\Order->getGateway()
#1 [internal function]: craft\commerce\controllers\PaymentsController->actionPay()
#2 C:\wamp64\www\Great-Boardgames\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#3 C:\wamp64\www\Great-Boardgames\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 C:\wamp64\www\Great-Boardgames\vendor\craftcms\cms\src\web\Controller.php(109): yii\base\Controller->runAction('pay', Array)
#5 C:\wamp64\www\Great-Boardgames\vendor\yiisoft\yii2\base\Module.php(528): craft\web\Controller->runAction('pay', Array)
#6 C:\wamp64\www\Great-Boardgames\vendor\craftcms\cms\src\web\Application.php(297): yii\base\Module->runAction('commerce/paymen...', Array)
#7 C:\wamp64\www\Great-Boardgames\vendor\craftcms\cms\src\web\Application.php(565): craft\web\Application->runAction('commerce/paymen...', Array)
#8 C:\wamp64\www\Great-Boardgames\vendor\craftcms\cms\src\web\Application.php(281): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#9 C:\wamp64\www\Great-Boardgames\vendor\yiisoft\yii2\base\Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#10 C:\wamp64\www\Great-Boardgames\public_html\index.php(21): yii\base\Application->run()
#11 {main}

Additional info

bossanova808 commented 5 years ago

To piggy back on to this, even if the gateway IS enabled for the back end, and you can therefore get the payment through, the order remains unpaid even after the successful transaction:

image

lukeholder commented 5 years ago

@bossanova808 you are looking at successful 'Authorization' transactions. You need to click 'Capture' to actually account for the money being received, and added towards the total paid.

bossanova808 commented 5 years ago

LOL - ok, I am sure I should know that!

But that language is...not great. Should be 'Receive Payment' really. To match what it is used in order processing/accounting.

echantigny commented 5 years ago

@bossanova808 I'm not sure if this is a regional thing, but authorize and capture are exactly what my payment provider uses too, Moneris.

Authorize means that you have checked if the credit card is valid and can accept the charge, but you did not take any money yet.

Capture means that you take the money right away if the card is valid.

bossanova808 commented 5 years ago

Right - with credit card payments I know that is indeed used (it's still not great language, even if it is commonly used, though!)....but not with manual payments/gateways, which are usually used for things like direct fund transfers and cheques etc. - but I guess given the larger context...sure.

echantigny commented 5 years ago

@bossanova808. Ah, of course. Forgot what this thread was about. We'll, I didn't know that because I can't get to that point. But the manual dummy gateway, the default one, doesn't have those distinctions.

echantigny commented 5 years ago

@lukeholder This looks like it's a configuration issue, but I'm not sure what that config is that's giving me issues. I have the exact same DB on both local and prod servers and it works on prod but not locally. I thought it was because of my commerce-gateways.php file, so I removed it, but the same issue is rising after.

If I pinpoint the issue, I'll update this.

lukeholder commented 5 years ago

Please let me know if you can reproduce and I will reopen.