paypal error code 10413 - php

i am implementing express checkout, i want to set shipping amount here is NVP string i am using
$nvpstr="&L_NAME0=".$L_NAME0."&L_NAME1=".$L_NAME1."&L_NAME2=".$L_NAME2."&L_AMT0=".$L_AMT0."&L_AMT1=".$L_AMT1."&L_AMT2=".$L_AMT2."&L_QTY0=".$L_QTY0."&L_QTY1=".$L_QTY1."&L_QTY2=".$L_QTY2."&MAXAMT=".(string)$maxamt."&AMT=".(string)$amt."&ITEMAMT=".(string)$itemamt."&ReturnUrl=".$returnURL."&CANCELURL=".$cancelURL ."&CURRENCYCODE=".$currencyCodeType."&PAYMENTACTION=".$paymentType."&SHIPPINGAMT=".$L_SHIPPING_CHARG;
But its giving error code 10413 that " The totals of the cart item amounts do not match order amounts." what is the exact paramerter in which i can pass Shipping Amt & TAX

The issue was caused by mismatched amount for the order. Especially:
AMT:Total of order, including shipping, handling, tax, and any other billing adjustments such as a credit due.
ITEMAMT :Sum of costs of all items in this order.
See more:
https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECCustomizing/

Related

Utilize 100% discount voucher in Stripe account

If we are using 100% discount voucher code and price gets 0 and needs to be processed via Stripe how can we do it? Or via subscriptions that are free how to do it?
The minimum value for a charge is $0.50 USD. If the invoice has an amount smaller than this, it will not create a charge, but rather add that as a "debt" on the customer for the next invoice.
amount A positive integer in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency) representing how much to charge. The minimum amount is $0.50 US or equivalent in charge currency.
From Stripe API Reference.

eBay API to get Total Amount using GetOrders by PHP

Right now, I am using GetOrders to launch all my orders to my database. Normally, it works fine. I can get the total amount(includes item price and tax) by using:
$totalAmount = $order->AmountPaid;
However, when I tried to import an International Order, the amount was wrong.
The thing is: I only charged him $102.90, but the amount here gives me $157.62
Does anyone know how can I get the total price, which under the "Total" column, in eBay? What kind of value I need to use? Or maybe how to calculate the price for international order?
There few fields related to order price
OrderArray.Order.AmountPaid
This value indicates the total amount of the order. This amount includes the sale price of each line item, shipping and handling charges, shipping insurance (if offered and selected by the buyer), additional services, and any applied sales tax. This value is returned after the buyer has completed checkout (the CheckoutStatus.Status output field reads 'Complete').
OrderArray.Order.Total
The Total amount equals the Subtotal value plus the shipping/handling, shipping insurance, and sales tax costs.
OrderArray.Order.Subtotal
The subtotal amount for the order is the total cost of all order line items. This value does not include any shipping/handling, shipping insurance, or sales tax costs.
I would suggest you try Order.Total for receive price of the order.

Details don't match amount total when using taxes

I'm using Paypal to process payments.
The subtotal (without taxes) for the purchase is 132.94$. My customers are in Canada and I need to multiply a tax percent to that subtotal in order to get the real total.
The tax percent is 1.14975, but Paypal doesn't accept a tax percent with more than two decimals, so it rounds it to 1.15.
Here's the code that I use to setup the payment :
// Not shown- create an ItemList, add Item's to it
// ...
$details = new Details;
$details->setSubtotal(132.94);
$details->setTax(1.14975);
$amount = new Amount;
$amount->setCurrency('CAD');
$amount->setTotal(152.88); // 132.94 * 1.15
$amount->setDetails($details);
// ...
// Not shown - create the transaction, try to create the payment
However, when I try to send the information to Paypal, I get this error :
Transaction amount details (subtotal, tax, shipping) must add up to specified amount total
I tried dumping out $amount to see what it contains, and here's what I see :
Why does it tell me that the details don't add up to the amount? Am I missing something here? If I multiply the subtotal by the tax, I get the total for the amount, they do match up.

paypal express checkout set paypal fee additional

I have integrate paypal express checkout in our website. as i know and get information from paypal documentation.
Need to set Amount parameter in request input and paypal deduct fee based on amount, but i want paypal add fee additional on amount.
Example :
Product amount : $100.00;
Paypal deduct fee 2.9% on $100.00 but i want add aditional 2.9% on main amount, like :
Amount = 100.00
Fee = 2.9%
Than Total amount is = $100.00 + 2.9% = $102.90
means i want paypal automatically set his fee on checkout page and charge to user.
Can anyone help me.
Thanks in Advance.
If you want to add that fee on to your order you'll need to do so prior to sending the user to PayPal, or you could also do it on your review page after the user is returned from PayPal.
Most people just add this to their cart as a "handling fee" or whatever you want to call it. If you want to be more accurate you should use the 2.9% + .30 formula.

Magento calculate shipping to be refunded on partial refund

I'm trying to figure out how to calculate the shipping refund on orders where some of the items are being refunded. Currently, in the credit memo screen, the amount in the input field is the total amount paid for shipping. When you adjust the quantity of items being refunded, and hit update, the shipping refunded amounts stays the same. I'd like to adjust it to be the portion of shipping that is related to the items being refunded.
As a calculation, I was thinking this would be:
total shipping cost - new calculation of shipping for items not being refunded = shipping cost of items being refunded.
I can see that the calculation for shipping is done in this class:
Mage_Sales_Model_Order_Creditmemo_Total_Shipping
However, I am having trouble figuring out how I would rerun the shipping calculation for the credit memo items.
Anyone have any thoughts on how I might be able to accomplish this?

Categories