1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* InterKassa driver for the Omnipay PHP payment processing library |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/omnipay-interkassa |
6
|
|
|
* @package omnipay-interkassa |
7
|
|
|
* @license MIT |
8
|
|
|
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Omnipay\InterKassa\Message; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* InterKassa Complete Purchase Response |
15
|
|
|
* Implements response for APIv1. |
16
|
|
|
*/ |
17
|
|
|
class OldCompletePurchaseResponse extends CompletePurchaseResponse |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* The checkout ID. |
21
|
|
|
* |
22
|
|
|
* @return string |
23
|
|
|
*/ |
24
|
4 |
|
public function getCheckoutId() |
25
|
|
|
{ |
26
|
4 |
|
return $this->data['ik_shop_id']; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* The transaction identifier generated by the merchant website. |
31
|
|
|
* |
32
|
|
|
* @return string |
33
|
|
|
*/ |
34
|
1 |
|
public function getTransactionId() |
35
|
|
|
{ |
36
|
1 |
|
return $this->data['ik_payment_id']; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* {@inheritdoc} |
41
|
|
|
*/ |
42
|
1 |
|
public function getTransactionReference() |
43
|
|
|
{ |
44
|
1 |
|
return $this->data['ik_trans_id']; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* The amount of payment. |
49
|
|
|
* |
50
|
|
|
* @return mixed |
51
|
|
|
*/ |
52
|
1 |
|
public function getAmount() |
53
|
|
|
{ |
54
|
1 |
|
return $this->data['ik_payment_amount']; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* The currency of the payment. |
59
|
|
|
*/ |
60
|
1 |
|
public function getCurrency() |
61
|
|
|
{ |
62
|
1 |
|
return null; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* {@inheritdoc} |
67
|
|
|
*/ |
68
|
1 |
|
public function getPayer() |
69
|
|
|
{ |
70
|
1 |
|
return $this->data['ik_paysystem_alias']; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* The time of request processing. |
75
|
|
|
* |
76
|
|
|
* @return string |
77
|
|
|
*/ |
78
|
1 |
|
public function getTime() |
79
|
|
|
{ |
80
|
1 |
|
$date = new \DateTime($this->data['ik_payment_timestamp'], new \DateTimeZone('Europe/Moscow')); |
81
|
|
|
return $date->format('c'); |
82
|
1 |
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* The state of the payment. |
86
|
|
|
* Possible results: |
87
|
|
|
* - `success`: the payment processed successfully |
88
|
|
|
* - `fail`: the payment failed. |
89
|
|
|
* |
90
|
|
|
* @return string |
91
|
|
|
* @see isSuccessful |
92
|
|
|
*/ |
93
|
|
|
public function getState() |
94
|
3 |
|
{ |
95
|
|
|
return $this->data['ik_payment_state']; |
96
|
3 |
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* {@inheritdoc} |
100
|
|
|
*/ |
101
|
|
|
public function getSign() |
102
|
4 |
|
{ |
103
|
|
|
return $this->data['ik_sign_hash']; |
104
|
4 |
|
} |
105
|
|
|
} |
106
|
|
|
|