|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* This file is part of the Marlon Ogone package. |
|
4
|
|
|
* |
|
5
|
|
|
* (c) Marlon BVBA <[email protected]> |
|
6
|
|
|
* |
|
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
8
|
|
|
* file that was distributed with this source code. |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Ogone\Ecommerce; |
|
12
|
|
|
|
|
13
|
|
|
use Ogone\AbstractPaymentRequest; |
|
14
|
|
|
use Ogone\DirectLink\PaymentOperation; |
|
15
|
|
|
use Ogone\ShaComposer\ShaComposer; |
|
16
|
|
|
|
|
17
|
|
|
class EcommercePaymentRequest extends AbstractPaymentRequest |
|
18
|
|
|
{ |
|
19
|
|
|
|
|
20
|
|
|
const TEST = "https://secure.ogone.com/ncol/test/orderstandard_utf8.asp"; |
|
21
|
|
|
const PRODUCTION = "https://secure.ogone.com/ncol/prod/orderstandard_utf8.asp"; |
|
22
|
|
|
|
|
23
|
54 |
|
public function __construct(ShaComposer $shaComposer) |
|
24
|
|
|
{ |
|
25
|
54 |
|
$this->shaComposer = $shaComposer; |
|
26
|
54 |
|
$this->ogoneUri = self::TEST; |
|
27
|
54 |
|
} |
|
28
|
|
|
|
|
29
|
7 |
|
public function getRequiredFields() |
|
30
|
|
|
{ |
|
31
|
|
|
return array( |
|
32
|
7 |
|
'pspid', 'currency', 'amount', 'orderid' |
|
33
|
|
|
); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
6 |
|
public function getValidOgoneUris() |
|
37
|
|
|
{ |
|
38
|
6 |
|
return array(self::TEST, self::PRODUCTION); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function setAlias(Alias $alias) |
|
42
|
|
|
{ |
|
43
|
|
|
$this->parameters['aliasOperation'] = $alias->getAliasOperation(); |
|
44
|
|
|
$this->parameters['aliasusage'] = $alias->getAliasUsage(); |
|
45
|
|
|
$this->parameters['alias'] = $alias->getAlias(); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
protected function getValidOperations() |
|
49
|
|
|
{ |
|
50
|
|
|
return array( |
|
51
|
|
|
PaymentOperation::REQUEST_FOR_AUTHORISATION, |
|
52
|
|
|
PaymentOperation::REQUEST_FOR_DIRECT_SALE, |
|
53
|
|
|
PaymentOperation::REQUEST_FOR_PRE_AUTHORISATION, |
|
54
|
|
|
); |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|