Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
synpay
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
synpay
Commits
0930ee8d
Commit
0930ee8d
authored
2 years ago
by
Aleksey Zubenko
Committed by
Oleg Krasnobaev
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3283611
by Alezu: Respect price adjustments
parent
8f5dc830
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PluginForm/OffsiteRedirect/OffsitePaymentForm.php
+9
-10
9 additions, 10 deletions
src/PluginForm/OffsiteRedirect/OffsitePaymentForm.php
with
9 additions
and
10 deletions
src/PluginForm/OffsiteRedirect/OffsitePaymentForm.php
+
9
−
10
View file @
0930ee8d
...
...
@@ -53,14 +53,13 @@ class OffsitePaymentForm extends PaymentOffsiteForm {
$items
=
[];
$c
=
0
;
foreach
(
$payment
->
getOrder
()
->
order_items
as
$item
)
{
$order_item
=
$item
->
entity
;
$quantity
=
$order_item
->
quantity
->
value
;
$price
=
$order_item
->
unit_price
->
number
;
$quantity
=
$item
->
getQuantity
();
$price
=
$item
->
getAdjustedUnitPrice
()
->
getNumber
();
$price
=
$precision
?
$price
:
bcmul
(
$price
,
100
,
0
);
$total
=
$
order_item
->
t
otal
_p
rice
->
n
umber
;
$total
=
$
item
->
getAdjustedT
otal
P
rice
()
->
getN
umber
()
;
$total
=
$precision
?
$total
:
bcmul
(
$total
,
100
,
0
);
$variation
=
$
order_
item
->
p
urchased
_entity
->
e
ntity
;
$product
=
$variation
->
p
roduct
_id
->
entity
;
$variation
=
$item
->
getP
urchased
E
ntity
()
;
$product
=
$variation
->
getP
roduct
()
;
$unit
=
'шт'
;
if
(
$product
->
hasField
(
'field_unit'
))
{
$unit
=
$product
->
field_unit
->
entity
->
getName
();
...
...
@@ -69,7 +68,7 @@ class OffsitePaymentForm extends PaymentOffsiteForm {
switch
(
$synpay
->
gateway
->
getPluginId
())
{
case
'robokassa'
:
$items
[]
=
[
'name'
=>
$
order_item
->
title
->
value
,
'name'
=>
$
item
->
getTitle
()
,
'quantity'
=>
$quantity
,
'sum'
=>
$total
,
'tax'
=>
'none'
,
...
...
@@ -80,10 +79,10 @@ class OffsitePaymentForm extends PaymentOffsiteForm {
default
:
$items
[]
=
[
'positionId'
=>
$c
++
,
'name'
=>
$
order_item
->
title
->
value
,
'itemCode'
=>
$
variation
->
id
(),
'name'
=>
$
item
->
getTitle
()
,
'itemCode'
=>
$
item
->
id
(),
'quantity'
=>
[
'value'
=>
$quantity
,
'value'
=>
str_replace
(
','
,
'.'
,
$quantity
)
,
'measure'
=>
$unit
,
],
'itemPrice'
=>
$price
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment