-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcheck_order.php
30 lines (22 loc) · 965 Bytes
/
check_order.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Pada\Tinkoff\Payment\PaymentClient;
require 'vendor/autoload.php';
// ------------------------------------------------------------------------------------------------
// 1 - Создание клиента
$paymentClient = PaymentClient::create('<terminal_key>', '<password>');
// ------------------------------------------------------------------------------------------------
// 2 - Вызываем API
$result = $paymentClient->checkOrder('1234567890');
if ($result->isSuccess()) {
print 'OrderID: ' . $result->getOrderId() . "\n";
print '-----' . "\n";
foreach ($result->getPayments() as $payment) {
print 'PaymentID: ' . $payment->getPaymentId() . "\n";
print 'Status: ' . $payment->getStatus() . "\n";
print 'Success: ' . $payment->getSuccess() . "\n";
print 'RRN: ' . $payment->getRRN() . "\n";
print '=====' . "\n";
}
} else {
print 'Error: ' . $result->getMessage() . "\n";
}