-
Notifications
You must be signed in to change notification settings - Fork 3
/
confirmya.php
60 lines (43 loc) · 998 Bytes
/
confirmya.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/*
Accept Yandex Money
https://tech.yandex.ru/money/doc/payment-solution/payment-notifications/payment-notifications-aviso-docpage/
verify
valid ip
action; paymentAviso
orderSumAmount;
orderSumCurrencyPaycash;
orderSumBankPaycash;
shopId;
invoiceId;
customerNumber; - phone
shopPassword
*/
define('APPPATH', 'whatever');
require_once 'CRMPayment.php';
$a = new CRMPayment();
w('Init');
$phone = '67771197';
w('Contact: '.$a->getCrmIdByPhone($phone));
$order = '16538';
w('Lead: ' . $a->getLeadByOrderNo($order));
$data = [
'payer' => '1046509',
'related_to' => '1046541'
];
w('Payment: ' . $a->getPaymentId($data));
if ($_SERVER['REQUEST_METHOD'] != 'POST') exit();
//------Main-------------
$data = processPOST($_POST);
//------End--------------
function processPOST($request)
{
$data = [];
$data['phone'] = $request['customerNumber'];
$data['amount'] = $request['orderSumAmount'];
return $data;
}
function w($txt)
{
print "$txt<br/>\n";
}