News:

Looking for documentation? Take a look on our wiki

Main Menu

checkout confirm, result and thankyou pages

Started by jaguar, June 19, 2006, 16:14:11 PM

Previous topic - Next topic

pacochin

Hi Aramil,

finally here is my 2cents worth of tutorial for this thread...

But it required the payment gateway to POST the result data to YOUR VM page instead hosting the thank you page at their end.

Please let me know if this help ?

thks

[attachment cleanup by admin]

aramil

#16
 ;D AWESOME WORK!

I`m enyoing it. Good work!! I`ll let u know if that great tutorial help me, i think it will be.

Thanks

****edited****

Now i understand what i must do. I have just one quetion, my payment gateway use a stand alone web aplication in my site, so i dont need to post a merchant id because i allready have assigned one in my site, maybe i`ll need the order status for approved payments, etc in the ps_example.php. When the pay is done, they redirect the user to a page in my site that recollect and show the payment info. Now my question: if i use a form that send back that info to the checkout.example_results.php it will work? Because they dont recommend me to change the results page.  :-[
All men die, not all men really live!

aramil

Hi pacochin!

Once again, Thanks for that awesome tutorial!

I just emailed to my payment gateway asking to use th checkout.....php. Im just waiting for the answer.

Looking the tutorial, my gateway give as indicator of success transaction value different from 00 to success and 00 to failed transaction. U know what value i must use to a value different from 00?



All men die, not all men really live!

pacochin

Hi aramil,

It depends on what status code your payment gateway use...each payment gateway has different procedure. The best is ask them to send u their API document, then, you will know. or else, u can send me the API doc, then i can chk for u.

cheers :)

aramil

Hi pacochin and all!

Ok this is the case. My gateway have their own results page (or "thanks you" page) in my server (outside of virtuemart), they don't want to change the results page directly to my checkout.example_results.php. So i must send the requested info from their page to the checkout.xxxx_Xx.php page. Their page use javascript (I'm not familiar with java), but i understand that their page request values from the gateway server, here is part of the code:

<HTML>
<HEAD>
<title> Results page </title>
</head>
<%@ page import="xxxxxxl.xxxxxxx.xxxxxx" %>
<body>
<%
   boolean isValid = false;
   String invoiceNumber = request.getParameter("invoiceNumber");
   String confirmationNumber = request.getParameter("confirmationNumber");
   String totalAmount =  request.getParameter("totalAmount");
   String extra = request.getParameter("extra");
   String dsa = request.getParameter("dsa");
   String tax = request.getParameter("tax");
   
   out.println("Invoice number = " + invoiceNumber + "<BR>");
   out.println("Confirmation number = " + confirmationNumber + "<BR>" );
   out.println("Total = " + totalAmount + "<BR>" );
   out.println("Extra = " + extra + "<BR>");
   out.println("dsa = " + dsa + "<BR>" );
   out.println("tax = " + tax  );
   out.println("<br>");
   
etc etc etc.... (The rest of the code just check for error code (in my case: total amount = 0 is a rejected transaction and a value different from 0 is an approved payment, and a print button)
Here is my problem, i need to send those values, to the checkout.xx.xx.php file in my shop (to update the order status, etc) i just don't know how write in java a function to send those values back to my shop. I guess that i can use a simple buttom, but how i POST those values???? The rest is very easy to understand thanks to pacochin tutorial and soeren documentation.  I need a little advice from u guys!  :-\

All men die, not all men really live!

pacochin

Hi aramil,

How u doing. long time no hear. Looks like your payment gateway provided gives you their result page and you cant edit that page, isnt ?

Do they offer you a button to post it back to your VM server ?

Perhaps you can ask them to give u a Button with the Label "Complete Booking By Clicking Here"
and the link should go to your checkout.xxx_results.php in your VM server to handle the updates.

Normally payment gateway is could do all this for you, unless they are not very friendly. Alternatively, you can ask them this question.

"So how the hack am i going to update my sales records with the transaction status IF you dont allow my customer to return to my web store ????"

They should have a solution for you, otherwise, CHANGE your payment gateway...use the one i  am using. Tell me which country you are from....

thks

aramil

Hi pacochin!!

Im fine, i was waiting for the final approve of the gateway until now, like one and a half month! Yes i can edit their results page. Until now, they dont offer me the "back to store" button (i emailed they asking for help, i hope to see their answer tomorrow). But just is case, im trying to understand how to do it myself. Surely is something really easy to do, but who knows? I use dreamweaver and i create the "back to store" button (like a form, validating the values, using like example a java form code) and the first time it work (i just redirect the page to my home page, not the checkout.xxx.php), but i move something LOL and never work again!))

All men die, not all men really live!

pacochin

Hi aramil,

Basically what you do is a form post... in this format...

<form action="http://www.yoursite.com/../../checkout.xxx.php" method="post">
<input type="hidden" name="yourvariablename1" value="xxxx">
<input type="hidden" name="yourvariablename2" value="xxxx">
<input type="hidden" name="yourvariablename3" value="xxxx">
...
...
<input type="button" name="backtomystore" value="Click Here to Complete Booking">
</form>

The hidden fields value "xxx" are suppose to be populated by your gateway provider and user needs to click on this button to go to your destination page (checkout.xxx.php) which will handle the updates of your database in VM.

basically thats all it should work..but personally, i dont like this workflow, becos it DEPENDS on your customer to click that crucial button...what if the line drop after the payment process...
things can get ugly..imagine your payment status gone thru, but your db not updated...hmm...

you need to think of a fail-safe system workflow when comes to collecting $ online...

cheers,

aramil

Hi Pacochin!

I really want to say: THANK YOU FOR ALL YOUR PRECIOUS HELP! that info is what i was looking for.  You r right about the workflow, i have a gateway access to see the payments in case of a crash, and i guess i can update manually the database in that case, but definitively u r right, and the best choice is redirect the user directly to the checkout.xx.php. I´ll talk to my gateway service and see if this is possible. About the code: "yourvariablename1" is the variable name in the vm script and the xxx is the value requested by the results page of my gate way? (String invoiceNumber = request.getParameter("invoiceNumber");) so it will be something like this:
<input type="hidden" name="order_id" value="invoiceNumber">  ???

In the case that they can redirect the user directly to my checkout.xx.php, is just adjust the code of the php file just like u say in your tutorial. (By the way, you must send it that tutorial to VM team, is really easy to understand)

Cheers!  ;D
All men die, not all men really live!

pacochin

Hi aramil,

Yup ! you are fast learner.

<input type="hidden" name="order_id" value="invoiceNumber"> invoicenumber will be that data u need.

I guess they can do some redirect...all your payment gateway needs to give u is the code for redirect, depending what scripting language they are using. PHP or JSP or ASP use different syntax.

take care man ! let me know once your site is up and running, i can do some test for you too !!!!
:)

aramil

Thx pacochin!

I will and i´ll make u a gift!

Its a promise

Aramil
All men die, not all men really live!

aramil

Hi pacochin!

Paco, a little question, when i´m redirected to the checkout.xxx_result.php i receive a "Direct access to this location in not allowed" and can´t see the checkout page. Any idea?  ???

Thx.
All men die, not all men really live!

pacochin

hey,
u need to make sure your Form setting method is POST....
i think..let me know if problem exist

aramil

#28
Hi paco!

READY! all work nicely! Just one last question:

im using this code to redirect the user from the gateway result page to my checkout.xxx_result.php:

       out.println("<SCRIPT LANGUAGE=\"JavaScript\">");       out.println("window.location=\"checkout.xxx_result.php, something like this:

https://www.mysite.com/index.php?......invoicenumber=XX&transactionnumber=XX

and if u modify those values and do a refresh, the checkout.xx update the order status no matter the real result of the transaction.

I need to send those values hidden or Post to avoid this, but i dont know how to do it in java

Thx
All men die, not all men really live!

pacochin

hello aramil,

Congrats !!!! Ok. I have the same issues with you, we cant stop user to modify the url parameters....if  values set are passed this way. But i am sure there is a way to do it.

Let me check with some of my programmer friends and get back to you.

thks