close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PayPal Advanced passing item Name and/or Description

Thread began 6/05/2017 7:57 pm by TroyD | Last modified 6/22/2017 12:43 pm by Ray Borduin | 152 views | 18 replies |

TroyD

PayPal Advanced passing item Name and/or Description

I have tried to find a solution to this in the past but ended up just using an email confirmation with all the details. I now have another cart setup where the client wants the details for the transaction to appear (as they should) in their PayPal account. This is an Advanced checkout using PayFlow. Everything is setup in PayPal Manager as I have always been instructed to do. The checkout process is done on the website using an iframe. All works just fine but the Description is blank in the confirmation sent by PayPal. And when you view the details of the transaction from within PayPal, the "Detail" is blank. Name, Address, Subtotal, Tax, Shipping, etc. all get passed correctly.

It appears as though the WA page responsible for this information is the PP_PayAdv_PHP.php file in the webassist/ecart/ directory. There is a while loop that even has all the details I am looking to pass.

$vars[] = 'L_NAME' . $item_count . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Name")), 0, 127));
$vars[] = 'L_NUMBER' . $item_count . '=' . urlencode(substr($cart->DisplayInfo("ID"), 0, 127));
$vars[] = 'L_DESC' . $item_count . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Description")), 0, 127));
$vars[] = 'L_AMT' . $item_count . '=' . urlencode(number_format($cart->DisplayInfo("Price"), 2, '.', ''));
$vars[] = 'L_QTY' . $item_count . '=' . urlencode($cart->DisplayInfo("Quantity"));



Normally when I had an issue like this with PayPal standard, I simply looked at the source on the confirm page and made sure the correct hidden form element had all the details bound to it. I'm not finding this now. What should I be looking for to make sure the Description is being passed to PayPal?

Oh, I should maybe mention the order things are included on the confirm.php page.

gateways.php
persist.php
PP_PayAdv_PHP.php
eCart1_PHP.php
and then the PayPal Advanced Authorize section.

Should the PP_PayAdv_PHP.php maybe come after the eCart1_PHP.php include?

Thanks,
TroyD

Sign in to reply to this post

Ray BorduinWebAssist

The order shouldn't matter. The best thing to do would be to dump the session on the success page and look at the data being passed to paypal. There must be something wrong with the syntax. If you post it here I might be able to spot the problem. Just add this to the success page:

<?php
var_dump($_SESSION);
?>

That will include the full request sent to paypal and the response. Analyzing those could lead us to the correct solution.

Sign in to reply to this post

TroyD

Thanks Ray. (See PM)

I provided the ["PP_PayAdv_postedValues"] but if you needed all if it, I can include that too. There was a lot of sessions that I set myself and I knew you didn't need those.

I noticed that L_NAME and L_DESC are in there but with a "0" appended to them like L_DESC0 . Is that correct?

Thanks
TroyD

Sign in to reply to this post

TroyD

I realize now that the "0" appended to the L_DESC is most likely just indexing. I only had one item in the cart or I would have realized that earlier. Anyway, let me know if you see anything wrong with the syntax or if you need more details.

Thanks,
TroyD

Sign in to reply to this post

Ray BorduinWebAssist

Looking at their API it seems that the number should start with 1 and not 0 when indexing the items. Actually that is a bit vague. I also see they have changed the name of L_AMT to L_COST it appears, and L_NUMBER to L_SKU. Although lower on the page it says to use L_AMT for amex transactions and says it only allows up to 6 items. The doc is a bit confusing:

https://developer.paypal.com/docs/classic/payflow/integration-guide/#payflow-connection-parameters

I think we should try changing the variable names and the indexing:

php:
$vars[] = 'L_NAME' . ($item_count+1) . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Name")), 0, 127));

      $vars[] = 'L_SKU' . ($item_count+1) . '=' . urlencode(substr($cart->DisplayInfo("ID"), 0, 127));
      $vars[] = 'L_DESC' . ($item_count+1) . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Description")), 0, 127));
      $vars[] = 'L_COST' . ($item_count+1) . '=' . urlencode(number_format($cart->DisplayInfo("Price"), 2, '.', ''));
      $vars[] = 'L_QTY' . ($item_count+1) . '=' . urlencode($cart->DisplayInfo("Quantity"));



If that doesn't work, maybe leave the indexing and change just the variable names:

php:
$vars[] = 'L_NAME' . ($item_count) . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Name")), 0, 127));

      $vars[] = 'L_SKU' . ($item_count) . '=' . urlencode(substr($cart->DisplayInfo("ID"), 0, 127));
      $vars[] = 'L_DESC' . ($item_count) . '=' . urlencode(substr(strip_tags($cart->DisplayInfo("Description")), 0, 127));
      $vars[] = 'L_COST' . ($item_count) . '=' . urlencode(number_format($cart->DisplayInfo("Price"), 2, '.', ''));
      $vars[] = 'L_QTY' . ($item_count) . '=' . urlencode($cart->DisplayInfo("Quantity"));



If that still doesn't work we will want to send that request to paypal support and see if they can shed some light on why it doesn't work at that point since their documentation is a bit confusing on the subject.

Sign in to reply to this post

TroyD

Thanks Ray. I have tried the first suggestion and am waiting to hear back from my client to see if anything appears in the Description.

Yes, the docs are confusing. If they are confusing for you, I can't imagine how they expect someone like me to understand.
One thing I notice is that they give different instructions for each payment type. Am Ex, MC, etc. As you pointed out, Am Ex is different. And in some cases they want you to use L_UPC instead of L_SKU. Honestly, this cart doesn't provide a SKU so it might not matter. But...
I know that the PP Pro allows us to use whatever payment gateway or merchant account we want. Since this is not the case in the Advanced setup (PayPal is used), I wonder if maybe this document is to providing us with what PayPal wants the L_x variables to be. I'm looking around now. In the meantime, I will test your second suggestion of changing just the name and not the indexing once I get feedback on the first test.

Thanks so much for your help!

TroyD

Sign in to reply to this post

TroyD

Ray

I just watched a video they have on this API linked at the bottom of this page https://developer.paypal.com/docs/classic/products/paypal-payments-advanced/
It says that the "Enable Secure Token" should be set to Yes. I don't know if this has anything to do with the information we are trying to pass to PayPal but I have this set to No in Manager.

I believe that I read somewhere here in the forums just to leave it set to No and that's how I have others setup. As a matter of fact, I have most of the settings in Manager set to their defaults. I'm using template C but other than that, I change very little.

What should the AVS, CSC and Enable Secure Token be set to?

Thanks,
TroyD

Sign in to reply to this post

Ray BorduinWebAssist

Those settings shouldn't matter for what you are doing. What you had is probably correct. Messing with those is more likely to cause other problems than fix anything.

Sign in to reply to this post

TroyD

Ok, good news. We now have information showing up in the Description part of the PayPal confirmation. Your first suggestion of starting the indexing at 1 and changing the names has us going in the right direction.

There is however some formatting issues and it appears as though the Description is showing the L_NAME and not the L_DESC.

The output for those looks like this;
L_NAME1=%28Test+Product%29+Profleece+Ultimate+1600gm+Green+Back&L_SKU1=5&L_DESC1=Profleece+Ultimate+1600gm+Green+Back

This is how the information appears in the confirmation sent to me by PayPal.

%28Test+Product%29+Profleece+Ultimat
Item# 5


Addressing these issues one at a time, I figure that the additional characters of %28, %29 and + are character set issues. I don't see anything for charset in the output provided to PayPal. Maybe I need to include one as I normally would for PayPal Standard using a hidden form field. How would I do that here?

The second issue is that the L_DESC wasn't included, just the L_NAME. I realize in my example that it repeats the same information but my plans are to replace that with size and color information.

Thank again Ray.

TroyD

Sign in to reply to this post

Ray BorduinWebAssist

The strange characters and plus symbol are URL encoding. It may not need that, so try removing it from the code:

php:
$vars[] = 'L_NAME' . ($item_count+1) . '=' . (substr(strip_tags($cart->DisplayInfo("Name")), 0, 127));

      $vars[] = 'L_SKU' . ($item_count+1) . '=' . (substr($cart->DisplayInfo("ID"), 0, 127));
      $vars[] = 'L_DESC' . ($item_count+1) . '=' . (substr(strip_tags($cart->DisplayInfo("Description")), 0, 127));
      $vars[] = 'L_COST' . ($item_count+1) . '=' . (number_format($cart->DisplayInfo("Price"), 2, '.', ''));
      $vars[] = 'L_QTY' . ($item_count+1) . '=' . ($cart->DisplayInfo("Quantity"));



In terms of why it doesn't show the description or where it might, you would have to ask paypal. A possible solution would be to concatenate both into the name field and don't use the description.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...