News:

Looking for documentation? Take a look on our wiki

Main Menu

Paypal Credit Card Entry

Started by salazar44, December 31, 2009, 09:08:24 AM

Previous topic - Next topic

salazar44

Hi All,
My question is... why am i currently having to enter credit card information twice during checkout.  First it asks me for it on my site, then it takes me to paypal and asks for the credit card inforamation again.  I prefer for it to not ask for the info on my site and just go to paypal.  What am I doing wrong?  Thanks.

My current payment setup is paypal.  The following are my settings:
Payment method type - Credit Card
Accepted cards - Visa, Master, Amex, Discover

my payment extra info is...
<?php
$db1 = new ps_DB();
$q = "SELECT country_2_code FROM #__vm_country WHERE country_3_code='".$user->country."' ORDER BY country_2_code ASC";
$db1->query($q);

$url = "https://www.paypal.com/cgi-bin/webscr";

$tax_total = $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total = $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
"cmd" => "_ext-enter",
"redirect_cmd" => "_xclick",
"upload" => "1",
"business" => PAYPAL_EMAIL,
"receiver_email" => PAYPAL_EMAIL,
"item_name" => $VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_NUMBER').": ". $db->f("order_id"),
"order_id" => $db->f("order_id"),
"invoice" => $db->f("order_number"),
"amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
"shipping" => sprintf("%.2f", $db->f("order_shipping")),
"currency_code" => $_SESSION['vendor_currency'],

"address_override" => "1",
"first_name" => $dbbt->f('first_name'),
"last_name" => $dbbt->f('last_name'),
"address1" => $dbbt->f('address_1'),
"address2" => $dbbt->f('address_2'),
"zip" => $dbbt->f('zip'),
"city" => $dbbt->f('city'),
"state" => $dbbt->f('state'),
"country" => $db1->f('country_2_code'),
"email" => $dbbt->f('user_email'),
"night_phone_b" => $dbbt->f('phone_1'),
"cpp_header_image" => $vendor_image_url,

"return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
"notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php",
"cancel_return" => SECUREURL ."index.php",
"undefined_quantity" => "0",

"test_ipn" => PAYPAL_DEBUG,
"pal" => "NRUBJXESJTY24",
"no_shipping" => "1",
"no_note" => "1"
);
if( $page == "checkout.thankyou" ) {
$query_string = "?";
foreach( $post_variables as $name => $value ) {
$query_string .= $name. "=" . urlencode($value) ."&";
}
vmRedirect( $url . $query_string );
} else {
echo '<form action="'.$url.'" method="post" target="_blank">';
echo '<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" alt="Click to pay with PayPal - it is fast, free and secure!" />';

foreach( $post_variables as $name => $value ) {
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
}
echo '</form>';

}
?>

mwf

If you change the selection for Payment Method Type to "HTML-Form based (e.g. PayPal)" the credit card entry will not display in the checkout form.
Professional Joomla Development and Support
http://www.exps.ca

salazar44

@MWF, yes... this is the action I want to happen.  However, I do not want to display "Payment Method" on the top (checkout bar).  If you can guide me on that one I would appreciate it.

Vic

mwf

salazar44,

Assuming you only have one payment method.

The only configuration change I know of to "remove" the Payment Method from the checkout bar is to make Select Payment Method and Confirmation step the same number (e.g. 3) in the VM admin. This does not remove the step, but combines it with Confirmation. So payment methods display, but is already selected.

Unfortunately, the title for Payment Method still displays on top of confirmation step title.

To get rid of the title go into
..\administrator\components\com_virtuemart\languages\common

and change this entry in english.php (assuming your using English)

'PHPSHOP_ORDER_PRINT_PAYMENT_LBL' => 'Payment Method',

to:

'PHPSHOP_ORDER_PRINT_PAYMENT_LBL' => '',


Other than this I believe your only other option is to modify the code to take out Payment Method display items.

Micah
Professional Joomla Development and Support
http://www.exps.ca

salazar44

MWF,

Thank you!  this sounds very do-able.  I will try it out when I get home from work. I will get back to you.  Thanks again!
Vic