Skip to content

Commit 173a6f4

Browse files
author
Leonid Vakulenko
committed
wa-plugins/payment/tinkoff v.1.1.3
* Улучшили передачу параметра AddUserProp.
1 parent b6c6d5c commit 173a6f4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

wa-plugins/payment/tinkoff/lib/config/plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'icon' => 'img/tinkoff.svg',
66
'logo' => 'img/tinkoff.png?v2',
77
'vendor' => 'webasyst',
8-
'version' => '1.1.2',
8+
'version' => '1.1.3',
99
'type' => waPayment::TYPE_ONLINE,
1010
'partial_refund' => true,
1111
'partial_capture' => true,

wa-plugins/payment/tinkoff/lib/tinkoffPayment.class.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,15 +1111,22 @@ private function getReceiptData(waOrder $order)
11111111
if (!($email = $order->getContactField('email'))) {
11121112
$email = $this->getDefaultEmail();
11131113
}
1114+
$order_number = $order->id_str;
1115+
if (empty($order_number)) {
1116+
$order_number = $order->id;
1117+
}
11141118
$this->receipt = array(
11151119
'Items' => array(),
11161120
'Taxation' => $this->getSettings('taxation'),
11171121
'Email' => $email,
11181122
'AddUserProp' => [
11191123
'Name' => 'Номер заказа',
1120-
'Value' => $order->id_str
1124+
'Value' => $order_number,
11211125
]
11221126
);
1127+
if (empty($this->receipt['AddUserProp']['Value'])) {
1128+
unset($this->receipt['AddUserProp']);
1129+
}
11231130
if ($phone = $order->getContactField('phone')) {
11241131
$this->receipt['Phone'] = sprintf('+%s', preg_replace('/^8/', '7', $phone));
11251132
}

0 commit comments

Comments
 (0)