Skip Menu |

This queue is for tickets about the Business-PayPal-EWP CPAN distribution.

Report information
The Basics
Id: 32299
Status: open
Priority: 0/
Queue: Business-PayPal-EWP

People
Owner: Nobody in particular
Requestors: fr [...] fredandfaye.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: regarding listed bug "/,/\n/g not flexible enough"
Date: Mon, 14 Jan 2008 09:14:03 -0800
To: <bug-Business-PayPal-EWP [...] rt.cpan.org>
From: "Fred McIntyre" <fr [...] fredandfaye.com>
Hi, I have a couple comments about the listed bug /,/\n/g not flexible enough I also have run into a problem when having commas in the item_name. When I get to PayPal everything from the first comma is just dropped, and even worse, the next value in the form is dropped. That is, if my form includes: item_name=ENROLLMENT - Seminar Miami, FL January 18-19, 2008 item_number=123 when I get to PayPal, the item is listed as ENROLLMENT - Seminar Miami and item_number is just plain gone. Looking at the above item name, you can see that commas are pretty essential. In the bug listing Isaac said: "I'd actually be curious to know if wrapping the problematic name with uri_escape() [use URI::Escape] doesn't make things better for you?" I tried uri_escape on the item_name. Problem is, when I get to PayPal it is not unescaped, and it looks like: ENROLLMENT%20-%20Seminar%20Miami%2C%20FL%20January%2018-19%2C%202008 Isaac also said: '... "," characters can't be part of an application/x-www-form-urlencoded payload...' For what it's worth, I commented out the line $formdata=~s/,/\n/g; in EWP.pm and have not experienced any problems with submitting my form to PayPal. My form is opened simply with <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name=ppform> It is my understanding that only the urls sent to PayPal need to be urlencoded - such as return cancel_return notify_url I think it should be left up to the form preparer (me) to urlencode those values before calling Business::PayPal::EWP::SignAndEncrypt to encrypt the form. Also, if I'm not mistaken, commas aren't the only reserved character, so I'm wondering why that is the only character you chose to remove from $formdata. I may be displaying total ignorance here, but I mainly wanted to let you know that 1) uri_escape on the item_name isn't an option, and 2) not removing commas from the form data does not seem to present a problem. Thanks, Fred McIntyre
I should have more explicitly stated that my form is already \n delimited. It appears the purpose for s/,/\n/g is to change this: cert_id=12345,name=fred,etc. to cert_id=12345 name=fred etc. I create my form with my $form = <<EOS; cert_id=12345 name=fred etc. EOS and commented out the line in EWP.pm On Mon Jan 14 12:14:51 2008, fr@fredandfaye.com wrote: Show quoted text
> Hi, > I have a couple comments about the listed bug > /,/\n/g not flexible enough > > I also have run into a problem when having commas in the item_name. > When I get > to PayPal everything from the first comma is just dropped, and even > worse, the > next value in the form is dropped. That is, if my form includes: > > item_name=ENROLLMENT - Seminar Miami, FL January 18-19, 2008 > item_number=123 > > when I get to PayPal, the item is listed as > ENROLLMENT - Seminar Miami > > and item_number is just plain gone. > > Looking at the above item name, you can see that commas are pretty > essential. > > In the bug listing Isaac said: > "I'd actually be curious to know if wrapping the problematic name with > uri_escape() [use URI::Escape] doesn't make things better for you?" > > I tried uri_escape on the item_name. Problem is, when I get to PayPal > it is not > unescaped, and it looks like: > ENROLLMENT%20-%20Seminar%20Miami%2C%20FL%20January%2018-19%2C%202008 > > > Isaac also said: > '... "," characters can't be part of an application/x-www-form- > urlencoded > payload...' > > For what it's worth, I commented out the line > $formdata=~s/,/\n/g; > in EWP.pm and have not experienced any problems with submitting my > form to > PayPal. > > My form is opened simply with > <form action="https://www.paypal.com/cgi-bin/webscr" method="post" > name=ppform> > > It is my understanding that only the urls sent to PayPal need to be > urlencoded - > such as > return > cancel_return > notify_url > > I think it should be left up to the form preparer (me) to urlencode > those values > before calling Business::PayPal::EWP::SignAndEncrypt to encrypt the > form. > > Also, if I'm not mistaken, commas aren't the only reserved character, > so I'm > wondering why that is the only character you chose to remove from > $formdata. > > > I may be displaying total ignorance here, but I mainly wanted to let > you know > that 1) uri_escape on the item_name isn't an option, and 2) not > removing commas > from the form data does not seem to present a problem. > > Thanks, > Fred McIntyre >