soyeb84
soyeb84

Reputation: 72

Paypal checkout page not displaying shipping/postage cost

I have gone through many questions similar to this but I could not resolve the issue. This is not the first time I am using paypal, I have successfully used the code below in other websites as well.

I have also checked the option for overriding the profile postage settings.

I am using the following code:

<form id="f1" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">


     @* <input type="hidden" name="shipping" value="0.00">*@
    <input type="hidden" name="handling_cart" value="@shipamt" />
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="upload" value="1" />
    <input type="hidden" name="business" value="[email protected]" />
    <input type="hidden" name="currency_code" value="GBP" />
    <input name="custom" type="hidden" id="custom" value="@cartId" />

    @foreach(var cartdetail in Model.cartDetail)// (int i = 0; i < Model.order.cart.cartDetail.Count;i++ )
    {
        <input type="hidden" name="item_number_@i" value="@i" />
        <input type="hidden" name="item_name_@i" value="@cartdetail.product.Title" />
            <input type="hidden" name="quantity_@i" value="@cartdetail.Quantity" />

        <input type="hidden" name="amount_@i" value="@cartdetail.product.getCurrentPrice()">
        i++;
    }
       <input type="hidden" name="return" value="http://parduh.com" />
        <input type="hidden" name="cancel_return" value="http://cancelurl.com" />
    <input type="hidden" name ="notify_url" value="http://notifyurl.com" />
  @*  <input type="hidden" name="no_shipping" value="1" />*@

    <input type="hidden" name="image_url" value="http://parduh.com/images/logo.png">
</form>

These are the values from chrome's developer tool, all the values are being posted to paypal

handling_cart:16.6167
cmd:_cart
upload:1
business:[email protected]
currency_code:GBP
custom:13
item_number_1:1
item_name_1:Dress
quantity_1:1
amount_1:68.00

Thanks for the help.

Upvotes: 0

Views: 301

Answers (1)

PayPal_Micah
PayPal_Micah

Reputation: 106

The issue is that you are passing the value for handling_cart with more than 2 decimal places. Try the same request, but making sure that you round off so that handling_cart = 16.62.

Upvotes: 1

Related Questions