News:

Support the VirtueMart project and become a member

Main Menu

Cannot set to test mode

Started by spyderwoman, May 17, 2010, 18:24:19 PM

Previous topic - Next topic

spyderwoman

I am trying to test my ipn but am unable to set my test mode to yes in the Payment Method Form for PayPal.
When I change it to yes and save, it does not save  (although it says it does) and displays this error:
Warning: fopen() has been disabled for security reasons in /*******/administrator/components/com_virtuemart/classes/payment/ps_paypal.php on line 185

This file seems file and has not been edited either.

beachy

When you are in the PayPal configuration tab do you have the message

/administrator/components/com_virtuemart/classes/payment/ps_paypal.cfg.php :: Writeable

at the top? If not you need to change the file permissions so that you can save the changes to enter into test mode.
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

stinga

G'day,

I never got the PP sandbox to work, it seems far to different to the real world.
I ended up just using the real PP account, you don't need to actually pay to see if the data you are getting is correct.
Once I had the data to PP correct, I created a 0.01 product and purchased that to test the IPN process, once you have an IPN you can keep sending the same one.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

spyderwoman

Thanks beachy, and yes. the Writable message appears but i still get that error when  I save.

beachy

Can you tell me the file permissions you have got for ps_paypal.php & ps_paypal.cfg.php

In addition can you post the contents of ps_paypal.cfg.php
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

spyderwoman

Thanks for the help.
Both are 644 (code is below... i removed the paypal address)

<?php
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

define ('PAYPAL_DEBUG''0');
define ('PAYPAL_EMAIL''xxx@xxx.com');
define ('PAYPAL_VERIFIED_ONLY''0');
define ('PAYPAL_VERIFIED_STATUS''C');
define ('PAYPAL_PENDING_STATUS''P');
define ('PAYPAL_INVALID_STATUS''X');
?>

beachy

Nothing looks wrong at all. It may be worth manually editing the file to put paypal into test mode. To do this change the 0 in the first line to a 1.

ONce you have finshed tested just revert the 1 back to a 0.

Although its not a true fix it should give you the answer you are looking for!
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

stinga

can you post the extra payment info as well please.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

spyderwoman

Yes thank you, where do I find the extra payment info?

stinga

Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

spyderwoman

thank you.
<?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_total2),
"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" 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>';

}
?>