Author Topic: checkout confirm, result and thankyou pages  (Read 74612 times)

aramil

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #15 on: August 24, 2006, 18:09:41 pm »
Hi pacochin!

Nice to have a tutorial about this!! I`ll waiting for your work! I love open source!

Aramil

All men die, not all men really live!

pacochin

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #16 on: August 24, 2006, 19:30:58 pm »
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

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #17 on: August 24, 2006, 22:45:01 pm »
 ;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!

pacochin

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #18 on: August 25, 2006, 06:32:56 am »
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.  :-[

So when the pay is done, can u ask your payment gateway to send the user to your checkout.example_result.php ? over there u can directly handles the status of the order and display a thank you page.

aramil

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #19 on: August 29, 2006, 01:53:17 am »
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

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #20 on: August 29, 2006, 09:54:09 am »
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

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #21 on: October 25, 2006, 22:41:22 pm »
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

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #22 on: October 26, 2006, 05:17:00 am »
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

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #23 on: October 26, 2006, 05:50:15 am »
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

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #24 on: October 26, 2006, 06:22:42 am »
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

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #25 on: October 26, 2006, 06:45:54 am »
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

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #26 on: October 26, 2006, 06:58:17 am »
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

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #27 on: October 26, 2006, 08:05:03 am »
Thx pacochin!

I will and i´ll make u a gift!

Its a promise

Aramil
All men die, not all men really live!

aramil

  • Beginner
  • *
  • Posts: 38
Re: checkout confirm, result and thankyou pages
« Reply #28 on: November 02, 2006, 04:44:13 am »
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

  • Beginner
  • *
  • Posts: 40
Re: checkout confirm, result and thankyou pages
« Reply #29 on: November 02, 2006, 05:18:51 am »
hey,
u need to make sure your Form setting method is POST....
i think..let me know if problem exist