[Skip to main content](#vessel-content)

#   Payment plugin/API

##

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

5 years 8 months ago [\#330300](#330300) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  *[Payment plugin/API](/forum/30-integrations/902078-payment-plugin-api#330300 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hello,  We are in the process of linking an API / payment plugin with Hikashop / Hikamarket. If we fetch the data with &quot;$ this-&gt; getRecordByOrder ();&quot; and then a &quot;print&#95;r ($ this-&gt; oRecord);&quot; to look up what we all bring in, then we get this:  We see that the shipping and transaction costs are generated as individual products per order. For this we would have to create a look-up that searches for &quot;SHIPPING&quot; and &quot;PAYMENT&quot; to split it from the total amount (because that is necessary in our case).  Is there an easier / safer way to split this data from the total amount? This is because if the word &quot;SHIPPING&quot; ever changes when updating to &quot;SHIPPING&#95;COST&quot; for example, the API will no longer work correctly.  Regards, Michiel")* was created by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")*

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4

Hello,

We are in the process of linking an API / payment plugin with Hikashop / Hikamarket.
If we fetch the data with "$ this-&gt; getRecordByOrder ();" and then a "print_r ($ this-&gt; oRecord);" to look up what we all bring in, then we get this:
This message contains confidential information

We see that the shipping and transaction costs are generated as individual products per order. For this we would have to create a look-up that searches for "SHIPPING" and "PAYMENT" to split it from the total amount (because that is necessary in our case).

Is there an easier / safer way to split this data from the total amount? This is because if the word "SHIPPING" ever changes when updating to "SHIPPING_COST" for example, the API will no longer work correctly.

Regards,
Michiel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDIwNzgtcGF5bWVudC1wbHVnaW4tYXBpP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

5 years 8 months ago [\#330303](#330303) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Payment plugin/API](/forum/30-integrations/902078-payment-plugin-api#330303 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hello,  We are in the process of linking an API / payment plugin with Hikashop / Hikamarket. If we fetch the data with &quot;$ this-&gt; getRecordByOrder ();&quot; and then a &quot;print&#95;r ($ this-&gt; oRecord);&quot; to look up what we all bring in, then we get this:  We see that the shipping and transaction costs are generated as individual products per order. For this we would have to create a look-up that searches for &quot;SHIPPING&quot; and &quot;PAYMENT&quot; to split it from the total amount (because that is necessary in our case).  Is there an easier / safer way to split this data from the total amount? This is because if the word &quot;SHIPPING&quot; ever changes when updating to &quot;SHIPPING&#95;COST&quot; for example, the API will no longer work correctly.  Regards, Michiel")*

Hi,

I'm not sure what you're asking.
If you want to know how to get the shipping / payment cost from an order in HikaShop or your plugin, that's quite easy.
In a HikaShop $order object, you'll have the shipping fee in $order-&gt;order_shipping_price and $order-&gt;order_shipping_tax and for the payment it's $order-&gt;order_payment_price and $order-&gt;order_payment_tax
And you have the total amount of the order in $order-&gt;order_full_price.
So if you want to remove the shipping fee and payment fee from the order_full_price, it's just a small calculation.

But maybe you're talking about something else ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDIwNzgtcGF5bWVudC1wbHVnaW4tYXBpP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

5 years 8 months ago [\#330335](#330335) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Payment plugin/API](/forum/30-integrations/902078-payment-plugin-api#330335 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hello,  We are in the process of linking an API / payment plugin with Hikashop / Hikamarket. If we fetch the data with &quot;$ this-&gt; getRecordByOrder ();&quot; and then a &quot;print&#95;r ($ this-&gt; oRecord);&quot; to look up what we all bring in, then we get this:  We see that the shipping and transaction costs are generated as individual products per order. For this we would have to create a look-up that searches for &quot;SHIPPING&quot; and &quot;PAYMENT&quot; to split it from the total amount (because that is necessary in our case).  Is there an easier / safer way to split this data from the total amount? This is because if the word &quot;SHIPPING&quot; ever changes when updating to &quot;SHIPPING&#95;COST&quot; for example, the API will no longer work correctly.  Regards, Michiel")*

Hello,
We don't want it from the order, but it is for our payment plugin, so we can divide split the payment in the api to the psp. e.g.
from the total amount including transaction costs and shipping costs, see screenshot.
[ ![screenshot-www53.totaalholding.nl&#95;2096-2021.03.04-09&#95;53&#95;34.png](/forum/attachment/52177) ](/forum/attachment/52177 "...4-09&#95;53&#95;34.png")

From the subtotal we have a fee of 9,68% for us as main seller,
The shippingcosts (Bezorgkosten) € 1,75 are for the vendor.
The transactioncosts are only for the customer..
We need to split those for our psp so it will be divided to the different accounts automaticly by the api.
Hope you understand now a little better.

Another question is:
How can i make a calculation with the "Klant algemeen totaal" € 22,25 and the vendor total € 20,27 as follows:
€ 22,25 minus € 20,27 = € 1,98 and show this in the email??

Hope you can help!!

Thanks..
Mark

- [ ![screenshot-www53.totaalholding.nl&#95;2096-2021.03.04-09&#95;53&#95;34.png](/forum/attachment/52177) ](/forum/attachment/52177 "...4-09&#95;53&#95;34.png") [ ](/forum/attachment/52177?download=1 "...4-09&#95;53&#95;34.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDIwNzgtcGF5bWVudC1wbHVnaW4tYXBpP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

5 years 8 months ago [\#330343](#330343) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Payment plugin/API](/forum/30-integrations/902078-payment-plugin-api#330343 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hello,  We are in the process of linking an API / payment plugin with Hikashop / Hikamarket. If we fetch the data with &quot;$ this-&gt; getRecordByOrder ();&quot; and then a &quot;print&#95;r ($ this-&gt; oRecord);&quot; to look up what we all bring in, then we get this:  We see that the shipping and transaction costs are generated as individual products per order. For this we would have to create a look-up that searches for &quot;SHIPPING&quot; and &quot;PAYMENT&quot; to split it from the total amount (because that is necessary in our case).  Is there an easier / safer way to split this data from the total amount? This is because if the word &quot;SHIPPING&quot; ever changes when updating to &quot;SHIPPING&#95;COST&quot; for example, the API will no longer work correctly.  Regards, Michiel")*

Hi,

If you want to know what code you should use to get the amount that should be sent to each vendor and to the store from the total amount paid by the customer because you're developing a payment plugin with "adaptive" support, then I would recommend you look at what we've done in the file plugins/hikashoppayment/paypaladaptive/paypaladaptive.php
There, you'll find the afterOrderConfirm_Adaptive function which generates the data to be sent to PayPal for the payment. And it has some specific code to get the amount to send to each vendor of the order plus the amount to send to the main vendor (yourself).
I suppose that's what you're looking for.

If you want to add extra rows for the products listing in the email notifications, you'll want to edit the email via the menu System&gt;Emails and modify the section "preload" at the bottom.
There, you'll find such code which adds the total row to the table: Code:

$cartFooters[] = array( 'CLASS' =&gt; 'total_with_tax', 'NAME' =&gt; JText::_('ORDER_TOTAL_WITH_VAT'), 'VALUE' =&gt; $currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;cart-&gt;order_currency_id) );

So you can add such code with the calculations you want to add extra rows.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDIwNzgtcGF5bWVudC1wbHVnaW4tYXBpP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
