Forum Replies Created

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

    (@caracolcolcol)

    Yes, finally I solved it, but I had to add a filter. In Spain, PayPal needs the “State Name” in uppercase, but woocommerce sends the “State Code”. This is the code of my filter, maybe you can put in your future releases:

    add_filter( ‘woocommerce_paypal_args’, ‘caracol_customize_paypal_arguments’, 10, 1);
    function caracol_customize_paypal_arguments($args) {
    if ( isset( $args[ “state” ] ) ) {
    $args[ “state” ] = mb_strtoupper($args[ “state” ], “UTF-8”);
    }
    return $args;
    }

    You can check this behaviour in this web: https://caracolhogar.es/categorias/decoracion/ that it’s working in Spain. If you try to buy something via PayPal and select to pay with Credit Card, you will see the web form of PayPal Credit Card (you don’t have to finalize the purchase, only select this payment mode in order to see the form). You can debug this web form with an angular plugin fo your browser and you will see that the selected state of the list of states has to be the State Name and has to be in upperscase.

    Thread Starter caracolcolcol

    (@caracolcolcol)

    I have disabled (and removed from plugins folder) all plugins. I have installed twenty theme, but the problem reminds…

    Also, I have been browsing your code, and I found an strange behaviour, into your class WC_Gateway_PayPal_Express_Request_AngellEYE, file class-wc-gateway-paypal-express-request-angelleye.php, line 730 (also 706 but with ship_to_different_address):
    if (!empty($post_data[‘billing_company’])) {
    $billing_company = $post_data[‘billing_company’];
    $Payment[‘shiptoname’] = wc_clean(stripslashes($billing_company . ‘ – ‘ . $shiptoname));
    } else {
    $Payment[‘shiptoname’] = wc_clean(stripslashes($shiptoname));
    }

    It is clear that the field “shiptoname” is a composition of “billing_company + slash + first name + first surname”.
    This composite field is what PayPal receives, this is the reason why the plugin is sending, in the request, the field:

    [PAYMENTREQUEST_0_SHIPTONAME] => 20761866B – JUAN ANTONIO LOPEZ ROJO

    20761866B: is the billing_company
    -: is the slash
    JUAN ANTONIO: is the billing first name
    LOPEZ ROJO: is th billing second name

    Regarding the email, I see that it is configured empty, line 650, but it is not filled with the value of the client’s email.

    Please, could you review the code?

    Regards

    (sorry for my bad english writing)

    Thread Starter caracolcolcol

    (@caracolcolcol)

    More information I have collected about this question, from my logs:

    [descriptor] => Braintree\Descriptor Object
    (
    [_attributes:protected] => Array
    (
    [name] =>
    [phone] =>
    [url] =>
    )

    )

    Thread Starter caracolcolcol

    (@caracolcolcol)

    Hello.

    This is the requested info:

    Version Plugin: 1.5.7
    Version Woocommerce: 3.5.4
    Payment method: PayPal Express Checkout
    Screenshot of my shop: https://caracolhogar.es/img/billing.png
    Screenshot of PayPal: https://caracolhogar.es/img/paypal.png

    Thanks!

    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;
    }

Viewing 5 replies - 1 through 5 (of 5 total)