• Hello elfin.

    I asked you this question once before about why customers information do not pass correctly in paypal, when the customer choose to pay by credit card.

    The field under <- Pay with Credit Card ->
    the <- Billing address1 ->, <- Billing address2 ->, <- City ->, <- State ->, <-Zip code -> and <- Telephone -> are blank cells.

    So far I found the virables in paypal for the telephone number changed. instead for virable <-phone-> now is <- night_phone_a, night_phone_b, night_phone_c ->

    Example in html:

    <input type=”hidden” name=”night_phone_a” value=”444″>
    <input type=”hidden” name=”night_phone_b” value=”555″>
    <input type=”hidden” name=”night_phone_c” value=”1234″>

    In paypal shows directly 444-555-1234

    This means the phone number in eshop should be also in seperate cells one next-to-the-other, night_phone_a=444 , night_phone_b=555, night_phone_c=1234.

    Or the number could split in pieces with a script in 3 cells.

    Any other virables like <- H_PhoneNumber > will not show the phone number in paypal cells directly.

    I am working on it.

    Thank you.

    https://www.ads-software.com/extend/plugins/eshop/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Anonymous User

    (@anonymized-3085)

    this won’t be changed – not all phone numbers around the world will fit into that format.

    Thread Starter vasilissk

    (@vasilissk)

    Hello again.

    I read the code in html and the fields are not in the right order. The submition is in random order and at least 38 lines mixed up. Paypal excludes many entries because of incorect order.
    Some of whom are not even approved commands form paypal.

    Paypal.php and in paypal.class.php are packing the scrip but there are many errors about paypal’s virables.

    For example: <- state” value=”11″ ->. The new paypal code does not allow number for the states. It needs to be abreviate.

    Another: <- phone” value=”444-123-1234″ > it is today <- night_phone_a ->.

    The correct order to submit to paypal in html for example is:

    <input type=”hidden” name=”cmd” value=”_xclick”>
    <input type=”hidden” name=”business” value=”[email protected]”>
    <input type=”hidden” name=”item_name” value=”hat”>
    <input type=”hidden” name=”item_number” value=”123″>
    <input type=”hidden” name=”amount” value=”15.00″>
    <input type=”hidden” name=”first_name” value=”John”>
    <input type=”hidden” name=”last_name” value=”Do*”>
    <input type=”hidden” name=”email” value=”[email protected]”>
    <input type=”hidden” name=”address1″ value=”9 Street”>
    <input type=”hidden” name=”address2″ value=”5″>
    <input type=”hidden” name=”city” value=”Berwyn”>
    <input type=”hidden” name=”state” value=”PA”>
    <input type=”hidden” name=”zip” value=”19312″>
    <input type=”hidden” name=”night_phone_a” value=”44444444444″>
    <input type=”hidden” name=”night_phone_b” value=”555″>
    <input type=”hidden” name=”night_phone_c” value=”1234″>

    In case one of the lines change order the code will not pass to paypal correctly.

    I need some help to find out how remove some unneseseraly enties.

    Thank you.

    Thread Starter vasilissk

    (@vasilissk)

    Thread Starter vasilissk

    (@vasilissk)

    Helo Elfin.

    Until this point I did numerus tests in paypal plugin and my results upon this point are:

    If you change the <- $state-> variable to take the abbreviations instead of numbers, half of the problem will be solved.

    The other half is to replace the <- $phone -> variable with the <- $night_phone_a -> variable and the other half problem will also be solved.

    There are many parameters in paypal plugin and in yours too.

    Just for you to know what I did, I wrote a small script and I inserted in paypal.php:

    line <- 320 ->

    $p->add_field(‘night_phone_a’, $_POST[‘phone’]);
    function add_field($name, $value) {
    $_POST[‘$name’] = $value;
    }
    This script allowed me to create a new copy from variable <- phone -> to <- night_phone_a ->, to convert the phone number.

    I tried to do the same with the variable <- state -> but it didn’t work because the variable is the same and I couldn’t create a new $value over the same variable.
    As a result the page was in loop because the state was missing.

    So far so good.

    Anonymous User

    (@anonymized-3085)

    I’ll look at the state as that is an issue.

    I’ll consider changing the phone – but only if it will fit into one of the values, as your tests seem to suggest it might.

    Thread Starter vasilissk

    (@vasilissk)

    Hello again.

    Here is the script that I wrote in PHP for paypal.php file.

    It fixes both phone and state issue with the new code.

    The state script converts the state number to abbreviation.

    This is my script:
    ADD a new line after line <300> in paypal.php

    $table=$wpdb->prefix.’eshop_states’;

    $li=$_POST[‘state’];
    $stateList = $wpdb->get_var(“SELECT code FROM $table WHERE id=’$li’ limit 1”);
    $p->add_field(‘state’,$stateList);

    $li=$_POST[‘ship_state’];
    $stateList = $wpdb->get_var(“SELECT code FROM $table WHERE id=’$li’ limit 1”);
    $p->add_field(‘ship_state’,$stateList);

    $p->add_field(‘night_phone_a’, $_POST[‘phone’]);
    function add_field($name, $value) {
    $_POST[‘$name’] = $value;
    }

    also it works with paypal command:
    $p->add_field(‘address_override’,’1′) for extra protection.

    So far so good.

    Thread Starter vasilissk

    (@vasilissk)

    Hello again.

    I have a new script for the variable <- phone -> for the paypal.php file.

    Replace the line:
    $p->add_field(‘night_phone_a’, $_POST[‘phone’]);

    with:

    $rawPhoneNumber=$_POST[‘phone’];
    $rawPhoneNumber = preg_replace(“/[^0-9|+]/”, “”, $rawPhoneNumber);
    if(strlen($rawPhoneNumber) == 7)
    $rawPhoneNumber = preg_replace(“/([0-9]{3})([0-9]{4})/”, “$1$2”, $rawPhoneNumber);
    else
    if(strlen($rawPhoneNumber) == 10)
    $rawPhoneNumber = preg_replace(“/([0-9]{3})([0-9]{3})([0-9]{4})/”, “$1-$2-$3”, $rawPhoneNumber);
    else
    if(strlen($rawPhoneNumber) == 11)
    $rawPhoneNumber = preg_replace(“/([0-9]{4})([0-9]{3})([0-9]{4})/”, “$1-$2-$3”, $rawPhoneNumber);
    else
    if(strlen($rawPhoneNumber) >= 12)
    $rawPhoneNumber = preg_replace(“/([0-9]{7})([0-9]{3})([0-9]{4})/”, “$1$2$3”, $rawPhoneNumber);
    $phoneChunks = explode(“-“, $rawPhoneNumber);
    $p->add_field(‘night_phone_a’, $phoneChunks[0]);
    $p->add_field(‘night_phone_b’, $phoneChunks[1]);
    $p->add_field(‘night_phone_c’, $phoneChunks[2]);

    I hope this might help someone.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: eShop] Paypal rederecting information problem.’ is closed to new replies.