1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Omnipay\Komerci\Message; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Komerci Authorize Request |
7
|
|
|
*/ |
8
|
|
|
class WSAuthorizeRequest extends WSAbstractRequest |
9
|
|
|
{ |
10
|
|
|
|
11
|
6 |
|
public function getData() |
12
|
|
|
{ |
13
|
6 |
|
$this->validate('amount', 'apikey', 'card'); |
14
|
|
|
|
15
|
|
|
$data = array( |
16
|
6 |
|
'Total' => sprintf("%.2F", round($this->getAmount() * 100) / 100), |
17
|
6 |
|
'Transacao' => '73', // 2-step authorization; |
18
|
6 |
|
'Parcelas' => $this->getFormattedInstallments(), // Docs said it needs to be empty but I am getting an error! |
19
|
6 |
|
'Filiacao' => $this->getApiKey(), |
20
|
6 |
|
'NumPedido' => $this->getTransactionId(), |
21
|
6 |
|
'Nrcartao' => $this->getCard()->getNumber(), |
22
|
6 |
|
'CVC2' => $this->getCard()->getCvv(), |
23
|
6 |
|
'Mes' => $this->getCard()->getExpiryMonth(), |
24
|
6 |
|
'Ano' => $this->getCard()->getExpiryYear(), |
25
|
6 |
|
'Portador' => $this->getCard()->getName(), |
26
|
6 |
|
'IATA' => '', |
27
|
6 |
|
'Distribuidor' => '', |
28
|
6 |
|
'Concentrador' => '', |
29
|
6 |
|
'TaxaEmbarque' => '', |
30
|
6 |
|
'Entrada' => '', |
31
|
6 |
|
'Numdoc1' => '', |
32
|
6 |
|
'Numdoc2' => '', |
33
|
6 |
|
'Numdoc3' => '', |
34
|
6 |
|
'Numdoc4' => '', |
35
|
6 |
|
'Pax1' => '', |
36
|
6 |
|
'Pax2' => '', |
37
|
6 |
|
'Pax3' => '', |
38
|
6 |
|
'Pax4' => '', |
39
|
6 |
|
'ConfTxn' => 'S', |
40
|
|
|
'Add_Data' => '' |
41
|
6 |
|
); |
42
|
|
|
|
43
|
|
|
// The test environment uses 'AddData' and the production environment uses 'Add_Data' |
44
|
6 |
|
if ($this->getTestMode()) { |
45
|
1 |
|
unset($data['Add_Data']); |
46
|
1 |
|
$data['AddData'] = ''; |
47
|
1 |
|
} |
48
|
|
|
|
49
|
6 |
|
return $data; |
50
|
|
|
} |
51
|
|
|
|
52
|
3 |
|
public function sendData($data) |
53
|
|
|
{ |
54
|
3 |
|
$httpResponse = $this->prepareSendData($data, 'GetAuthorized'); |
55
|
3 |
|
return $this->response = new WSAuthorizeResponse($this, $httpResponse->xml()); |
|
|
|
|
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.