Hi guys,
I am trying to build an online store using Swipestripe.
I have the payment and the payment-cheque modules installed correctly but I keep getting this error when I try to check out.
<code>
User Error] Method Cheque not defined in factory
GET /checkout/
Line 50 in /Users/ada/Sites/clevermash/payment/code/PaymentProcessor.php
Source
41 * @return array
42 */
43 public static function get_supported_methods() {
44 $methodConfig = Config::inst()->get('PaymentProcessor', 'supported_methods');
45 $environment = PaymentGateway::get_environment();
46
47 // Check if all methods are defined in factory
48 foreach ($methodConfig[$environment] as $method) {
49 if (! PaymentFactory::get_factory_config($method)) {
50 user_error("Method $method not defined in factory", E_USER_ERROR);
51 }
52 }
53 return $methodConfig[$environment];
54 }
55
56 /**
Trace
Method Cheque not defined in factory
PaymentProcessor.php:50
PaymentProcessor::get_supported_methods()
OrderForm.php:134
OrderForm->createFields()
OrderForm.php:39
OrderForm->__construct(CheckoutPage_Controller,OrderForm)
ReflectionClass->newInstanceArgs(Array)
InjectionCreator.php:17
InjectionCreator->create(OrderForm,Array)
Injector.php:548
Injector->instantiate(Array)
Injector.php:857
Injector->get(OrderForm,,Array)
Injector.php:894
Injector->createWithArgs(OrderForm,Array)
Object.php:142
Object::create(CheckoutPage_Controller,OrderForm)
CheckoutPage.php:143
CheckoutPage_Controller->OrderForm()
CheckoutPage.php:131
CheckoutPage_Controller->index(SS_HTTPRequest)
RequestHandler.php:288
RequestHandler->handleAction(SS_HTTPRequest,index)
Controller.php:194
Controller->handleAction(SS_HTTPRequest,index)
RequestHandler.php:200
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:153
Controller->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:198
ContentController->handleRequest(SS_HTTPRequest,DataModel)
ModelAsController.php:78
ModelAsController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:370
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:153
Director::direct(/checkout/,DataModel)
main.php:177
</code>
I am guessing the problem may be from my config.yaml, it looks like this
<code>
---
Name: mysite
After:
- 'framework/*'
- 'cms/*'
---
# YAML configuration for SilverStripe
# See http://doc.silverstripe.org/framework/en/topics/configuration
# Caution: Indentation through two spaces, not tabs
SSViewer:
theme: 'simple'
PaymentGateway:
environment:
'dev'
PaymentProcessor:
supported_methods:
dev:
- 'Cheque'
live:
- 'Cheque'
</code>
I don't know what else to do.