Announcement

Collapse
No announcement yet.

Customers unable to pay with PayPal Account or PayPal Cards

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Customers unable to pay with PayPal Account or PayPal Cards

    Starting last week, PayPal rolled out changes to their servers. The changes included a change to a HTTP request response header which broke the Sellerdeck PayPal Commerce integration.

    Symptoms

    Symptoms
    of the problem include PayPal card fields not being presented when PayPal selected or a pop up error when the PayPal button is clicked.

    Solution

    The solution is to make 2 changes to one of the Perl scripts. If you are not comfortable with making these changes then we shall be adding patched scripts for some of the recent Sellerdeck versions which can be used if the file Actinic.pm has not been customised. Alternatively you can request assistance from support but naturally this will take longer to resolve the problem.

    Open the site folder in Windows Explorer of the site that you need to fix.

    Make a backup copy of ACTINIC.pm in your site folder. If there is a problem with the site after making the changes then restore this backed up file and publish to web to fix the site.

    Edit ACTINIC.pm in the site folder using a text editor such as Notepad.

    If you can use Notepad++ then you will have line numbers as a guide. The line numbers mentioned below are approximate as they will vary between Sellerdeck versions.

    There are 2 edits to be performed, the first may not be required in your version of Sellerdeck Desktop. When editing, take special care with placement of the new code. It doesn't matter if it isn't indented properly.

    Edit 1

    Search for the following text (around line 940)
    Code:
    flatten($response)
    If not found, skip to Edit 2.

    You should see code like (comments removed):
    Code:
    if ($response->can('flatten'))
       {
       %reply_headers = $response->flatten();
       }
    else
       {
       %reply_headers = flatten($response);
       }
    return ($nResult, $sMessage, $sHTTPResponse, undef, \%reply_headers, $sHTTPContent);
    Change the code by adding the lines indicated in red.

    Code:
    if ($response->can('flatten'))
     {
       %reply_headers = $response->flatten();
       }
    else
       {
       %reply_headers = flatten($response);
       }
    if (exists $reply_headers{'content-type'})
       {
       $reply_headers{'Content-Type'} = delete $reply_headers{'content-type'};
       }
    return ($nResult, $sMessage, $sHTTPResponse, undef, \%reply_headers, $sHTTPContent);
    Edit 2

    Search for the text (around line 1110)

    Code:
    foreach $sHeaderLine(@arrHeader)
    You should see code like (comments removed):
    Code:
    foreach $sHeaderLine(@arrHeader)
       {
       if($sHeaderLine ne '')
          {
          ($sHeaderType, $sHeaderValue) = split(/: */, $sHeaderLine);
          if($sHeaderValue)
             {
             $hashHeader{$sHeaderType} =
                $sHeaderValue;
             }
          }
       }
    Change the code by adding the lines indicated in red

    Code:
    foreach $sHeaderLine(@arrHeader)
     {
       if($sHeaderLine ne '')
          {
          ($sHeaderType, $sHeaderValue) = split(/: */, $sHeaderLine);
          if($sHeaderValue)
             {
             if ($sHeaderType =~ /^content\-type/i)
                {
                $sHeaderType = "Content-Type";
                }
             $hashHeader{$sHeaderType} =
                $sHeaderValue;
             }
          }
       }
    Save the file and publish to web.

    Check that PayPal payments are working. You only need to check that card fields are displayed and that the PayPal dialog opens without error when the PayPal button is clicked.
    Last edited by Hugh Gibson; 25-Jul-2024, 08:00 AM.

    Gordon Camley

    3rd Line Support
    SellerDeck.

Working...
X