Jump to content

Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT Error after Paypal Payment


ajensen27

Recommended Posts

So I just installed Paypal version 3.5.8 and everything works find up until I submit the payment on the Paypal site. I get the attached internal server error. I checked the console in Chrome and did not see any errors so I have no idea what could be causing this. I did see my payment went through via my personal paypal account that I made my test purchase with. Anyone seen this before and have a fix?

 

post-323956-0-01078500-1376860151_thumb.png

Edited by ajensen27 (see edit history)
Link to comment
Share on other sites

Thanks Vekia... I turned on error reporting and re-enabled the Paypal module but now my "Delete" button to delete a product for your cart and my vouchers box disappeared from the page... I need the vouchers box so I can enter in a dummy voucher to make my cart only .50 so I can test an actual payment.

 

It was doing this earlier but I disabled the "express checkout" option and it fixed the issue. But now it's doing it again and I tried re-enabling and disabling that option but it didn't fix it.

 

Any idea what is happening now?

Link to comment
Share on other sites

Ok, so I tried it in IE 10 and after submitting my payment on Paypal, I was returned to a blank page. This is what the console said.

 

HTML1527: DOCTYPE expected. The shortest valid doctype is "<!DOCTYPE html>".

payment.php, line 1 character 1

Link to comment
Share on other sites

  • 2 weeks later...

Thanks... Does this have the authorize and capture later feature like the other module?

 

Also, what am I supposed to put in the "Paypal  Business Account" text box? My Paypal merchant ID? I have all my other API credentials, just have no idea what this first box means.

Link to comment
Share on other sites

Yeah so I did some testing and it doesn't have authorize and capture later like the other module does. It also doesn't redirect you automatically back to your store after making the paypal payment which I seems like the other module does (the url looks like it does but I can't tell for sure because this is the step where I get the error in my above post).

 

No one has any idea what this error might mean?

 

 Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT (/home/incontis/domains/llmedico.com/public_html/modules/paypal/paypal_orders.php, line 70)
Link to comment
Share on other sites

This is the section of code it is referring to. Does anyone see anything off (I'm not a programmer)? Thanks!

 

'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'],  <---- this line

	public static function getTransactionDetails($ppec = false, $payment_status = false)
	{
		if ($ppec && $payment_status)
		{
			$transaction_id = pSQL($ppec->result['PAYMENTINFO_0_TRANSACTIONID']);
			return array(
				'currency' => pSQL($ppec->result['PAYMENTINFO_0_CURRENCYCODE']),
				'id_invoice' => null,
				'id_transaction' => $transaction_id,
				'transaction_id' => $transaction_id,
				'total_paid' => (float)$ppec->result['PAYMENTINFO_0_AMT'],
				'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'],
				'payment_date' => pSQL($ppec->result['PAYMENTINFO_0_ORDERTIME']),
				'payment_status' => pSQL($payment_status)
			);
		}
		else
		{
			$transaction_id = pSQL(Tools::getValue(ID_TRANSACTION));
			return array(
				'currency' => pSQL(Tools::getValue(CURRENCY)),
				'id_invoice' => pSQL(Tools::getValue(ID_INVOICE)),
				'id_transaction' => $transaction_id,
				'transaction_id' => $transaction_id,
				'total_paid' => (float)Tools::getValue(TOTAL_PAID),
				'shipping' => (float)Tools::getValue(SHIPPING),
				'payment_date' => pSQL(Tools::getValue(PAYMENT_DATE)),
				'payment_status' => pSQL($payment_status)
			);
		}
	}
Edited by ajensen27 (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Hello all, this is just to let you know that the PayPal Module is updated to 3.6. You can download it here http://addons.prestashop.com/en/payments-gateways-prestashop-modules/1748-paypal.html

 

Make sure to always have a backup of your files before you update modules. Do not hesitate to leave feedback about the module and if you have any issues, we can work together to solve them. 

 

If you are in the USA, Canada or Mexico, you can use this PayPal module here. http://addons.prestashop.com/en/payments-gateways-prestashop-modules/8277-paypalusa.html

 

Cheers,

 

-Benjamin

Link to comment
Share on other sites

Thanks Benjamin. The European Paypal module works fine except for the error in my inital post. It is occurring right after they submit the payment on the paypal page and it tries to redirect them back to the confirmation page on our site. It's still occurring after I updated to 3.6.

 

-Alex

Link to comment
Share on other sites

Can someone pleaseeeee help me with this error? I'm getting customers every day asking to use Paypal but I have to tell them it's not working at the moment. Someone out there has to know why this error is occurring.

 

 Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT (/home/incontis/domains/domain.com/public_html/modules/paypal/paypal_orders.php, line 70)
Edited by ajensen27 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Ok, did you got now another error with the line 426 of the file tools/swift/Swift/Message/Headers.php ?

 

If yes, just replace this line with this :

 

//return str_replace("' . $this->LE . '", "", "<$matches[1]>");

 

If no, just give us the error you have.

 

For me when i makes this two changes (on paypal and on swift) it work perfectly with no bugs ;)

 

P.S: Sorry if my English is not perfect, I'm French :)

Edited by TheMax98000 (see edit history)
Link to comment
Share on other sites

Thanks again for the reply TheMax.

 

I have error reporting turned on but I don't see any errors, just a white screen. I also don't see any errors in the console.

 

Also, my line 426 in Headers.php is blank. What line should I be replacing? Could you post that?

 

Thanks!

Link to comment
Share on other sites

  • 3 months later...

 

This is the section of code it is referring to. Does anyone see anything off (I'm not a programmer)? Thanks!

 

'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'],  <---- this line

	public static function getTransactionDetails($ppec = false, $payment_status = false)
	{
		if ($ppec && $payment_status)
		{
			$transaction_id = pSQL($ppec->result['PAYMENTINFO_0_TRANSACTIONID']);
			return array(
				'currency' => pSQL($ppec->result['PAYMENTINFO_0_CURRENCYCODE']),
				'id_invoice' => null,
				'id_transaction' => $transaction_id,
				'transaction_id' => $transaction_id,
				'total_paid' => (float)$ppec->result['PAYMENTINFO_0_AMT'],
				'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'],
				'payment_date' => pSQL($ppec->result['PAYMENTINFO_0_ORDERTIME']),
				'payment_status' => pSQL($payment_status)
			);
		}
		else
		{
			$transaction_id = pSQL(Tools::getValue(ID_TRANSACTION));
			return array(
				'currency' => pSQL(Tools::getValue(CURRENCY)),
				'id_invoice' => pSQL(Tools::getValue(ID_INVOICE)),
				'id_transaction' => $transaction_id,
				'transaction_id' => $transaction_id,
				'total_paid' => (float)Tools::getValue(TOTAL_PAID),
				'shipping' => (float)Tools::getValue(SHIPPING),
				'payment_date' => pSQL(Tools::getValue(PAYMENT_DATE)),
				'payment_status' => pSQL($payment_status)
			);
		}
	}

 

 

 Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT (/home/incontis/domains/llmedico.com/public_html/modules/paypal/paypal_orders.php, line 70)

 

 

Hi Guys,

 

I also encountered the above error right now. I'm using the latest version of paypal module which is 3.6.1. 

 

Anyone can help me to fix it?

 

Thank you very much for your time! :)

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...

Me too. I am using Paypal 3.7.2, prestashop 1.5.6.2 and here is the error message. Can someone please help?

 

Notice: Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT in /home/savdanac/public_html/modules/paypal/paypal_orders.php on line 70

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 130968 bytes) in /home/savdanac/public_html/tools/smarty/sysplugins/smarty_internal_compilebase.php on line 53

Link to comment
Share on other sites

  • 4 months later...

The module is expecting Paypal to provide the "shipping country code" in their response.  For what ever reason it is missing, perhaps this order does not have shipping?

 

You may want to reach out to Paypal and ask them why this parameter was not sent to your store.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I am also facing similar error. I investigated the code a bit and found that PayPal API is not returning shipping address related values. PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE is completely missing but you can get country code by using $pped->result['COUNTRYCODE'] instead. Almost all the shipping address related values required under setCustomerAddress() function are missing in the "result" array of "$ppec" object.

 

I am investigating it more and I will post here in case I will get success in finding any solution for this issue. In case anyone have already sorted it out, please post the solution here.

 

Thanks in advance.

Link to comment
Share on other sites

  • 4 weeks later...

Same here ...

Below all the errors I got:

 

Notice: Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT in /var/www/vhosts/.../httpdocs/presta/modules/paypal/paypal_orders.php on line 70 Fatal error: Uncaught exception 'PrestaShopException' with message 'Property Order->payment is empty' in /var/www/vhosts/.../httpdocs/presta/classes/ObjectModel.php:866 Stack trace: #0 /var/www/vhosts/.../httpdocs/presta/classes/ObjectModel.php(272): ObjectModelCore->validateFields() #1 /var/www/vhosts.../httpdocs/presta/classes/order/Order.php(299): ObjectModelCore->getFields() #2 /var/www/vhosts/.../httpdocs/presta/classes/ObjectModel.php(480): OrderCore->getFields() #3 /var/www/vhosts/.../httpdocs/presta/classes/order/Order.php(304): ObjectModelCore->add(true, true) #4 /var/www/vhosts/.../httpdocs/presta/override/classes/PaymentModule.php(238): OrderCore->add() #5 /var/www/vhosts/.../httpdocs/presta/modules/paypal/paypal.php(1467): PaymentModule->validateOrder(31, 2, 0.1, '', 'Payment accepte...', Array, 1, false, '70af425524f66c7...', Object(Shop)) #6 /var/www/vhosts/.../httpdocs/presta/modules/paypal/express_checkout/payment.php(290): PayPal->validateOr in /var/www/vhosts/.../httpdocs/presta/classes/ObjectModel.php on line 866

Link to comment
Share on other sites

  • 3 weeks later...

Excuse me for the bad language.

Hi i have the same problem and i have fix it.

It seems that paypal needs states for some address from some countries. I had the same problem with some addresses in china.

Just add states to all countries listed above. Hope it helps.

 

This is from the official documentation.

 

PAYMENTREQUEST_n_SHIPTOSTATE State or province. 
It is required if the address is in one of the following countries: Argentina, Brazil, Canada, China, Indonesia, India, Japan, Mexico, Thailand or USA. PayPal accepts State codes for some countries.

Character length and limitations: 40 single-byte characters.

Edited by corosion (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...

Hello,

 

Does anyone found any solution?

I have been stuck for a week with the same problem and I can't find any solution.

It is really frustrating this situation..

 

Does Paypal just not work with Prestashop 1.6 or what?

 

Prestashop 1.6.0.14 - Paypal module v3.8.4

 

Thank you

Link to comment
Share on other sites

Hello,

 

Does anyone found any solution?

I have been stuck for a week with the same problem and I can't find any solution.

It is really frustrating this situation..

 

Does Paypal just not work with Prestashop 1.6 or what?

 

Prestashop 1.6.0.14 - Paypal module v3.8.4

 

Thank you

Did you bother to read the post above yours?  Things work properly, when they are used properly.  If you getting an error that says the address requires a State, then perhaps you should review the address being used, and ensure it has a valid State

Link to comment
Share on other sites

Hi Bellini,

First of all thanks for replying.
Of course I read the post above, I have read all post about this issue and there's no solution at the moment.
For example in this post, the original issue (PAYMENTREQUEST_0_SHIPPINGAMT) is not solved yet. The solution shown above doesn't fix the issue, at least for me beacuse I don't sell to such a countrys, but no others users replied "worked for me" neither.

 

I know things work properly when used right, this is why I'm trying to sort out where is my mistake, but i'm really surprised that this error has been reported more than once and never solved as far I could saw.

 

Thanks

Edited by aleixki (see edit history)
Link to comment
Share on other sites

Hi again,
 
When I try to use bankwire payment option I get also an error:
"Property OrderHistory->id_order_state is empty at line 872 in file classes/ObjectModel.php"
 
This error also appears in the complete error with Paypal confirmation page:
 
"Notice: Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT in /home/bfresccobu/www/modules/paypal/paypal_orders.php on line 70

Fatal error: Uncaught exception 'PrestaShopException' with message 'Property OrderHistory->id_order_state is empty' in /home/bfresccobu/www/classes/ObjectModel.php:872 Stack trace: #0 /home/bfresccobu/www/classes/ObjectModel.php(278): ObjectModelCore->validateFields() #1 /home/bfresccobu/www/classes/ObjectModel.php(486): ObjectModelCore->getFields() #2 /home/bfresccobu/www/classes/order/OrderHistory.php(454): ObjectModelCore->add(true) #3 /home/bfresccobu/www/classes/order/OrderHistory.php(380): OrderHistoryCore->add(true) #4 /home/bfresccobu/www/classes/PaymentModule.php(676): OrderHistoryCore->addWithemail() #5 /home/bfresccobu/www/modules/paypal/paypal.php(1418): PaymentModuleCore->validateOrder(127, 2, 0.05, 'PayPal', 'Payment accepte...', Array, 2, false, 'e69f5af8ae551cc...', Object(Shop)) #6 /home/bfresccobu/www/modules/paypal/express_checkout/payment.php(290): PayPal->validateOrder(127, 2, 0.05, 'PayPal', 'Payment accepte...', Array, 2, false, 'e69f5af8ae551cc...', Object(Shop)) #7 /home/bfresccobu/www/modules/pay in /home/bfresccobu/www/classes/ObjectModel.php on line 872"
 
It looks like there is something wrong with the id_order_state. I checked ps_order_state and it got the same content than a clean Prestashop install.
 
Does anyone has past through this and found a solution other than reinstall Prestashop from scratch?
 
Thank you

Edited by aleixki (see edit history)
Link to comment
Share on other sites

  • 2 months later...

hi my country does not have any states would this work on paypal orders.php line 70 : ?? if shipping is zero set to zero??

 

change this:

'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'],

 

to this:

 

if ($ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT']) {
'shipping' => (float)$ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT']
} else {
'shipping' => 0 } ,
Link to comment
Share on other sites

having states or not does not have anything to do with free shipping.  Can you explain what you are trying to accomplish?  Do you want to provide free shipping?  Or are you trying to remove the shipping address?

 

If you do send a shipping address, it is important that your localization settings match what Paypal is expecting.  If paypal thinks your Country has states, then you must provide states for that address, otherwise Paypal will provide you with an error.

Link to comment
Share on other sites

what i want and im sure others trying. is to make it easy for customers to pay so that they pay, as opposed to filling in fields. i just need an email, so the error occurs when it doesnt find, country, address, city , zip code , etc... i sorted some of it out by if (no field) set to null or empty, ''.

Link to comment
Share on other sites

There are fields that Paypal require, you cannot simply remove them and expect it to work...

 

If you do not want to collect a shipping address from the customer, then you need to alter the paypal module so that a shipping address is not sent.  The Paypal API supports by using a 'no shipping' parameter.  You will need to read the Paypal API documentation and educate yourself on this.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...