|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ByTIC\Payments\Gateways\Providers\PlatiOnline; |
|
4
|
|
|
|
|
5
|
|
|
use ByTIC\Payments\Gateways\Providers\AbstractGateway\Form as AbstractForm; |
|
6
|
|
|
use ByTIC\Payments\Models\Methods\Types\CreditCards; |
|
7
|
|
|
use Symfony\Component\HttpFoundation\File\UploadedFile; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Class Form |
|
11
|
|
|
* @package ByTIC\Payments\Gateways\Providers\PlatiOnline |
|
12
|
|
|
*/ |
|
13
|
|
|
class Form extends AbstractForm |
|
14
|
|
|
{ |
|
15
|
|
|
public function initElements() |
|
16
|
|
|
{ |
|
17
|
|
|
parent::initElements(); |
|
18
|
|
|
$this->initElementSandbox(); |
|
19
|
|
|
|
|
20
|
|
|
$this->addInput('loginId', 'Login ID', true); |
|
21
|
|
|
$this->addInput('website', 'Website', true); |
|
22
|
|
|
|
|
23
|
|
|
$this->addInput('initialVector', 'Initial Vector', true); |
|
24
|
|
|
$this->addInput('initialVectorItsn', 'Initial Vector Itsn', true); |
|
25
|
|
|
|
|
26
|
|
|
$this->addTextarea('publicKey', 'Public Key', true); |
|
27
|
|
|
|
|
28
|
|
|
$this->addTextarea('privateKey', 'Private key', true); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getDataFromModel() |
|
32
|
|
|
{ |
|
33
|
|
|
$type = $this->getForm()->getModel()->getType(); |
|
34
|
|
|
if ($type instanceof CreditCards) { |
|
|
|
|
|
|
35
|
|
|
$type->getGateway(); |
|
36
|
|
|
} |
|
37
|
|
|
parent::getDataFromModel(); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @return bool |
|
42
|
|
|
*/ |
|
43
|
|
|
public function process() |
|
44
|
|
|
{ |
|
45
|
|
|
parent::process(); |
|
46
|
|
|
|
|
47
|
|
|
$model = $this->getForm()->getModel(); |
|
48
|
|
|
$options = $model->getPaymentGatewayOptions(); |
|
49
|
|
|
$model->setPaymentGatewayOptions($options); |
|
50
|
|
|
$model->saveRecord(); |
|
51
|
|
|
|
|
52
|
|
|
return $options; |
|
|
|
|
|
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|