7 Replies - 805 Views - Last Post: 10 October 2012 - 12:12 PM Rate Topic: -----

#1 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

paypal problem

Posted 10 October 2012 - 11:40 AM

<form method="post" action="paypal.php">
<label>First Name:</label><br />
<input type="text" name="first_name" size="30"><br />
<label>Last Name:</label><br />
<input type="text" name="last_name" size="30"><br />
<label>Address Line 1*</label><br />
<input type="text" name="address1" size="30"/><br />
<label>Address Line 2</label><br />
<input type="text" name="address2" size="30"/><br />
<label>City*</label><br />
<input type="text" name="city" size="30"/><br />
<label>Zip Code*</label><br />
<input type="text" name="postcode" size="30"/><br />
<label>Email*</label><br />
<input type="text" name="email" size="30" value=""/><br />
<label>Phone*</label><br />
<input type="text" name="telephone" size="30"/><br />
<input type="submit" value="Continue" />

$first_name = $_POST["first_name"];
$last_name = $_POST["last_name"];
$address1 = $_POST["address1"];
$address2 = $_POST["address2"];
$city = $_POST["city"];
$postcode = $_POST["postcode"];
$customer_email = $_POST["email"];
$telephone = $_POST["telephone"];

		$queryString  = "?cmd=_cart";
		$queryString .= "&upload=1";
		$queryString .= "&charset=utf-8";
		$queryString .= "&currency_code=" . urlencode($config['currencyCode']);
		$queryString .= "&business=" . urlencode($config['paypal']['id']);
		$queryString .= "&return=" . urlencode($config['paypal']['returnUrl']);
		$queryString .= '&notify_url=' . urlencode($config['paypal']['notifyUrl']);

		$queryString .= "&address_override=1";
		$queryString .= "&first_name=" . urlencode($first_name);
		$queryString .= "&last_name=" . urlencode($last_name);
		$queryString .= "&address1=" . urlencode($address1);
		$queryString .= "&address2=" . urlencode($address2);
		$queryString .= "&city=" . urlencode($city);
		$queryString .= "&zip=" . urlencode($postcode);
		$queryString .= "&night_phone_b=" . urlencode($telephone);
		$queryString .= "&email=" . urlencode($customer_email);
		$queryString .= '&lc=US';
		$queryString .= '&page_style=primary';
		$queryString .= '&LANDINGPAGE=Billing';


Problem is that when I change $queryString .= '&lc=US'; to GB as in Great Britain or any other country it works fine but when I put it back to US as in United States.. it gives me an error saying Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.

Is This A Good Question/Topic? 0
  • +

Replies To: paypal problem

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5380
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: paypal problem

Posted 10 October 2012 - 11:42 AM

This really isn't a PHP problem. Your account must be limited to the funds that are submitted. I would suggest contacting PayPal, likely something in your PayPal merchant account just needs to be enabled to collect other funds based on the buyer.
Was This Post Helpful? 0
  • +
  • -

#3 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

Re: paypal problem

Posted 10 October 2012 - 11:44 AM

But it works fine for Great Britain or any other country? and when I remove $queryString .= "&address_override=1"; it works fine for US.. but the reason I have that there is so that when the person fills out the info on my website everything including the address 1,2 and zip code gets transferred.. otherwise only first and last name are getting transferred
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5380
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: paypal problem

Posted 10 October 2012 - 11:47 AM

So check for country & then provide the proper form elements. Where does $queryString get it's value?
Was This Post Helpful? 0
  • +
  • -

#5 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

Re: paypal problem

Posted 10 October 2012 - 11:50 AM

the html top part in the form tag that i posted is in a different file and thats where querystring gets it's values from... i tried put a querystring for state and country both but nothing worked.. funny thing is when i use GB as the country and manually change GB to US on the URL.. everything works fine ... is there any way to fix this problem with U.S being the default country?
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5380
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: paypal problem

Posted 10 October 2012 - 11:52 AM

You are hard coding the country in your php code : $queryString .= '&lc=US';

Add a country input in your html, & then code accordingly in your php.
Was This Post Helpful? 0
  • +
  • -

#7 iheartbreakz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 196
  • Joined: 27-April 11

Re: paypal problem

Posted 10 October 2012 - 12:08 PM

tried putting country and removing $queryString .= '&lc=US'; but no progress.. any other thing wrong you see?
Was This Post Helpful? 0
  • +
  • -

#8 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5380
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: paypal problem

Posted 10 October 2012 - 12:12 PM

You are not following my advice correctly.

Put country as an input to your html, check in php for the country input value & use this if/else to adjust your query correctly.

Post your updated code & I will have a look. But I doubt you completed the above, because I didn't ask you to remove anything.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1