Forum Moderators: coopster

Message Too Old, No Replies

Help with OsCommerce

Need help with payment API

         

Gixer

5:37 am on Oct 2, 2003 (gmt 0)

10+ Year Member



I DESPERATELY need help writing a payment module for OsCommerce, there is no documentation for the 'API' that I can find.. I need to slap together a custom payment module for it that will work like so:

Customer shops on site

Customer selects 'Credit Card Payment'

Customer fills out his info

System sends the 'transaction' to the clearing house in the background using secure curl or whatever and gets the response back from the clearing house.

Based on the response, the system either finalizes the transaction OR returns an 'I'm sorry, your credit card has been declined, stolen, etc'.

I DO NOT want the customer to have to goto another website to fill out info, etc....

ANY help would be GREATLY appreciated. If someone has a working example of such code that I can change to suit my needs, etc... the hardest part is, I CAN'T FIND ANY DOCS on oscommerce! I was thrown into the middle of this project and they expect me to 'whip up' a custom module for sofware that I have never used! :) Typical huh?

Thank you in advance!

-Gixer

Edouard_H

6:35 am on Oct 2, 2003 (gmt 0)

10+ Year Member



Have you looked through the Credit Modules in the "Contributions" on the osCommerce support site? It's possible that a user has already written one for your payment processor or one that you can modify for your use. Depends on who it is, but with payflow link, for example, it's next to impossible to avoid going to their site.

jatar_k

3:32 pm on Oct 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Gixer,

how's your curl? All you need to do is get a url from your payment processor, if they have an API available, or just use the url you use now and grab the form fields and the form action.

build yourself all of that info and post it to the form action.

fairly basic high level description.

Gixer

4:46 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



It's the API in OsCommerce that I need help with :) On the processor side, I'm fine, I have the url all done, tested, etc... it's just INTEGRATING it with OsCommerce :( I have been pouring over code for almost 2 days now, it seems like they reach over their backs to scratch their butts in this code :) But I understand it's in the interest of making it as flexable and modular as possible, but it makes it darn hard to just 'jump into it'.

Anyways, I have the resonse from the clearing house, I just need to know howto pass it to OsCommerce?

-Gixer

daisho

4:59 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



osCommerce is very complicated to get into. I had to do the same thing and it took me a couple weeks to make heads or tails of the code and get what I wanted. Unfortunatly that was awhile back so it's not fresh in my mind anymore.

Once you get in the grove with it things fall into place. Unfortunatly like you said there is *NO* documentation.

I know this post doesn't really help you it's just more of a "I feel your pain" post :)

daisho.

lorax

6:59 pm on Oct 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So what you need help with is how to integrate your script with osCommerce? Have you looked into code in one of the standard gateway modules? That should give you a fairly clear understanding of how to build your module.

Alternately - sticky me and I'll give you the name of someone who can do it for you if you'd like.

Gixer

4:32 am on Oct 3, 2003 (gmt 0)

10+ Year Member



Well ladies and gents, 24 hours later, actually a little over 10 hours of work later :) I am done.... Thank you to those who replied, keep your fingers crossed for me :)

I even got my payment module to save all the transaction info in the order for reference... :)

Once again, thanks everyone :)

-Gixer

lorax

1:31 pm on Oct 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Glad you got it working.

So now you're going to post your new module as a contribution on the osCommerce site right? :)

Gixer

12:09 am on Oct 5, 2003 (gmt 0)

10+ Year Member



Actually this is a custom solution, but to make a long story short, YES. :) I will also include STEP BY STEP INSTRUCTIONS on howto make your OWN payment module. Due to the , ahem, 'RUSH' to code this and get it running, I have to clean up the code a little, I wouldn't put my name on it right now, yah know? hehe :)

I am also writing a custom shipping module for this client that will be posted as well. In the module, when you buy a 'main' item, you get free shipping on any 'promotional' item. EACH 'main' item has a fixed shipping fee, (actually EVERY item has a fixed shipping fee, it just depends on if you met the requirements if you have to PAY it or not :) ). So as you can tell, there will be an .sql file to go with the module to update the products table. Oh, and to add to the confusion, 'members' get a different rate than 'non-members'... I almost dropped my cell when the client was explaining all these conditions to me... and I thought I was done.... what was *I* thinking? :)

It may be a few weeks before I get around to making 'public' versions as I don't know what my workload will be between now and then, but rest assured, if I can save anyone the HEADACHE of trying to finger this out on their own, I will :)

-Gixer