1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* InterKassa driver for the Omnipay PHP payment processing library |
5
|
|
|
* |
6
|
|
|
* @link https://github.com/hiqdev/omnipay-interkassa |
7
|
|
|
* @package omnipay-interkassa |
8
|
|
|
* @license MIT |
9
|
|
|
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Omnipay\InterKassa\Message; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class OldPurchaseRequest |
16
|
|
|
* Implements request for APIv1. |
17
|
|
|
*/ |
18
|
|
|
class OldPurchaseRequest extends AbstractRequest |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @return string |
22
|
|
|
*/ |
23
|
|
|
public function getBaggageFields() |
24
|
|
|
{ |
25
|
|
|
return $this->getCurrency(); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* {@inheritdoc} |
30
|
|
|
*/ |
31
|
3 |
|
public function getData() |
32
|
|
|
{ |
33
|
3 |
|
$this->validate('checkoutId', 'amount', 'currency', 'description', 'transactionId'); |
34
|
|
|
|
35
|
|
|
$return = [ |
36
|
3 |
|
'ik_shop_id' => $this->getCheckoutId(), |
37
|
3 |
|
'ik_payment_amount' => $this->getAmount(), |
38
|
3 |
|
'ik_payment_id' => $this->getTransactionId(), |
39
|
3 |
|
'ik_payment_desc' => $this->getDescription(), |
40
|
3 |
|
]; |
41
|
|
|
|
42
|
3 |
|
if ($ik_success_url = $this->getReturnUrl()) { |
43
|
3 |
|
$return['ik_success_url'] = $ik_success_url; |
44
|
3 |
|
$return['ik_success_method'] = $this->getReturnMethod(); |
45
|
3 |
|
} |
46
|
|
|
|
47
|
3 |
|
if ($ik_fail_method = $this->getCancelUrl()) { |
48
|
3 |
|
$return['ik_fail_url'] = $ik_fail_method; |
49
|
3 |
|
$return['ik_fail_method'] = $this->getCancelMethod(); |
50
|
3 |
|
} |
51
|
|
|
|
52
|
3 |
|
if ($ik_status_url = $this->getNotifyUrl()) { |
53
|
3 |
|
$return['ik_status_url'] = $ik_status_url; |
54
|
3 |
|
$return['ik_status_method'] = $this->getNotifyMethod(); |
55
|
3 |
|
} |
56
|
|
|
|
57
|
3 |
|
return $return; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* {@inheritdoc} |
62
|
|
|
* @param mixed $data |
63
|
|
|
* @return PurchaseResponse |
64
|
|
|
*/ |
65
|
2 |
|
public function sendData($data) |
66
|
|
|
{ |
67
|
2 |
|
return $this->response = new PurchaseResponse($this, $data); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|