Developing payment plugin with input fields

  • Posts: 6
  • Thank you received: 0
9 years 4 months ago #209313

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5

I am trying to develop a payment plugin.

What is required is to have the buyer select an institution from a list giving a code for electronic invoicing. The order is then exported to our main system where we process the orders and send out invoices.

I need a little help on two things:

Firstly I need to add two input fields on the checkout page that relates to this specific payment plugin. (This is one of several payment methods, the fields will be hidden when another payment method is selected, that is done by javascript)

Secondly I need to store the values from the fields in the payment information in the order.

Can you give any advice on how to do it, perhaps there is a similar functionality in some of the existing payment plugins (I haven't been able to find it, though).

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 4 months ago #209315

Hi,

I would recommend to look at the SVEA payment plugin which has such fields, or the credit card payment plugin which is simpler and included by default in HikaShop:

www.hikashop.com/support/support/documen...-payment-method.html

The following user(s) said Thank You: Bent Nielsen

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
9 years 4 months ago #209441

Hi.

Thank you for your reply.

The svea plugin is far to complex for our needs. The credit card plugin seems to be highly coupled to the HikashopPaymentPlugin class, defining the available fields.

I will soldering on for now, hopefully finding a way forward.

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
9 years 3 months ago #209711

Hi again.

I sorry to say that I have come very far with the payment plugin.

I just need one field (I originally thought I needed 2) that shows up on the checkout form. HikaShop would in this case not handle the payment at all, sending invoices would be handled externally.

The field would be filled with data and the buyer can select the correct company to be invoiced. Then the payment plugin reads the selected value, stores it in the order.

Can something be done with say a tmpl directory and a view?

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #209716

Hi,

I really don't know what to say except what have been already written by Nicolas.
If you want to add fields with the payment plugin, you have to use the "custom html" feature and you can take a look at the two mentioned plugin for examples (knowing that the "credit card" one is lighter than the other one).
And that's it.

Now ; if you want to just explain the requirements and not the finality, with useful details on the development/technical aspect ; it will be easier for everyone.
Most information you gave are useless for our understanding of your issue ; because you said that you come "very far" but at any moment you gave details on the issue you got or the problems you're facing.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
9 years 3 months ago #209843

It would have saved me quite some time, if you had directed me to the purchaseorder payment plugin in the first place.

I found that after grepping "custom_html".

It seems to me to be the most simple payment plugin with custom fields.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #209852

Hi,

I have to admit that I totally forgot that plugin !
Sorry about that.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Bent Nielsen

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum