1 | <?php |
||
14 | class Client |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $endpoint = 'https://ecommerce.nexi.it/ecomm/ecomm/DispatcherServlet'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $alias; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $secret; |
||
30 | |||
31 | /** |
||
32 | * Class constructor |
||
33 | * |
||
34 | * @param string $alias Store identification code given by KeyClient |
||
35 | * @param string $secret |
||
36 | */ |
||
37 | public function __construct($alias, $secret) |
||
42 | |||
43 | /** |
||
44 | * Create paymentUrl |
||
45 | * |
||
46 | * @param PaymentRequestInterface $payment |
||
47 | * @return string |
||
48 | */ |
||
49 | public function createPaymentUrl(PaymentRequestInterface $payment) |
||
59 | |||
60 | /** |
||
61 | * Parse paymentResponse |
||
62 | * |
||
63 | * @param Request $request |
||
64 | * @return PaymentResponse |
||
65 | */ |
||
66 | public function parsePaymentResponse(Request $request = null) |
||
77 | |||
78 | /** |
||
79 | * Calculate mac |
||
80 | * |
||
81 | * @param PaymentRequestInterface $paymentRequest |
||
82 | * @return string |
||
83 | */ |
||
84 | public function calculateMac(PaymentRequestInterface $paymentRequest) |
||
95 | |||
96 | /** |
||
97 | * Verify mac |
||
98 | * |
||
99 | * @param PaymentResponseInterface $paymentResponse |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function verifyMac(PaymentResponseInterface $paymentResponse) |
||
120 | } |
||
121 |