Author Topic: HSBC CPI Integration  (Read 167073 times)

mitch_a

  • Beginner
  • *
  • Posts: 12
Re: HSBC CPI Integration
« Reply #15 on: August 24, 2005, 01:11:19 am »
stovesy, husayt

I also have a requirement for a payment module for the HSBC CPI.
I am in the process of setting up a test account with HSBC and the site will be hosted on a dedicated Linux server.
It would be great to get some more information regarding your progress todate and I would be happy to help, where I can (I'm more PHP hacker rather than coder i'm afraid).

I note above that you are having difficulty setting up a test server - due to a clients sites being live - let me know if I can be of help here.

With regards to your question above re the payment processor being only one piece of code --
I have , in the past, used the paypal module for payment processing  - this is in 3 steps - not sure if this will help you in any way ??
 
1 - Various data posted to paypal (albeit some in hidden, unsecure form fields)
2 - Payment made on paypal
3 - Code returned to phpshop to confirm payment / change order staus etc.

I have yet to look at the payment processor code and HSBC process in any detail, but image that it it not a simple 'forms' type interface (ala paypal, protx forms etc) - hence the above will not be helpful.

If I can help with testing / any other way, just let me know.

Regards


stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #16 on: August 24, 2005, 09:57:02 am »
Here's what I have so far.



[attachment deleted by admin]

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #17 on: August 24, 2005, 12:19:41 pm »
I'm starting to get this after looking at a load of Soerens code.

We've gotta use the 'payment_extrainfo' field to pass our form to the CPI. I installed the ps_pbs payment processor. What happens is the order completes in the phpShop system, then the code in the 'extra_info' field gets evaluated and any output is displayed at the bottom of the 'ThankYou' page.

(This is a little wrong really - because the payment may not go through - so the order is not complete) CPI is also able to return a payment status.. but anyway.

What needs to happen, is instead of posting the CPI variable directly, we need to get all that info into a form which is defined in the 'extra_info' field.

Just have a look at the 'ps_pb.php' file in admin-components-com_phpshop-classes-payment.


chikkensoop

  • Beginner
  • *
  • Posts: 8
Re: HSBC CPI Integration
« Reply #18 on: August 30, 2005, 16:49:38 pm »
Any more movement on this? I have a friend desperate to get himself setup with a shop but needs to use HSBC CPI. Also if theres anything I can do to help please dont hesitate to ask... :)

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #19 on: September 01, 2005, 10:14:28 am »
If anyone can now loan me the use of an HSBC CPI account for testing, this would be usefull.
Don't post the keys etc. here. PM or email.
Cheers.

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #20 on: September 02, 2005, 11:19:56 am »
Ok. This is where we're at.
We are now posting Ok to the HSBC server, and are able to receive back (via secure post) result codes etc.

I cannot go any further, as I only have access to a 'live' CPI account. I need to be able to play with a 'test' account in order to progress.

I need a StorefrontId and Hash Key of an account in 'Test Mode'.

Looking forward to your help guys.
Cheers

chikkensoop

  • Beginner
  • *
  • Posts: 8
Re: HSBC CPI Integration
« Reply #21 on: September 02, 2005, 12:32:02 pm »
Getting my bod to contact HSBC and get his account put into test mode... will get back to you when I have more info

chikkensoop

  • Beginner
  • *
  • Posts: 8
Re: HSBC CPI Integration
« Reply #22 on: September 05, 2005, 10:26:18 am »
Just a quick update, apparently HSBC are dragging their heels and the account wont be set up until near the end of september :(

Anyone else got an active account they can get put in test mode?

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #23 on: September 05, 2005, 17:14:59 pm »
Think we've got one sorted.  I'll let you know.

At present, CPi is responding back with result code 10. The transaction failed because of invalid input data. I'll have a look tomorrow at this, and then post the code I have so far.

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #24 on: September 08, 2005, 11:39:17 am »
Here's what I've got so far.

From the archive, copy the files ps_hsbc.* into your mambo root/administrator/components/com_phpshop/classes/payment
and the file payment.hsbc_return.html into  mambo root/administrator/components/com_phpshop/html

Then, into phpshop admin, choose Add Payment Method.
Payment Method Name: HSBC
Code: HSBC
Payment class name: ps_hsbc
Turn on Use Payment Processor
Make sure that Active ? is checked
Save those changes. You should see it added to the Payment Method List
Go in again and edit the HSBC. Go into the Configuration tab.
Fill in your storefront ID and hash keys.
and alter the Result URL to point to your server.

Now the bad news.
All I'm getting back from the cPi is result code 10 - The transaction failed because of invalid input data
I've been over the data being sent to HSBC (view source on the ThankYou page) and it all looks OK. Maybe another fews sets of eyes will help. OR, it could be something to do with the account I'm testing on. Thanks to husayt for supplying an acocunt.

Anyway. Onwards.

[attachment cleanup by admin]

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #25 on: September 13, 2005, 09:42:28 am »
Ground to a halt.

I'm still gettting nothing back from the CPI other than result code 10.
The fields being sent to the CPI look good to me.

Looking on other forums - it seems that HSBC sometimes send out duuf hash keys ???
I'm not sure if this is the case with the account husayt has provided as the hash I'm generating in the return phase, matches the hash sent back by the CPI ?

I'm running out of ideas on this ?
Anyone in a position to help ??
Come on everyone, we are getting close.

devkungfoo

  • Beginner
  • *
  • Posts: 9
Re: HSBC CPI Integration
« Reply #26 on: September 13, 2005, 10:17:40 am »
Hi,

I should have been paying more attention to this forum  ;)

I've come to almost the same point as you have here.
I've spent some time on the phone with hsbc and learnt a few things:

when you speak to the support at hsbc, if you don't ask they
will only give you the first error they see in their console.
So ask them to give you a rundown of all errors they see.
This will save you countless callbacks  ::) and will usually
allow you to first sort out any errors that may have crept in
to your fields.


I also used the secCrypto class supplied with the oscommerce hsbc module
and I'm not 100% certain yet but i think that the hash generated by this class
isn't the same as the hash generated by the hsbc supplied testhash.exe
(I'm currently testing this a bit further)

It's a bit vague regarding when to use " (quotes) around fields and this may
also be whats throwing us off??

I will be calling hsbc back tomorrow (as I'm off sick today  :'(  )
I'm looking forward to this call because it should clear things up completely!!

I'll pass on any info when I get some,

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #27 on: September 13, 2005, 13:22:21 pm »
Can you post what you've got so far so that we may compare code ??
I too am using the has functions from osCommerce and as I've said before I'm getting a matching hash on the data presented in the Return phase, so this is encouraging.

Thanks for you input.

stovesy

  • Beginner
  • *
  • Posts: 31
    • KiteAir
Re: HSBC CPI Integration
« Reply #28 on: September 13, 2005, 14:51:08 pm »
Here's another point I thought of.

Is there anything that can be configured from the Admin side of the CPI.
I've been reading through (countless) posts on the whole subject and get the impression that there may be some configuration items which can be switched on or off (Collecting shipping and billing addresses).
I haven't seen the administrator front end so I'm guessing.
If we are providing data which the CPi is not expecting, this may cause errors ???

husayt

  • Beginner
  • *
  • Posts: 15
Re: HSBC CPI Integration
« Reply #29 on: September 13, 2005, 18:37:44 pm »
Maybe this can help. I am sure not many people know about this, as HSBC is not publishing any official help on theirĀ  Secure Payments.

https://www.secure-epayments.hsbc.com/ClearCommerce/Help/en_US/Store/Main.htm