PAYPAL NOT RECOGNISING ADDRESS PASSED TO IT

WPPizza – A Restaurant Plugin for WordPress Support Add-Ons Gateways Paypal Standard PAYPAL NOT RECOGNISING ADDRESS PASSED TO IT

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44577
    seagrass
    Participant

      Hi Olly,

      Not sure if you can help with this?

      I have a live site running WordPress 4.2.3, WPPizza 2.11.10 & WPPizza Paypal gateway 2.1.7.8 where everything works fine.

      I have locally upgraded everything to latest, i.e. WordPress 5.2.2, WPPizza 3.10.1 & WPPizza Paypal gateway 4.1.

      However with the latest version I’m back to the problem I had a few years ago where the PayPal payment screen doesn’t show the customers delivery address (from the order form) so it has to be re-entered for Paypal.

      Back in 2015, I got ver 2 of the gateway to work by editing the code (https://www.wp-pizza.com/topic/paypal-not-recognising-address-passed-it) but I’d hoped to get it working without touching the code this time.

      Is this likely to be a configuration issue at my end, i.e. does it usually pass the address through fine? Any ideas what I might be doing wrong?

      Cheers
      Simon

      #44586
      Olly
      Admin & Mod

        >Is this likely to be a configuration issue at my end
        No.

        In fact it was quite a deliberate decision to completely disable the whole shipping address input when being redirected to paypal as – in my opinion – it only confuses the issue of paying for an order.

        That being said, there is also a filter available in the plugin/gateway that allows to to override this behaviour as it suits your needs (i assume here you know what wordpress actions/filter are and how they work).

        As a starting point you could do this sort of thing
        you should be able to adjust things from here as you need them to be in your particular circumstances
        see
        https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#paypal-checkout-page-variables
        for parameters paypal accepts

        
        add_filter('wppizza_filter_paypal_parameters', 'myprefix_paypalfilter', 10, 2);
        function myprefix_paypalfilter($parameters, $order_formatted){
        /* will revert the value to the default of 0 */
        unset($parameters['no_shipping']);
        /* alternatively override to the value you want there like so  */
        $parameters['no_shipping'] = 0 ; /* 0. Prompt for an address, but do not require one */
        /*
        setting some default values according to your settings, using the values returned in $order_formatted.
        do a print_r/vardump $order_formatted to see all order parameters . It should be obvious what is what
        */
        $parameters['last_name'] = $order_formatted['customer']['cname']['value'];
        $parameters['address1'] = $order_formatted['customer']['caddress']['value'];
        $parameters['email'] = $order_formatted['customer']['cemail']['value'];
        /* and so on */
        return 	$parameters;
        }
        

        Hope that helps

        #44587
        seagrass
        Participant

          it did indeed, that worked perfectly, thank you

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘PAYPAL NOT RECOGNISING ADDRESS PASSED TO IT’ is closed to new replies.