Support start month/year for new payment plugin

  • Posts: 2
  • Thank you received: 0
13 years 9 months ago #8937

Hi there,

I'm developing a payment plugin for ``CardSave'' in HikaShop.
For it to work I need to capture the start month and end month of the credit/debit card.

I'm not sure how I need to achieve this - but I'm willing to learn. Pointing me towards an example or specific piece of documentation would be extremely helpful.

Thanks for reading.

John

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #8939

Hi,

You can look at the documentation on that page for payment plugins: www.hikashop.com/en/support/documentatio...r-documentation.html

If you want to capture credit card information, you should look at the credit card payment plugin included in HikaShop ( the file plugins/hikashoppayment/creditcard.php ).

In the function onPaymentDisplay, we have the line $method->ask_cc=true; to activate the credit card interface for that payment method. Also, in the __construct function, you will find the code to retrieve the credit card information that you can then use in the onAfterOrderConfirm function to proceed to the transaction.

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

  • Posts: 2
  • Thank you received: 0
13 years 9 months ago #8947

Hi Nicholas,

Thank-you for your response. I have already implemented a onBeforeOrderCreate() to send the credit card information to CardSave over SOAP XML. That bit seems to be working.

The proble I'm having is that I need to edit the form, to capture more data as credit cards in the UK have start dates and certain cards have issue numbers. Not all companies require them -- however CardSave do!!

Is there any way to edit the credit card form like this? (I originally started writing the plugin from the credit card plugin as a template).

Kind regards,

John

Attachments:
Last edit: 13 years 9 months ago by JohnCC.

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #8948

Ok. You should look at the file components/com_hikashop/views/checkout/tmpl/payment.php and get the code of the credit card form which is between the
}else{
and the
}elseif(!empty($method->custom_html)){
lines and in the onPaymentDisplay, instead of using $method->ask_cc=true; to use the standard hikashop form, you can add the creditcard.js file, and set in the variable $method->custom_html the content of the form from the hikashop view. That way, you can have your own HTML form in your plugin. You can also retrieve the additional information in that same function and store it in the session for later use in the onBeforeOrderCreate function.

That way, people won't have to edit the default view so that it works with your plugin.

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

  • Posts: 6
  • Thank you received: 0
13 years 7 months ago #13728

Hello JohnCC, were you able to implement the Cardsave module for Hiksashop. Please let me know. I have a client who has registered with Card Save and I thought I'd see if your solution was available for use. Please let me know.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum