2
Contributors
2
Replies
12
Views
2 Years
Discussion Span
Last Post by Lau_1
0

Currently i do it like this,

    $query = array();
    $query['business'] = $paypal_id;
    $query['cmd'] = '_cart';
    $query['upload'] = '1';

    $rs1_settings = mysqli_query($link, "select * from my_table where reference='$reference'");
    $i=1;
    while ($row1_settings = mysqli_fetch_array($rs1_settings))
    {
        $query['item_name_'.$i] = $row1_settings['name'];
        $query['item_number_'.$i] = $i;
        $query['amount_'.$i] = $row1_settings['price'];
        $query['quantity_'.$i] = $row1_settings['quantity'];
        $query['tax_'.$i] = number_format(($row1_settings['price'] * 0.06),2);
        $i++;
    }

    $query['no_shipping'] = '1';
    $query['currency_code'] = 'MYR';
    $query['handling'] = '0';
    $query['notify_url'] = 'http://127.0.0.1/web/reconfirmDetails.php';
    $query['cancel_return'] = 'http://127.0.0.1/web/failedTransaction.php';
    $query['cancel_url'] = 'http://127.0.0.1/web/failedTransaction.php';
    $query['return'] = 'http://127.0.0.1/web/completeTransaction.php';


    // Prepare query string
    $query_string = http_build_query($query);

    header('Location: https://www.sandbox.paypal.com/cgi-bin/webscr?' . $query_string);
    }

And how can i add another item, like this

Item name : Discount Coupon
item number : 1
Amount: -5
Item quantity : 1

Any suggestion? Thanks For Help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.