Skip to content

Commit

Permalink
Merge pull request #5 from Intrepidity/master
Browse files Browse the repository at this point in the history
Fixes issue #4
  • Loading branch information
Edwin Hermans committed Mar 27, 2014
2 parents 399ff87 + eabde34 commit 302941f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions FormGenerator/SimpleFormGenerator.php
Expand Up @@ -14,11 +14,12 @@

use Ogone\FormGenerator\FormGenerator;
use Ogone\PaymentRequest;
use Ogone\Ecommerce\EcommercePaymentRequest;

class SimpleFormGenerator implements FormGenerator
{
/**
* @var PaymentRequest
* @var EcommercePaymentRequest
*/
private $paymentRequest;

Expand Down Expand Up @@ -52,11 +53,11 @@ public function __construct(Twig_Environment $environment, $rootDir)
}

/**
* @param PaymentRequest $paymentRequest
* @param EcommercePaymentRequest $paymentRequest
*
* @return string
*/
public function render(PaymentRequest $paymentRequest)
public function render(EcommercePaymentRequest $paymentRequest)
{
$this->paymentRequest = $paymentRequest;

Expand Down
10 changes: 6 additions & 4 deletions OgoneManager.php
Expand Up @@ -19,6 +19,8 @@
use Ogone\ParameterFilter\ShaInParameterFilter;
use Ogone\ParameterFilter\ShaOutParameterFilter;
use Ogone\FormGenerator\FormGenerator;
use Ogone\Ecommerce\EcommercePaymentRequest,
Ogone\Ecommerce\EcommercePaymentResponse;

use Snowcap\OgoneBundle\Event\OgoneEvent;

Expand Down Expand Up @@ -127,14 +129,14 @@ public function getRequestForm($locale, $orderId, $customerName, $amount, $curre
$shaComposer = new AllParametersShaComposer($passphrase);
$shaComposer->addParameterFilter(new ShaInParameterFilter); //optional

$paymentRequest = new PaymentRequest($shaComposer);
$paymentRequest = new EcommercePaymentRequest($shaComposer);

switch ($this->environment) {
case 'prod':
$paymentRequest->setOgoneUri(PaymentRequest::PRODUCTION);
$paymentRequest->setOgoneUri(EcommercePaymentRequest::PRODUCTION);
break;
default:
$paymentRequest->setOgoneUri(PaymentRequest::TEST);
$paymentRequest->setOgoneUri(EcommercePaymentRequest::TEST);
break;
}

Expand Down Expand Up @@ -168,7 +170,7 @@ public function getRequestForm($locale, $orderId, $customerName, $amount, $curre
*/
public function paymentResponse(array $parameters)
{
$paymentResponse = new PaymentResponse($parameters);
$paymentResponse = new EcommercePaymentResponse($parameters);

$passphrase = $this->shaOut;
$shaComposer = new AllParametersShaComposer($passphrase);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -27,7 +27,7 @@
"php": ">=5.3.2",
"symfony/framework-bundle": ">=2.2",
"symfony/monolog-bundle": ">=2.2",
"marlon-be/marlon-ogone": "dev-master#a7560e3e446cf93fe9439915a43da202f7bbc01d"
"marlon-be/marlon-ogone": "dev-master"
},
"autoload": {
"psr-0": { "Snowcap\\OgoneBundle": "" }
Expand Down

0 comments on commit 302941f

Please sign in to comment.