Hello, anyone know how to display discount code at the paypal order summary?

paypal.PNG

Recommended Answers

All 2 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.