- osCommerce Support Forum
- → Viewing Profile: Escaping
Community Stats
- Group Community Member
- Active Posts 15 (0.01 per day)
- Most Active In Other (8 posts)
- Profile Views 2,017
- Age Age Unknown
- Birthday Birthday Unknown
-
Real Name
Art
-
Gender
Not Telling
Posts I've Made
In Topic: [Contribution] - USPS Methods
12 November 2011, 19:48
For anyone else experiencing a similar issue, the problem turned out to be the '<' and '>' characters in the USPS return and the formatted display name. (Basically the <sup>, </sup> and <br>). It may be that it was running afoul of one of our security scrubbers. Not sure there.
As a solution, any place I found:
'title' => $title, (there are 4 in all)
I switched it to:
'title' => str_replace(array('<sup>', '</sup>', '®', '™', '<br>'), '', htmlspecialchars_decode($title)),
That solution actually removes the reg mark which some may object to. To leave it, I suspect you'd use:
'title' => str_replace(array('<sup>', '</sup>', '<br>'), '', htmlspecialchars_decode($title)),
I haven't actually tried that.
Removing the <br>, when you're using some of the optional displays such as signature conf or insurance, could prove to be very odd looking when displayed. Again, I din't want all that so it wasn't an issue. Hope that helps someone else out.
Art
In Topic: [Contribution] - USPS Methods
10 November 2011, 16:55
Without any version info, not sure. I do recall seeing another poster describing the strange characters in their responses. I don't recall who the poster was, but if you search the forum for just USPS Methods, you'll find him among the first 2 pages.
As a side note, if you're using an older API, USPS is about to stop supporting you in the first quarter of next year anyway. Might be an opportune moment to go ahead and upgrade. USPS has announced they will end support for RATE and RATEV2 APIs March 31st.
In Topic: PayPal WPP Direct Payments & Express Checkout Support
25 September 2011, 00:28
Hi All,
My installation of this contrib that had been working for over a year suddenly stopped working 2 days ago. Symptoms of this issue might vary between web hosts, but in my case, when pressing the button for Express Checkout the customer is directed to an error on PayPal (no code) that basically just states the operation failed. This is previous to any login attempt. PayPal techs informed me that variable names were being passed to PayPal rather than the data that was supposed to be contained. For example, the customer name would be something along the line of PAYPAL_NAME. Naturally, if the customer hasn't logged in yet, there is no data for these fields so the variable passed to PayPal should simply be null.
The contrib has worked despite this issue for quite a while. I assume a recent change at PayPal might be the problem, but it may have been an update at my web host. I found a little omission in the logic in includes/modules/payment//paypal_wpp.php. Search for line if (MODULE_PAYMENT_PAYPAL_EC_ADDRESS_OVERRIDE == 'Store' && . Subsequent codes check for the data we're talking about, and if it is missing, sets the address override to "0". The omission was that variables are only set if override is "1", if override is "0", variables aren't set at all. I've just added a small bit to set the vars to null in that instance. For my install, that took care of the issue and actually fixed another problem I had just lived with for the last year or so.
The address override in admin should be set to PayPal, not store. If you like store, well you're on your own. Otherwise, usual disclaimers apply as I'm not a programmer.
Find:
/* Don't override if the state is missing (Avoid 10729 errors) */if ($order_info['PAYPAL_ADDRESS_OVERRIDE'] == '1' && $order_info['PAYPAL_STATE'] == '') {
$order_info['PAYPAL_ADDRESS_OVERRIDE'] = '0';
$order_info['PAYPAL_NAME'] = '';
$order_info['PAYPAL_ADDRESS1'] = '';
$order_info['PAYPAL_ADDRESS2'] = '';
$order_info['PAYPAL_CITY'] = '';
$order_info['PAYPAL_STATE'] = '';
$order_info['PAYPAL_ZIP'] = '';
$order_info['PAYPAL_COUNTRY'] = '';
}
Insert immediately after:
/* If Address Override == "0", send null vars to Paypal (was sending Var Names instead) */
if ($order_info['PAYPAL_ADDRESS_OVERRIDE'] == '0') {
$order_info['PAYPAL_NAME'] = '';
$order_info['PAYPAL_ADDRESS1'] = '';
$order_info['PAYPAL_ADDRESS2'] = '';
$order_info['PAYPAL_CITY'] = '';
$order_info['PAYPAL_STATE'] = '';
$order_info['PAYPAL_ZIP'] = '';
$order_info['PAYPAL_COUNTRY'] = '';
}
That's it. Hope it saves someone some time.
- osCommerce Support Forum
- → Viewing Profile: Escaping
- Forum Rules






Find content