I disovered a wired issue using Paypal ExpressCheckout with discounts:
I pass 2 Items like:
L_NAME0 : "test2",
L_AMT0: 2, // 2 EUR
L_QTY0: 1
and
L_NAME1 : "Discount",
L_AMT1: -0.60, // 60 cent
L_QTY1: 1
After redirect to Paypal everything seems fine:
But after closing this transaction, paypal charges the full amount (2 EUR) from my paypal-account:
What is wrong with this paypal discount? It seems to be cheating on the customer and he must feel betrayed.
I dont believe its paypals fault, so any ideas on what i did wrong are appreciated :)
It looks like you applied the discount line item to your SetExpressCheckout call, but the DoExpressCheckoutPayment call must not have had the same thing..??
You need to make sure DECP has all of the same line item details in it.
Related
I am having a issue with a paypal cart since the update around march (bit late but the site is not used yet and we just discovered it now).
I already checked this question but it did not solve the issue for a shopping cart (Paypal : hosted button payments fail with code=AMOUNT_ERROR)
We send a object that contains the request data through a plugin called neo.js, this works fine as far as we know.
This is our data we send to paypal as a js object.
{
amount_1: 10.01,
business: "noreply#domain.com",
cancel_return: "https://dev.domain.com",
charset: "utf-8",
cmd: "_cart",
currency_code: "US",
custom: "username",
item_name_1: "$10 item",
item_number_1: "1",
no_shipping: 1,
notify_url: "https://dev.domain.com/callback/paypal.php",
quantity_1: 1,
return: "https://dev.domain.com",
upload: 1
}
It has to do something with the amount, but using a , instead of . but that only gives a normal error message on screen that the format is incorrect.
We have tried multiple things including the dollar sign and making it a string but nothing seem to be working.
I reproduced the error and it is due to the wrong currency code passed.
You are passing "US" but the currency code (that is a parameter that refers to the AMOUNT as in the error returned) must be of 3 characters as you can see on PayPal guide: https://developer.paypal.com/webapps/developer/docs/classic/api/currency_codes/
Change it to "USD" instead and you will have a working checkout.
I got a problem on my paypal's order summary, nothing appears except total order:
here's my request (took from paypal's site, https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECCustomizing/)
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&L_PAYMENTREQUEST_0_NAME0=10% Decaf Kona Blend Coffee
&L_PAYMENTREQUEST_0_NUMBER0=623083
&L_PAYMENTREQUEST_0_DESC0=Size: 8.8-oz
&L_PAYMENTREQUEST_0_AMT0=9.95
&L_PAYMENTREQUEST_0_QTY0=2
&L_PAYMENTREQUEST_0_NAME1=Coffee Filter bags
&L_PAYMENTREQUEST_0_NUMBER1=623084
&L_PAYMENTREQUEST_0_DESC1=Size: Two 24-piece boxes
&L_PAYMENTREQUEST_0_AMT1=39.70
&L_PAYMENTREQUEST_0_QTY1=2
&PAYMENTREQUEST_0_ITEMAMT=99.30
&PAYMENTREQUEST_0_TAXAMT=2.58
&PAYMENTREQUEST_0_SHIPPINGAMT=3.00
&PAYMENTREQUEST_0_HANDLINGAMT=2.99
&PAYMENTREQUEST_0_SHIPDISCAMT=-3.00
&PAYMENTREQUEST_0_INSURANCEAMT=1.00
&PAYMENTREQUEST_0_AMT=105.87
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&ALLOWNOTE=1
And the cmd express checkout call:
https://www.sandbox.paypal.com/webscr
&cmd=_express-checkout
&token=EC%2d8KH91006BV366882T
&useraction=commit
Did i missed something?
Thanks in advance !
I'm building a book store and I am building the checkout using PayPal Payflow . This is the checkout flow:
Shipping info --> Billing info |verify CC using Paypal| --> Order summary --> Submit |authorize CC using Paypal|
Shipping info: fill out shipping address, nothing special here
Billing info: fill out your billing address + credit card info. Don't save the credit card info since it's against standards, instead just send the CC number, expiration date, and CVV directly to PayPal to verify. PayPal approves.
Order summary: The order sees the summary of his order before he submits the order. He presses submit and another request to PayPal is sent to authorize the funds.
However, the CC info vanishes after #2, so how would I persist that data to #3 so that I can send it to PayPal again?
Can I just use the ORIGID to point to the PNREF ? The documentation says I have to do a full request with the whole params list (including CC info, CVV, exp date, etc).
TRXTYPE=A&TENDER=C&PWD=x1y2z3&PARTNER=PayPal&VENDOR=SuperMerchant&USER=S
uperMerchant&ACCT=5555555555554444&EXPDATE=0308&AMT=123.00&COMMENT1=Seco
nd purchase&COMMENT2=Low risk customer&INVNUM=123456789&STREET=5199
MAPLE&ZIP=94588
Or am I just misunderstanding what authorization means? Isn't authorization actually reserving funds in the user's CC? So that shouldn't be done until the user presses submit order right?
I figured it out.
The documentation here: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_guide.pdf
on page 40 mentions it briefly, but doesn't go into much detail about this checkout flow even though it seems pretty common.
My assumption was right, in that I could just do an address verification request first with all the CC info, and use the PNREF returned. I save the PNREF id in my session and reuse it to submit a request that looks like this:
def authorize_transaction(pnref)
make_request(authorization_data(pnref))
end
def authorization_data(pnref)
{
"TRXTYPE" => "A",
"TENDER" => "C",
"USER" => PAYPAL_API["user"],
"PWD" => PAYPAL_API["pwd"],
"VENDOR" => PAYPAL_API["user"],
"PARTNER" => "Paypal",
"AMT" => purchase.total_price,
"ORIGID" => pnref,
"VERBOSITY" => "HIGH"
}
end
And receive the desired response:
{"RESULT"=>"0", "PNREF"=>"A10A6A9C08E1", "RESPMSG"=>"Approved", "AUTHCODE"=>"752PNI", "AVSADDR"=>"Y", "AVSZIP"=>"Y", "HOSTCODE"=>"A", "PROCAVS"=>"Y", "VISACARDLEVEL"=>"12", "TRANSTIME"=>"2014-01-31 11:53:56", "FIRSTNAME"=>"net", "LASTNAME"=>"theory", "AMT"=>"15.64", "ACCT"=>"1111", "EXPDATE"=>"0115", "CARDTYPE"=>"0", "IAVS"=>"N"}
I do not know if the issue is in code or the paypal account settings. Paypal displays correctly the shipping cost, it displays the correct total (item price + shipping),
but in fact, the transactions includes only the item price, not the shipping costs.
I have been unable to find out what is wrong. if paypal can display it correctly, why cant it include it properly in the transaction ?
here is the request sent to paypal:
$padata = '&CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTACTION=Sale'.
'&ALLOWNOTE=1'.
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&L_PAYMENTREQUEST_0_QTY0='. urlencode($ItemQty).
'&L_PAYMENTREQUEST_0_AMT0='.urlencode($ItemPrice).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&L_PAYMENTREQUEST_0_NAME0='.urlencode($ItemName).
'&L_PAYMENTREQUEST_0_NUMBER0='.urlencode($ItemNumber).
'&AMT='.urlencode($ItemTotalPrice).
'&RETURNURL='.urlencode($PayPalReturnURL ).
'&CANCELURL='.urlencode($PayPalCancelURL);
The param for shipping that I used is :
PAYMENTREQUEST_0_SHIPPINGAMT
is it correct ? is a complementary one needed ?
Are you supplying all of your PAYMENTREQUEST_0_* and L_PAYMENTREQUEST_0_* variables in your DoExpressCheckoutPayment call as well as your SetExpressCheckout call?
SetExpressCheckout will control what the buyer sees when they go to check out on PayPal. DoExpressCheckoutPayment will control what the buyer is actually charged for. Therefore, if you want your shipping charge to be included in the transaction, you need to make sure that it's included in both calls.
for the records, correct params for DoExpressCheckoutPayment :
$padata = '&TOKEN='.urlencode($token).
'&PAYERID='.urlencode($playerid).
'&PAYMENTACTION='.urlencode("SALE").
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&CURRENCYCODE='.urlencode($PayPalCurrencyCode);
Please excuse me if this is a newbie question but I have never worked with any sort of credit card API before and I am, well, pretty much a newbie...
I have a script with "PayPal integrated" heh, and its not working.
When I run a card on the PayPal Sandbox, the transaction seems to go through, my sandbox account gets credited the amount but the script returns this error:
TIMESTAMP: 2011-04-25T14:03:42Z
CORRELATIONID: 5e727288789fb
ACK: SuccessWithWarning
L_LONGMESSAGE0: This transaction has been completed, but the total of items in the cart did not match the total of all items.
AMT: 25.00
CURRENCYCODE: EUR
AVSCODE: X
TRANSACTIONID: 4MM79765A4836914N
I understand the error message, but I am not sure where to begin looking in order to try and rectify it.
Sorry if this question is blurry, I am pretty lost and hoping that someone could just help get me pointed in the right direction here?
Thanks in advance!
"In your request string you may have use &L_COST0=18.00& for amount".
which may create problem for transaction, The variable for line item is L_AMTn so in this case it should be &L_AMT0=18.00&.
Just try this if needed. otherwise send the request string you had pass for more detail view.
Thanks.
you are suppose to called this function-
$httpParsedResponseAr = PPHttpPost('DoDirectPayment', $nvpStr);
where
$nvpStr = &PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber".
"&EXPDATE=$padDateMonth$expDateYear&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName".
"&STREET=$address1&CITY=$city&STATE=$state&ZIP=$zip&COUNTRYCODE=$country&CURRENCYCODE=$currencyID";
Some parameters may diff for your payment process,
so you can try this.
Thanks.