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

#   Access of shipment options in payment plug-in

##

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

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 2 weeks ago [\#129561](#129561) by [paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")  *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#129561 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")* was created by *[paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")*

I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is sufficient. The user credentials, such as address information, is returned by the payment portal.
I'm now about to implement the shipment selection options. The idea is to hand over all configured shipment options to the payment portal, the portal can then executes rules like zip-code to shipment cost calculations, and then the user may add his preferences as well (such as express shipments...).

For this to work, I would like to have acccess to the relevant shipment options. What is the neat way to get these in the payment plug-in code?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MzEzMS1hY2Nlc3Mtb2Ytc2hpcG1lbnQtb3B0aW9ucy1pbi1wYXltZW50LXBsdWctaW4/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 2 weeks ago [\#129628](#129628) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#129628 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")*

So I suppose that your code to send the parameters of the order to the payment gateway is in the onAfterOrderConfirm function right ?
In that function, you get the object $order in the first parameter. It contains all the details of the order, including the shipping method selected.
Simply do a var_dump on it to see which attribute you want to use.

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

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

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 2 weeks ago [\#129688](#129688) by [paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")  Replied by *[paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")* on topic *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#129688 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")*

Hi Nicolas,

Thanks for the reply. Your advise is exactly what I've been doing. Unfortunately, until the customer logs on to the payment portal, there is no access to address information. Thus, any shipment rule that's dependent on address (or zip code) data, must be executed on the payment portal.
The payment portal is designed to do exactly that. You hand over your shipping options to the payment portal and off you go.

In the $order object, there is not a set of shipping rules accessible. Only after the selection of a shipping method, I can find the data about the selection.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MzEzMS1hY2Nlc3Mtb2Ytc2hpcG1lbnQtb3B0aW9ucy1pbi1wYXltZW50LXBsdWctaW4/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 2 weeks ago [\#129905](#129905) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#129905 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")*

Hi,

I'm not following you.
You say " Only after the selection of a shipping method, I can find the data about the selection." But isn't that logical ?
You would like to access the shipping method selected by the user before he selects it ? That's obviously not possible.

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

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

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 week ago [\#130658](#130658) by [paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")  Replied by *[paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")* on topic *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#130658 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")*

Hi Nicolas,

The normal Hikashop flow is that the user supplies all sorts of details to the webshop, so that shipment methods can be selected. Thus, shipment address and billing address are known within the Hikashop context before the payment is initiated. The shipment method can then also be selected in this flow. You're right about that.

Now, I'm working with a payment portal (MultiSafePay Fast Checkout) that supports a different flow. The idea is to remove the need for the user to supply all sorts of details in the webshop, but instead keep this information in a profile at the payment portal. This is of course a completely different flow.

The idea is that after the cart is complete, the user is handed over to the check out counter at the payment portal. Different webshops may use the same payment portal and therefore the user may already have a profile at this portal. The user can then quickly pay for the cart and the payment portal will then share address details with the webshop.

This payment portal understands that shipment options are dependent on destination and so on. Therefore, the webshop needs to handover the potential shipping methods, plus the rules that go with these, to the payment portal so that the portal can execute the rules, select the appropriate shipping method and add the incurred costs to the bill. Also, the portal allows the user to select a shipping methods, when it comes to priority versus costs.

In order to make this all happen, I need to have access to the inventory of potential shipping methods. I hope that the above explains why such a thing would be advantageous to the webshop customer (fewer details to enter - reuse of his/her profile).

Thanks and regards, Paul

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MzEzMS1hY2Nlc3Mtb2Ytc2hpcG1lbnQtb3B0aW9ucy1pbi1wYXltZW50LXBsdWctaW4/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 1 week ago [\#130674](#130674) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Access of shipment options in payment plug-in](/forum/31-development/863131-access-of-shipment-options-in-payment-plug-in#130674 "I'm developing a payment plug in, in which the user authentication take place at the payment portal. There is no need for the user to log in to the webshop, just logging in to the payment portal is...")*

Hi,

Ok, I see what you mean now. Thanks for the additional details.

So what you're saying is that you want to send to the payment gateway a list of all the manual shipping methods that you configured.
In that case, you can do that with this code: Code:

$pluginClass = hikashop_get('class.plugins'); $rates = $pluginClass-&gt;getMethods('shipping');

$rates will be an array of all the shipping methods configured.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MzEzMS1hY2Nlc3Mtb2Ytc2hpcG1lbnQtb3B0aW9ucy1pbi1wYXltZW50LXBsdWctaW4/dG1wbD1tYXJrZG93bg==) 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.072 seconds

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