Jump to content



Latest News: (loading..)

Where to code payment gateway callback processing?

paymant callback success cancel

  • Please log in to reply
7 replies to this topic

#1   j_vovus

j_vovus
  • Members
  • 8 posts
  • Real Name:Vladimir

Posted 22 February 2012 - 02:06 PM

Hi,


I almost finished payment module and want to clarify following question:
Payment gateway needs tree urls - callback, success and cancel.
callback - is for background callback
success - is to redirect customer after payment
cancel   - is to redirect customer on canceling of transaction


What is the best way to process this callbacks? Is there some interface to direct such requests to my module through router or I need separate public files to catch it?

Best regards,
Vladimir

#2   web-project

web-project
  • Members
  • 4,320 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Hertfordshire, UK

Posted 22 February 2012 - 10:54 PM

Quote

What is the best way to process this callbacks? Is there some interface to direct such requests to my module through router or I need separate public files to catch it?
normally some payment gateways like PayPal send information back to store via IPN/API about the payment back to store.

Quote

What is the best way to process this callbacks?

verify information and enter the info as order comments (PayPal and other modules do the same way)

Quote

I need separate public files to catch it?
no you don't need as it's normally in the same public folder.
Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!
8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.
Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.
Any issues with oscommerce, I am here to help you.

#3   j_vovus

j_vovus
  • Members
  • 8 posts
  • Real Name:Vladimir

Posted 23 February 2012 - 06:48 AM

Hi web-project,
Thanks for reply!

I mean something different.
E.g.:
I have module file /Core/Site/Shop/Module/Payment/MyPaymentModule.php
It has method "processCallback()"
How to send callback to this method form remote gateway with construction nearly like this: "http://example.com/index.php?MyPaymentModule&processCallback"?

P.S.: Some details: My payment provider use redirect of customer to its gateway, like 2checkout, Sage, PayPal Standard (seems to be). Then it redirects customer back to shop's success page and make background callback to shop.

#4 ONLINE   toyicebear

toyicebear
  • Community Sponsor
  • 6,053 posts
  • Real Name:Nick
  • Location:World Citizen

Posted 23 February 2012 - 07:53 AM

You do know that 3.02 is "incomplete" and just a developers release...

For a live shop you should be using 2.3.1
Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce

Check out my profile [click here] for information on professional services, custom coding, templates, SEO optimization, modifications, commercial support and help.

#5   j_vovus

j_vovus
  • Members
  • 8 posts
  • Real Name:Vladimir

Posted 23 February 2012 - 08:39 AM

Hi toyicebear,

Thank you, but I'm not using it in production.
I'm developing a payment module for 3.0.2.
I already have module for 2.3.1 version and now need to complete the same task for 3.0.2.
I can't find a contacts osCommerce developers for non-commercial support (developers of other CMS consult module developers when documentation is incomplete).

#6   j_vovus

j_vovus
  • Members
  • 8 posts
  • Real Name:Vladimir

Posted 24 February 2012 - 01:39 PM

I found how to process this data:
on success you need to redirect customer to http://yoursite.com/index.php?Checkout&Process and handle it with function process() in the module file.
For cancel you can do hack with switch:
success url: http://yoursite.com/index.php?Checkout&Process&myaction=1
cancel url: http://yoursite.com/index.php?Checkout&Process&myaction=2

function process() {
	switch($_GET['myaction']) {
		 case 1:
			 //success processing
		 break;
		 case 2:
		   //cancel processing
		  OSCOM::redirect(OSCOM::getLink(null,'Cart')); // we are redirecting customer to cart before Process action redirects customer to Success action page
		  exit();
	}
}

BUT! callback() handler - is total fail! It goes through same checks and verifications as customer on success and server of payment gateway fails to pass them.
It's deadlock.

#7   modminds

modminds
  • Members
  • 1 posts
  • Real Name:savkgi

Posted 14 June 2012 - 07:20 PM

Hi
COuld you let me know the steps to write a custom payment module for oscommerce 3.0.2

Thanks

#8   DunWeb

DunWeb
  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 14 June 2012 - 07:22 PM

@modminds

v3.x is NOT a production release.  It is for developers only. By asking for help to create a custom payment module, it is obvious you are not a developer.  I suggeset deleting v3.x and downloading v2.3.1 which is the most recent stable release.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)





Also tagged with one or more of these keywords: paymant, callback, success, cancel