• Resolved caracolcolcol

    (@caracolcolcol)


    Hello.

    I have a problem with the address sent, by your Express Checkout plugin, to PayPal in Spain.
    In order to show the correct state in PayPal Credit Card Page (in the dropdown list of states), PayPal needs receive the name of the state in uppercase, your plugin only sent the ISO code.
    For example, if a customer buy something to deliver to Madrid, your plugin send only the ‘M ‘letter in the field [PAYMENTREQUEST_0_SHIPTOSTATE], but PayPal in Spain needs that your plugin send ‘MADRID’ ?Can I filter the request performed by your plugin in order to modify the field [PAYMENTREQUEST_0_SHIPTOSTATE] before sent to PayPal?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter caracolcolcol

    (@caracolcolcol)

    Browsing yor code I have developed a solution for Spanish shops:

    add_filter( ‘angelleye_woocommerce_express_checkout_set_express_checkout_request_args’, ‘caracol_angelleye_woocommerce_express_checkout_set_express_checkout_request_args’, 999, 1);
    function caracol_angelleye_woocommerce_express_checkout_set_express_checkout_request_args($paypal_request) {
    foreach ($paypal_request[‘Payments’] as $key => $value) {
    if ($paypal_request[‘Payments’][$key][‘shiptocountrycode’] == ‘ES’) {
    $state = WC()->countries->get_states(‘ES’)[$paypal_request[‘Payments’][$key][‘shiptostate’]];
    if (isset($state)) {
    $paypal_request[‘Payments’][$key][‘shiptostate’] = mb_strtoupper($state, “UTF-8”);
    }
    }
    }
    return $paypal_request;
    }

    Plugin Contributor angelleyesupport

    (@angelleyesupport)

    @caracolcolcol Thanks for your feedback, I have added this to our backlog and we will look into this one and will make adjustments soon.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘State address now working in Spain’ is closed to new replies.