News:

Support the VirtueMart project and become a member

Main Menu

Payment method wanna be needs very little help!

Started by Lou Reed, December 29, 2006, 21:46:51 PM

Previous topic - Next topic

Lou Reed

Hello everyone!

I've been searching this forum, read tutorials, downloaded VirtueMart PHP Reference to no avail.
Simply said, I'm stuck!!!
This sucks because of all the work already done and the countless hours spent to learn something about VirtueMart.
Needless to say, I'm a zero as far as php knowledge (Yep, yet another one).
However, I was able to get VirtueMart integrated on an existing web site, customized my needs and how
things are displayed to the customer and blah blah blah.

Now I'm stuck with a payment method, which I got to work partially and need the help of a kind soul.
I'm using the standard ps_payment.php, set it to Paypal Related method, and added my own credit card form plus other code to the "Configuration"-->"Payment Extra Info"

This way I'm able to pass to my payment provider all info about the credit card and the Bill To information that the user has already inserted at registration. I would like to add to my form, and pass it to my payment provider, the user Ship To information and later I will explain why. This is what I did so far (little example):

<input name="ssl_avs_address" type="hidden" value="<?php echo $user->address_1?>" >
<input name="ssl_address2" type="hidden" value="<?php echo $user->address_2?>" >
<input name="ssl_city" type="hidden" value="<?php echo $user->city?>" >

And so on for all the fields that need to be copied to my form.
For what I undestand, VirtueMart differentiate Bill To from Ship To using the format "BT" for the first and "ST" for the second. I also understand that when I use, for istance: <?php echo $user->address_1?> I'm getting the database entry "address_1" in format "BT", because it is the default, copied to my form.

So my questions to you are these:
How do I get the Ship To informations copied to my form, using the form method posted above?
How do I get the <?php _ _ _ _ _ _ _ _?> to fetch from database the Ship To informations?

Why do I need to do this!
1) Hacking or tweaking an existing payment form is out of my capabilities and I don't want to annoy anyone to create one.

2) I had to remove the link that the customer could follow to get to the page where he/she can print the order receipt from the "checkout_thankyou_php", because as soon the customer leaves that page, all the info I need to pass is gone.

3) By having all the info passed to my payment provider, I can then choose to have the customer  print his/her receipt directly on said provider form, or have the info redirected to a custom receipt form on my web site.

Can anyone help?

Thanks, and have a Happy New Year.
Lou.

Lou Reed

Man, the question I posted a few days back is either too dumb for the experts to answer it, or too complicated to be solved they way I did the rest of my form.
26 people read the help request and no one knows the answer?
Well, I guess I should take confort in this, I'm not the only one dumb as a door knob when it comes to PHP programming.

Anyway, went through several payments modules and other files, somehow I figure it out that after a database query, "dbbt" is assigned to get the "BillTo" information, "dbst" is assigned to get the "ShipTo".

So my question is: How come if I place this line in my form:

<input name="ssl_avs_address" type="hidden" value="<?php echo $dbbt->f("address_1")?>" >

I do get the "BillTo" information for that particular database item copied to my form, but if I replace "dbbt" with "dbst" instead of the "ShipTo" info I get a parse error?

Can anyone >>>PLEASE<<< help me? Passing the ship to info to the payment provider is the last thing I need, can't really open the shop until I get this resolved.

Thank you!

Lou Reed

Never mind, found solution by myself. Thank you anyway!