VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: jaguar on June 19, 2006, 16:14:11 PM

Title: checkout confirm, result and thankyou pages
Post by: jaguar on June 19, 2006, 16:14:11 PM
Hi everyone,

I you browse the source files, you find that some payment methods have their own confirm and result pages. How can I configure VM to use my own? What is the required funtionality of those pages? In particular, what is the result page for?

thank you.
Title: Re: checkout confirm, result and thankyou pages
Post by: Soeren on June 20, 2006, 14:00:10 PM
When I implemented the danish payment modules I needed this unusual solution, because the danish payment providers have a worldwide-unique way of processing webpayments. The Store's websites for the credit card details form are fetched by the payment provider's server and presented in a secure environment on their server. Very curious.

The files have this meaning:

checkout.*_cc_form.php: Provides the CC Form for putting in all needed details plus hidden form values.

checkout.*_result.php: Receives the GET variables from the payment provider's server when the customer is redirected after payment. The result page checks if the transaction was successful or not - if yes, it updates the order status.

ciao, Soeren
Title: Re: checkout confirm, result and thankyou pages
Post by: jaguar on June 20, 2006, 15:23:46 PM
Thanks Soeren, its just what I needed to know. But still I have a few more questions.

I'm supposing that the checkout.*_cc_form.php is the page presented when the user must confirm the order. And that the checkout.*_result.php page is never seen by the user.

I also suppose that the asterisc is where my payment method name or code goes, but I can't see when they are used. I am not presented with a different confirmation page. Not even when I use Dankort / PBS or iKobo.

Am I missing something to make VM use my checkout and result pages?

My payment provider uses POST to send back the variables after payment. Is there a special reason why the result page uses GET?
Title: Re: checkout confirm, result and thankyou pages
Post by: Soeren on June 22, 2006, 13:42:55 PM
No,
it doesn't matter if GET or POST. The page can handle both. But to redirect the customer to that result page or cc_form page you must use the "return to" parameters posted to the payment gateway using the "page" variable in the URL:

index.php?option=com_virtuemart&page=checkout.XXX_result.php

ciao, Soeren
Title: Re: checkout confirm, result and thankyou pages
Post by: jaguar on June 30, 2006, 13:45:38 PM
I can't find where the checkout.confirm.php page is used. There is no occurance of it in checkout.index.php.

I thought it would be used in step CHECK_OUT_GET_FINAL_CONFIRMATION as an included page or something.

Pablo
Title: Re: checkout confirm, result and thankyou pages
Post by: jaguar on July 03, 2006, 17:30:40 PM
In the checkout.thankyou page there is a query that retrieves the Order & Payment Info. In the query you need the value of the user_id that comes out of an array called $auth.

Why do I need the user_id? isn't it sufficient to have the order_id for the query?

Pablo
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on July 04, 2006, 20:18:40 PM
Hi Guys,

The payment gateway i am using in my part of the world is not supported by VM..So I will be the first one customizing it...If I am successful, I will post the payment module files here to help others.
But in the mean time I NEED HELP...i am no programmer...

I have spent until now about 50 hours...to figuring out how to customize the payment module for my payment gateway (Commerce Payment)...thanks to jaguar helping me to point me in to this thread....i am almost there...but i got this error about

Failure in Processing the Payment (MD5 Check Failure)

What i did
======
1. I created a payment module from scratch based on the little knowledge i have by copying one of the payment module which is "paypal related" and rename it to my own.
2. Done the ps_XX.php and ps_XX.cfg.php files accordingly. Works perfect.
3. Added a Payment Extra Info where I POST the information to my payment Gateway
4. The Return URL is pointed to my checkout.XX_result.php.
5. I have modified checkout.XX_result.php base on checkout.dandomain_result.php.
6. I get this error "Failure in Processing the Payment (MD5 Check Failure)"

Environment of testing
==============
I am using JSAS local development to test my script connecting to Commerce Payment using internet. Is it the reason ???

What's Next
========
If I am successfully seeing a Success Page, order_status updated...do I still need a notify.php file ???
I really want to get to the bottom of this....

Questions
======
I really like the workflow to have the Button to ask my customer to "Click HERE to COMPLETE ORDER in our SECURE PAYMENT SERVER"...currently i dont have this page...what can i do ?

Sorry to have so many questions.....thanks guys !

Title: Re: checkout confirm, result and thankyou pages
Post by: jaguar on July 05, 2006, 00:13:11 AM
I had the same problem while implementing a payment method. What I found out was that $submitted_hashbase and $mosConfig_secret were empty strings.

I posted a question (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=19774.0) about checking a valid session but got no reply. I really didn't look more into it and just removed all the code. Try the same thing so that you can go foward, and later you can improve your code.

You might find useful the payment method (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=19808.0) I did.

Pablo
Title: Re: checkout confirm, result and thankyou pages
Post by: w_d_o_a on July 05, 2006, 02:29:36 AM
sampipe has created a couple of payment modules for DPS processor in New Zealand, perhaps they would help

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15269.0
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on July 08, 2006, 18:58:18 PM
Hi Pablo,

Thanks ! I got it working finally, but i have a security question below.

I directed my returnurl from my payment server to checkout.mypayment_result.php, below is the file

================checkout.mypayment_result.php==================


<?php
defined('_VALID_MOS') or die( "Direct access to this location is not allowed.");   

require_once(  CLASSPATH ."payment/ps_commercepayment2.cfg.php");

/**
    * Read post from Commerce Payment system and create reply
    * starting with: 'cmd=_notify-validate'...
    * then repeating all values sent: that's our VALIDATION.
    **/

    $workstring = 'cmd=_notify-validate'; // Notify validate
    $i = 1;
   
     foreach ($_POST as $ipnkey => $ipnval) {
        if (get_magic_quotes_gpc())
            // Fix issue with magic quotes
            $ipnval = stripslashes ($ipnval);
           
        if (!eregi("^[_0-9a-z-]{1,30}$",$ipnkey)  || !strcasecmp ($ipnkey, 'cmd'))  {
            // ^ Antidote to potential variable injection and poisoning
            unset ($ipnkey);
            unset ($ipnval);
        }
        // Eliminate the above
        // Remove empty keys (not values)
        if (@$ipnkey != '') {
          //unset ($_POST); // Destroy the original ipn post array, sniff...
          $workstring.='&'.@$ipnkey.'='.urlencode(@$ipnval);
        }
        $post_msg .= "key ".$i++.": $ipnkey, value: $ipnval<br />";
    } // Notify string
   
   
   $error_code = trim(stripslashes($_GET['ERR_CODE']));
   $error_desc = trim(stripslashes($_GET['ERR_DESC']));
   $merchant_trx_id = trim(stripslashes($_GET['MERCHANT_TRANID'])); /*Merchant's own assigned trx id' */
   $trx_id = trim(stripslashes($_GET['TRANSACTIONID'])); /* Commerce payment assigned trx id */
   $trx_date = trim(stripslashes($_GET['TRANDATE']));
   $trx_status = trim(stripslashes($_GET['TXN_STATUS']));
   $item_name = trim(stripslashes($_GET['DESCRIPTION']));
   $amount = trim(stripslashes($_GET['AMOUNT']));
   $remoteip = trim(stripslashes($_GET['REMOTEIP']));
/* Print out the result */
$html = "
<html>
<head>
<title>Direct Payment Solutions: Secure Payments Page PHP Results</title>
</head>
<body>
<h1>Commerce Payment Solutions: Secure Payments Page PHP Results</h1>
<p>$result</p>
<table>                       
<tr><th>Element</th>          <th>Value</th> </tr>
<tr><td>Error Code</td>          <td>$error_code</td></tr>
<tr><td>Error Desc</td>            <td>$error_desc</td></tr>
<tr><td>Merchant ID</td>   <td>$merchant_trx_id</td></tr>
<tr><td>Commerce Payment Transaction ID</td> <td>$trx_id</td></tr>
<tr><td>Transaction Date</td>         <td>$trx_date</td></tr>
<tr><td>Transaction Status</td>         <td>$trx_status</td></tr>
<tr><td>Description</td>         <td>$item_name</td></tr>
<tr><td>Amount</td>         <td>$amount</td></tr>
</table>
</body>
</html>";

echo $html;   
   
   

/*Next, once disecting the URL parameters, we check the status and decide what to do */   


$qv = "SELECT order_id, order_number FROM #__{vm}_orders ";
$qv .= "WHERE order_id='".$merchant_trx_id."' AND user_id='".$my->id."'";
$dbo = new ps_DB;
$dbo->query($qv);
if( $dbo->next_record() )
{
   // valid order.
   $d['order_id'] = $dbo->f("order_id");
       
   if( $trx_status=="A" && $error_code=="00" )
   {   echo "updating....";
       // order successful.
      // UPDATE THE ORDER STATUS to 'VALID'
      $d['order_status'] = COMMERCEPAYMENT2_VERIFIED_STATUS;
      // Setting this to "Y" = yes is required
      $d['notify_customer'] = "Y";
      $d['include_comment'] = "Y";
      // Notifying the customer about the transaction key and
      // the order Status Update
      $d['order_comment'] = "
         The Payment Transaction was approved by Commerce Payment. \n
         The Transaction has received the following Order Number:\n\n
         Order Number: ".urldecode($merchant_trx_id)."\n";
               
      require_once ( CLASSPATH . 'ps_order.php' );
      $ps_order= new ps_order;
      $ps_order->order_status_update($d);
              
       ?>
            <img src="<?php echo IMAGEURL ?>ps_image/button_ok.png" align="center" alt="Success" border="0" />
            <h2><?php echo $VM_LANG->_PHPSHOP_PAYMENT_TRANSACTION_SUCCESS ?></h2>
        <?php
   }
   elseif( $error_code!=="00" )
   {
      // the Payment wasn't successful. Maybe the Payment couldn't
      // be verified and is pending
      // UPDATE THE ORDER STATUS to 'INVALID'
      $d['order_status'] = COMMERCEPAYMENT2_INVALID_STATUS;
      // Setting this to "Y" = yes is required by Danish Law
      $d['notify_customer'] = "Y";
      $d['include_comment'] = "Y";
      // Notifying the customer about the transaction key and
      // the order Status Update
      $d['order_comment'] = "
         The Payment Transaction was not approved by Commerce Payment and therefore has not been completed.";
      require_once ( CLASSPATH . 'ps_order.php' );
      $ps_order= new ps_order;
      $ps_order->order_status_update($d);
           
      ?>
            <img src="<?php echo IMAGEURL ?>ps_image/button_cancel.png" align="center" alt="Failure" border="0" />
            <h2><?php echo $VM_LANG->_PHPSHOP_PAYMENT_ERROR ?></h2>
        <?php
         echo "Error: Transaction declined";
        ?>
           <br />
           <p><a href="<?php @$sess->purl( SECUREURL."index.php?option=com_virtuemart&page=account.order_details&order_id=$order_id" ) ?>">
              <?php echo $VM_LANG->_PHPSHOP_ORDER_LINK ?></a>
           </p>
        <?php
   }
   else
   {
      ?>
      <img src="<?php echo IMAGEURL ?>ps_image/button_cancel.png" align="center" alt="Failure" border="0" />
      <span class="message"><? echo $VM_LANG->_PHPSHOP_PAYMENT_ERROR ?></span>
      <?php
   }
}
else
{
   ?>
   <img src="<?php echo IMAGEURL ?>ps_image/button_cancel.png" align="center" alt="Failure" border="0" />
   <span class="message"><? echo $VM_LANG->_PHPSHOP_PAYMENT_ERROR ?> (Order not found)</span><?php
}
=======================END====================================

It works perfectly !
But questions about security

1. As you can see above, i use $_GET['FieldName'] instead of $_POST['FieldName']. Is there anything wrong with it ? When i use Post, i cant get the value. But when i use Get, its ok.

2. I manaully changed the URL paramenters and i can foul play my payment status. How do i overcome it ? Is it thats why notify.php is created to extract the url parameters value and then redirect to checkout.mypayment_result.php to process it ? So to PREVENT user to modify the url parameters manually and upset the payment status ?

Thank you for helping me and guiding me into the right direction !!!!!
Greatly appreciated !
pacochin :)
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on July 08, 2006, 19:20:04 PM
Hi guys,

Another question...

Can anyone advise me what is the variable name for product name ? I need to extract this value to post to my payment gateway....i see some example using order_id, address...etc...

===========My extra payment info=====
"MERCHANTID" => COMMERCEPAYMENT2_MERCHANTID,
"MERCHANT_TRANID" => $db->f("order_id"),
"TRANSACTIONTYPE"=> COMMERCEPAYMENT2_TRANSACTIONTYPE,
"AMOUNT"=> round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
"NEWTRANSACTION"=> COMMERCEPAYMENT2_NEWTRANSACTION,
"DESCRIPTION"=> $db->f("product_name"),
"REMOTEIP"=> $_SERVER['REMOTE_ADDR'],
....
===============END=============
But i dont get the value for product name...to pass to my payment server, can anyone advise.
thks
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil on August 19, 2006, 20:11:42 PM
Hi all!

Im looking for a solution like this, my gateway have their own results page then i must go back to the shop.

Those checkout_xx_cc_form.php are part of some payment module or just part of VM? Where are those files in order to be edited?

I used paypal extra info, edited to send the user to my gateway to chosse their credit card type (with hidden data like the order id and the total amount) when the user click on CONFIRM ORDER, and that work fine. I only need to go back to VM from the results page of my gateway and see the Thanks u page (order info).

The data sended from my gateway is just the order id, amount and a confirmation number (succesfull or failed).

I can do this with the checkout_xx_cc_checkout and results.php pages?

I`ll like to integrate this, instead of place the order and then the user choose to pay or not, just to keep a automated and clean proccess. Please i need some advice from you guys.


Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on August 19, 2006, 21:11:09 PM
Hi Aramil,

Let me understand you better...

You re-direct your customer to an external payment gateway pages (similar to PayPal style) and when customer done with the credit card submission, your gateway re-direct the user back to your website to show a thank you page.

Is this what you want ? Let me know, i can share my 2cents worth, becos i just got one going !

thks
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on August 24, 2006, 13:43:02 PM
Hi aramil,

I am working on a tutorial document for this thread. I am half way there, but i need to rush home from office now. but i promise you i will get it done for you tonite.

So once its uploaded here, it will benefits the rest.

So, this is just a note to tell u that i am working on it...hang on buddy.

P.s
My whole afternoon had been wasted for formatting my laptop due to trojan !$#%%%&&@#
anyway. time to clean up my c drive... :D
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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

Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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]
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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.  :-[
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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?



Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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 :)
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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!  :-\

Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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!))

Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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,
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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 !!!!
:)
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil on October 26, 2006, 08:05:03 AM
Thx pacochin!

I will and i´ll make u a gift!

Its a promise

Aramil
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil 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.
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin 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
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil on November 03, 2006, 03:09:08 AM
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=\"https://www.mysite.com/index.php?.....checkout.xxx_result.php?&invoiceNumber="+invoiceNumber+"&transactionNumber="+transactionNumber+"&totalAmount="+totalAmount+"\"");
      out.println("</Script>");


The issue here is that the user can see the results on the address of the explorer (URL), once he is in the 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
Title: Re: checkout confirm, result and thankyou pages
Post by: pacochin on November 03, 2006, 05:00:58 AM
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
Title: Re: checkout confirm, result and thankyou pages
Post by: aramil on November 03, 2006, 20:53:51 PM
Ok! i´ll try to find a solution too and if i found it ill post here.
Title: Re: checkout confirm, result and thankyou pages
Post by: waisign on January 24, 2007, 10:01:16 AM
hi pacochin and aramil, i am now in the same situation and im stuck!. ok, i downloaded pacochin's tutorial and read it. when i try implementing it, i created a new payment module in VM, i key in the same values as listed in the tutorial. i copied the codes in the pdf apenddix and save it as the same filenames just to tryout

after typing in the codes in the extra payment info, and press save. it saved ok. But when i GO back in so that i can key in the values unde the Payment Method Form configurations, i get a WHITE page with the inout values for the Code etc still there BUT the config page tab empty. It also has an error called cmThemeOffice undefined. Please do help.

below attached the 2 images of error i got. please advise.

(http://ejilong.net/demo/mpx/images/error1.gif)

(http://ejilong.net/demo/mpx/images/error2.gif)


Besides this after reading the pdf tutorial, i also noticed that the location in which pacochin mentioned the files to create and its location. I noticed that the locaiton of the files are stated as administrator/components/com_virtuemart/html/classes/payment/

But this is weird. Shouldnt it be:  administrator/components/com_virtuemart/classes/payment/
together with all the other default payment methods? am i missing something here? please advise. thanks
Title: Re: checkout confirm, result and thankyou pages
Post by: waisign on January 24, 2007, 11:09:52 AM
update: i deleted all the codes and add everything in again. now after i press save, i get a total blank page. :(

i notice that i get a blank page onyl if i key in the classname there: ps_commercepayment2 and save.

The tutorial also mentioned something about making sure that the varialble names are unique and not duplicates. i checked and  made sure already. I pasted the addon varialbles under :

class vmLanguage extends vmAbstractLanguage {}

together with all the other variables. is this right?

i suppose the coding in the Extra Payment Info under configuration is alright.

please help (T.T)
Title: Re: checkout confirm, result and thankyou pages
Post by: waisign on January 25, 2007, 09:11:46 AM
hi there. thanks for the tutorial, i manage to get the interface showing. Now a final bit before it actually gets it running.

I need to parse a few values in addition to the ones stated there in the tutorial. is there anyone here who can help me?

i would like to call frm the db and parse:

the product name
the firstname
usercontact.

i tried

"ProdDesc" => $db->f("order_item_name"), //the name of the product //added by me
"UserName" => $db->f("first_name"), //take first name of user
"UserContact" => $db->p("phone_1"), //the primary phone of the user

** actually i tried both $db->f and $db->b. whats the difference actually? please advise.

but its not working. can anyone help please? or do we actualy ahve to make another db query on this? to get this work?

thanks. greatly appreciated. :)
Title: Re: checkout confirm, result and thankyou pages
Post by: waisign on January 26, 2007, 10:35:48 AM
hi everyone. updates to the probs above. well i manage to call some of them by making another query based on what Axel did on one of his threads. But i still could call the order_item_name. is there a way around this?

Besides that, could someone please enlighten me on this matter please? esp pacochin :)

i noticed that frm your tutorial , the values are sent to the URL using POST as i noticed the action = 'post" part. But then when i click confirm, the values are being parsed yes, BUT i saw the values appearing in the URL bar, just like the GET method. and becos of this, the payment gateway company is not accepting the records. Is there a way to fix this and also a possible explaination on why this happens? i really dont know how to explain to them.. haha.. please help! T.T
Title: Re: checkout confirm, result and thankyou pages
Post by: waisign on January 27, 2007, 15:48:39 PM
bump? please?
Title: Re: checkout confirm, result and thankyou pages
Post by: jameel on February 25, 2011, 22:36:45 PM
Hello friends
i have one question i am using available solution for my payment gateway every thing works fine.. but my gateway notifies about payment in hidden way to the any url i give them say test.php.. and they don't send verification to return url.. my payment gateway is similar to paypal.

I have successfully implemented their Instant Payment Notification script and can modify my order status after getting notified, now i need to send my customer email notification. remember i have to trigger notification from an external file..

any help regarding this?
Title: Re: checkout confirm, result and thankyou pages
Post by: jameel on February 25, 2011, 22:43:52 PM
i am selling digital items so need to send download id as well
Title: Re: checkout confirm, result and thankyou pages
Post by: raj197911 on August 24, 2012, 12:58:44 PM
Hi Friends:

I have my site configured for 4 different types shoppers.

I needed to configure different paypal address for different types of shopper.

Does Virtuemart allows multiple instances of paypal payment gateway configuration? If so how?