Currency not exported to Kashflow

  • Posts: 98
  • Thank you received: 3
8 years 8 months ago #234051

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.17

As the instigator of this integration I've taken rather a long time to start using it - sorry about that. But now that I've actually got it working, I'm seeing some shortcomings:

1) The invoice created in Kashflow is in the default Kashflow currency instead of the actual transaction currency as performed in Hikashop. We use USD, EUR and GBP so it would be much nicer if the currency was correctly set.

2) No payment is recorded in Kashflow. This is a pain because I have to go back and add payments manually even though the order confirmation process has already checked the existence of a payment. We use PayPal and Stripe as our primary payment options so it would be really nice to have the corresponding payment added to Kashflow so the whole thing updates automatically.

Those are the two main gripes.

Also interesting is the whole way this thing came to light. I was mostly updating my books through Kashflow's PayPal import and doing the Stripe transaction by hand. However once we became VAT-registered early this year I saw that PayPal wasn't getting the VAT info and although Hikashop was handling everything properly from the VAT point of view, Kashflow was making invoices without VAT even though VAT had been charged.

Personally I'm not really interested in giving PayPal all my data, I just want them to process payments - hence the move to the Kashflow integration which promises better handling of Stripe payments too. It just needs a bit more work to do the job completely i.e. properly collect all VAT and currency info and log the payments. Do you think this can be added to the development plan, or can you give me pointers to add this in myself?

Best regards

Conrad

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #234059

Hi,

Thank you for your feedback.
1.
For the currency code, try changing the line:
"CurrencyCode" => (int)$this->getCurrencyCode($data->order_currency_id),
to:
"CurrencyCode" => $this->getCurrencyCode($data->order_currency_id),
in the file plugins/hikashop/kashflow/kashflow.php

2.
Regarding the payments, I'm not sure how that should be done.
Maybe just changing the code:
"Paid" => 0,
and:
"AmountPaid" => 0,
to set Paid to 1 and AmountPaid to data->order_full_price will be enough ? Maybe it require extra requests to kashflow. But I don't remember how kashflow look like and what a payment entails there.
Could you try to change these ? If that doesn't help, could you do some screenshots with an example of an order:
- what you have in HikaShop for the order
- what you get in kashflow
- what you need to add there, and how you do it

3.
Regarding your VAT issue, could you do some screenshots of the issue so that we can understand what is correct and what is wrong where ?

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

  • Posts: 98
  • Thank you received: 3
8 years 7 months ago #234144

Thanks Nicolas,

I'll give those a try and get back to you. Give me a day or two.

Conrad

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

  • Posts: 98
  • Thank you received: 3
8 years 7 months ago #235964

Hi Nicolas,

I tried both those and they broke the site - blank page on front end, Hikashop blank at back-end. So trying step-by-step I can report that mod 1 does not cause the currency to be set correctly. Invoice still stubbornly in GPB when I sell in Euros.

Onwards to step 2 now. But for me even getting the currency right would be a step forward.

Conrad

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

  • Posts: 98
  • Thank you received: 3
8 years 7 months ago #235965

Looking at the KashFlow SOAP API docs it looks like they are expecting a 3-letter currency code like USD, GBP, EUR etc. so casting the output to an int won't help. However removing that didn't change anything. Anyway the integration is part of Hikashop now so maybe we should get it working. If I can help in any way please let me know.

C

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #236007

I don't see why it wouldn't work. The code in the function getCurrencyCode is fairly simple and I don't see any problem with it.
I guess it would require some debugging to test it. If you could add so var_dumps in that function and exit at the end so that you won't get the var_dumps to display when confirming manually an order in the backend, that would help understand if the currency is passed properly.

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

  • Posts: 98
  • Thank you received: 3
8 years 7 months ago #236072

Hi Nicolas,

Using J!Dump I confirmed that once the (int) cast is removed the currency code is a 3-letter code as KashFlow docs suggest. However, KashFlow does not apply the information to the invoice. So I've taken up the mystery with them and I'll let you know what they reply.

Conrad

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

  • Posts: 98
  • Thank you received: 3
8 years 6 months ago #239201

Hi Nicolas,

I'm still trying to get this working right and the Kashflow support guy isn't making sense - you are! If we have to specify the exchange rate then as you rightly say it has to be the rate between the currency selected by the customer in Hikashop and the currency used in Kashflow accounts. Hikashop doesn't know what that currency is, so it would have to be a preference setting in the HS KF plugin. Could you do this and send the current exchange rate? Just to get it working.

I'd fully agree that Kashflow should really retrieve and apply the exchange rate but their guy doesn't seem to get it.

Thanks

Conrad

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 6 months ago #239228

Hi,

Here is a version of the plugin with the currency rate being sent with an option to set in the plugin settings.

File Attachment:

File Name: kashflow.zip
File Size:5 KB


Now, will it change anything...I'm not sure since the answers from the guy at KashFlow were quite vague.

Attachments:
Last edit: 8 years 6 months ago by nicolas.

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

  • Posts: 98
  • Thank you received: 3
8 years 6 months ago #239250

Thank you Nicolas,

I was not impressed by the quality of support from them and I've flagged that to their customer service. They could do better.
I'll let you know how it goes.

Conrad

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

Time to create page: 0.069 seconds
Powered by Kunena Forum