Upgraded to beta and PayPal Payments Pro does not work

Posts: 49
Joined: 12/12/2007
Bug Finder

I updated to beta and now cc processing in my PayPal Sandbox does not appear to work. Any ideas for troubleshooting would be appreciated.

Worked fine with Alpha 8

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Just want to verify, I'm getting the same results...

Payment failed.
Error: Internal Service Error
Address: An unknown error occurred.
CVV2: Not checked

fyi, nothing was changed in the code. It may just be the sandbox is screwed up. I'll check it again later.

Posts: 49
Joined: 12/12/2007
Bug Finder

Thanks. Let me know. I set up two side by side environments (alpha8 and beta1) and beta1 fails everytime. Alpha8 works some of the time but i noticed another issue where it appears to fail in the UI giving the user the error message that the payment could not be processed but it actually does go through in the admin system and sends a receipt email. Hopefully this is fixed in the beta1 but I can't tell because it causes users to resubmit the payment and then they get duplicate charges.

Is there some log that lets you see what errors are coming through? I can't figure out how to see it and get the information like you posted above unless an error is actually created.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Got the error message by attempting to process the order through the admin order view forms.

Posts: 49
Joined: 12/12/2007
Bug Finder

Thanks.

Let me know if you find anything. Unfortunately I am not a developer so I can't troubleshoot the code but I am glad to help test.

Posts: 49
Joined: 12/12/2007
Bug Finder

Just ran some more tests on the Alpha8 version and keep getting a situation that I get the error message: "
We were unable to process your credit card payment. Please verify your card details and try again. If the problem persists, contact us to complete your order."

But I then get the order receipt email and the payment shows completed in the orders section.

I had not had this problem before at all. I wonder if something is wrong with the PayPal sandbox and that is preventing it to work on the Beta1.

Here is the message that i have on the order:

01/11/2008
1:15:27 PM 1 Payment failed.
Error: Internal Service Error
Address: An unknown error occurred.
CVV2: Not checked

01/11/2008
1:16:14 PM - PayPal IPN reported a payment of 153.00 USD.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Same thing happens to me. I really believe it's some sort of deficiency or timeout on the PayPal sandbox site. The thing is slow as molasses, and it wouldn't surprise me if they time out on the response after registering the payment, sending back the internal service error. It's the nature of the beast... I wouldn't sweat it too much. Let me know if it doesn't work in production. Eye-wink

Posts: 73
Joined: 12/10/2007

I'm also having a problem processing credit card throug paypal pro in beta, alpha 8 works fine for me.

getting the following error
Payment failed.
Error: ShipToStreet : Invalid Parameter
Address: An unknown error occurred.
CVV2: Not checked

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Live mode or sandbox?

And I did add in shipping address about a month ago... that's a valid param in the docs, though. Is that a shippable order or not?

Posts: 73
Joined: 12/10/2007

I'm don't know if my problems are related to the original post or not.
But my store doesn't ship any products. So shipping should be off.

In the new PayPal beta code, contains the following lines 359-365, a bunch of SHIPTO =

'SHIPTONAME' => substr($order->delivery_first_name .' '. $order->delivery_last_name, 0, 25),
'SHIPTOSTREET' => substr($order->delivery_street1, 0, 100),
'SHIPTOSTREET2' => substr($order->delivery_street2, 0, 100),
'SHIPTOCITY' => substr($order->delivery_city, 0, 40),
'SHIPTOSTATE' => uc_get_zone_code($order->delivery_zone),
'SHIPTOZIP' => $order->delivery_postal_code,
'SHIPTOCOUNTRYCODE' => $delivery_country[0]['country_iso_code_2'],

If I comment this out beta1 works fine.

Obviously sending the shipping info without first checking if the shipment is shippable is not correct.

In ubercart how do you check if order is shippable or not?

Posts: 73
Joined: 12/10/2007

live mode

Posts: 73
Joined: 12/10/2007

You are right they are valid parameters, but if you are passing in null or empty values in SHIPTOxxx, seems PayPal throws an error.

Posts: 49
Joined: 12/12/2007
Bug Finder

My products are also not shippable. I tried commenting out the lines but it still does not work for me in Sandbox Mode.

Posts: 49
Joined: 12/12/2007
Bug Finder

On Beta1 I am able to create an order manually in the admin system and process the credit card to the PayPal SandBox but I am still not able to go through a normal cart checkout process. Did anything major change in the checkout process that would cause a problem?

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Like I said, the sandbox has a history of crapping out on direct payment requests, particularly during checkout. That's why I had to stop using that as the default CC gateway on the Livetest.

As to the shipping option, I just assumed if it was blank it would ignore it. Silly of PayPal to say the field itself is invalid and not the contents. I'll update the code when I hit the office on Monday.

Posts: 49
Joined: 12/12/2007
Bug Finder

Thanks Ryan. I will point it to live Monday and test with that.

Posts: 49
Joined: 12/12/2007
Bug Finder

OK, i switched over to the live server and I am able to process payments only when there is a shipping address. However none of our products are shippable so I had been hiding the delivery pane. Any suggestions would be appreciated. One post mentioned commenting out the shipping fields in the Paypal module but i thought a I better check before I do that.

In addition, I got the following message when I submitted a payment through the admin system.

* warning: Invalid argument supplied for foreach() in /mnt/gs01/herd03/33619/domains/[url replaced]/html/sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.module on line 1321.

Posts: 21
Joined: 11/21/2007
Bug Finder

Credit Card Processing only works for me with shippable products (PayPal Web Payments Pro). When there is no Delivery Address, it is not processed. Using Beta 3. This is all in "live" mode, no sandbox account.

--

Changing life as we know it, through the love, loyalty, and friendship of Jesus Christ.

Posts: 73
Joined: 12/10/2007

The temporary solution I offer about 4 posts up still works if you have no shippable products in your store.

There basically just needs to be a check if the order is shippable or not, and not set those fields if it is not shippable. PayPal not happy with NULL values in those fields.

Posts: 73
Joined: 12/10/2007

I think this will work as permenant solution, though I didn't test it. Maybe someone can test for me, I kicking off for the night.

Basically replace the entire assignment of $nvp_request at about line 340 in paypal.module with the following code:

  $nvp_request = array(
    'METHOD' => 'DoDirectPayment',
    'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
    'IPADDRESS' => $_SERVER['REMOTE_ADDR'],
    'AMT' => uc_currency_format($amount, FALSE, FALSE, '.'),
    'CREDITCARDTYPE' => $cc_type,
    'ACCT'=>  $order->payment_details['cc_number'],
    'EXPDATE' => $expdate,
    'CVV2' => $order->payment_details['cc_cvv'],
    'FIRSTNAME' => substr($order->billing_first_name, 0, 25),
    'LASTNAME' => substr($order->billing_last_name, 0, 25),
    'STREET' => substr($order->billing_street1, 0, 100),
    'STREET2' => substr($order->billing_street2, 0, 100),
    'CITY' => substr($order->billing_city, 0, 40),
    'STATE' => uc_get_zone_code($order->billing_zone),
    'ZIP' => $order->billing_postal_code,
    'COUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
    'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
    'DESC' => substr($desc, 0, 127),
    'INVNUM' => $order_id .'-'. time(),
    'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
    'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, NULL, NULL, TRUE),
    'EMAIL' => substr($order->primary_email, 0, 127),
    'PHONENUM' => substr($order->billing_phone, 0, 20),
  );
  if (uc_cart_is_shippable()) {
    $nvp_request['SHIPTONAME'] = substr($order->delivery_first_name .' '. $order->delivery_last_name, 0, 25);
    $nvp_request['SHIPTOSTREET'] = substr($order->delivery_street1, 0, 100);
    $nvp_request['SHIPTOSTREET2'] = substr($order->delivery_street2, 0, 100);
    $nvp_request['SHIPTOCITY'] = substr($order->delivery_city, 0, 40);
    $nvp_request['SHIPTOSTATE'] = uc_get_zone_code($order->delivery_zone);
    $nvp_request['SHIPTOZIP'] = $order->delivery_postal_code;
    $nvp_request['SHIPTOCOUNTRYCODE'] = $delivery_country[0]['country_iso_code_2'];
  }

Posts: 13
Joined: 12/10/2007
Bug Finder

Is there going to be a committed fix to ubercart for this or are we sticking with commenting out the shipto= lines?

Posts: 13
Joined: 12/10/2007
Bug Finder

I just tried your code and it did not work for me. I appreciate the work and will continue testing any ideas. I am using the paypal website payments pro gateway.

Posts: 49
Joined: 12/12/2007
Bug Finder

I tried commenting out the shipto lines in the paypal.module but I am still unable to put an order through with out shipping info. Any additional thoughts or tips would be appreciated.

Posts: 73
Joined: 12/10/2007

What is the error message you get?

Posts: 9
Joined: 01/27/2008

Payment failed.
Error: Security header is not valid
Address: An unknown error occurred.
CVV2: Not checked

Posts: 49
Joined: 12/12/2007
Bug Finder

Payment failed.
Error: ShipToStreet : Invalid Parameter
Address: An unknown error occurred.
CVV2: Not checked

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Should be fixed in Bazaar, would love some confirmation.

Posts: 21
Joined: 11/21/2007
Bug Finder

Ryan,

After updating from Bazaar, the payment now goes through on non-shipping items. Everything seems like its working properly. Thanks for the quick fix.

--

Changing life as we know it, through the love, loyalty, and friendship of Jesus Christ.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Rock on. Thanks for letting me know. Cool

Posts: 9
Joined: 01/27/2008

I just gave it a try and with the new update and still get the following error:

Payment failed.
Error: ShipToStreet : Invalid Parameter
Address: An unknown error occurred.
CVV2: Not checked

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Check your products... if there are shippable products on the order and you don't supply a shipping address, you're going to have that problem. I suppose the code may be modifiable to check the actual shipping address values, too, if the problem is that you're creating these orders manually and your payments are failing.

Posts: 73
Joined: 12/10/2007

Maybe check to see if shipping address is null, then set shipping address = billing address.

Since it is "illegal" to send null value to PayPal it makes sense to check if not null.

Posts: 9
Joined: 01/27/2008

I am not a very good programmer but I would like to tweak the code so that it will permanently make the ship address the billing address. As far as I can see this is all that I need to change but it still didnt work for me. If this is not what I should change or if I should do it a different way I would appreciate some pointers.

$nvp_request = array(
'METHOD' => 'SetExpressCheckout',
'RETURNURL' => url('cart/echeckout/selected', NULL, NULL, TRUE),
'CANCELURL' => url('uc_paypal/wps/cancel', NULL, NULL, TRUE),
'AMT' => uc_currency_format($order->order_total, FALSE, FALSE, '.'),
'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
'DESC' => substr($desc, 0, 127),
'INVNUM' => $order->order_id .'-'. time(),
'REQCONFIRMSHIPPING' => variable_get('uc_paypal_ec_rqconfirmed_addr', 0),
'ADDROVERRIDE' => 1,
'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, NULL, NULL, TRUE),
'SHIPTONAME' => substr($order->billing_first_name, 0, 25) .' '. substr($order->billing_last_name, 0, 25),
'SHIPTOSTREET' => substr($order->billing_street1, 0, 100),
'SHIPTOSTREET2' => substr($order->billing_street2, 0, 100),
'SHIPTOCITY' => substr($order->billing_city, 0, 40),
'SHIPTOSTATE' => uc_get_zone_code($order->billing_zone),
'SHIPTOCOUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
'SHIPTOZIP' => $order->billing_postal_code,
'PHONENUM' => substr($order->delivery_phone, 0, 20),
);

Posts: 73
Joined: 12/10/2007

If you are using paypal, and the payment goes through paypal express or std then the billing address comes from paypal. Along with an optional shipping address.

In other words, PayPal asks the customer what the billing address is, and then sends it to your store. You can't just delete it or overwrite it.

Posts: 9
Joined: 01/27/2008

I am using credit cards with the paypal website payment pro gateway. I tried enabling all the shipping information and still got the following error:

Payment failed.
Error: Security header is not valid
Address: An unknown error occurred.
CVV2: Not checked

Posts: 73
Joined: 12/10/2007

I think that means your api username, password, or certifcate are not entered correctly.
Did you confirm that you set the option for live/sandbox to the relevant setting?

Posts: 85
Joined: 08/08/2007
Uber DonorEarly adopter... addicted to alphas.Not Kulvik

agilpwc wrote:
I think that means your api username, password, or certifcate are not entered correctly.
Did you confirm that you set the option for live/sandbox to the relevant setting?

Just out of curiosity do you need to have the API Username, Password, and Signature in the paypal setup if you are running Live or just for Sandbox?

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

These are required for either live or sandbox... it's a feature of accounts w/ API access required for WPP.

Posts: 85
Joined: 08/08/2007
Uber DonorEarly adopter... addicted to alphas.Not Kulvik

Thanks for explaining it out for me Ryan I appreciate it! =)

Posts: 2
Joined: 02/29/2008

Hi,
I have the exact problem in that I have the proper Paypal info specified and downloadable products only. (I am currently successfully using the paypal setup for another site using Zen-cart - so I know that is working).

I get an "Internet Explorer cannot display the webpage" error when I press the submit payment button. (I don't know how to tell what the error is in more detail (I have Show Friendly error messages turned off.)

I can't seem to get to Bazaar - also get the "Can't find page error". Can you please post the fix here or email it to me? I'd like to give it a whirl. Otherwise, I am at my wit's end.

Drupal 5.2
Ubercart Beta6
PHP 5.1.4

Thanks
Julie