Line items on the paypal express checkout using Paypal Payments Advanced (and the NVP API) - paypal

I'm using Paypal Payments Advanced with the hosted checkout page (iframe). This gives customers an option to click the "pay with paypal"(button) which is paypal's Express Checkout or pay using a credit card. Everything seems to be working great, except I am unsuccessful at making individual line items show when passing parameters using the NVP API. Instead I only see a total amount (See picture below).
And I also believe this means the line items are not being sent at all (even when I pay using a credit card) since I don't see any line items when I log into paypal to view the details of the transactions.
Here are the NVP parameters I'm currently using:
"PARTNER" => "PayPal",
"VENDOR" => "company_here",
"USER" => "user_here",
"PWD" => "password_here",
"TRXTYPE" => "S",
"AMT" => "2.16",
"ITEMAMT" => "2.00",
"TAXAMT" => "0.16",
"L_NAME0" => "Test Product 1",
"L_DESC0" => "Test Product Description",
"L_AMT0" => "1.00",
"L_TAXAMT0"=> "0.08",
"L_QTY0" => "1",
"L_NAME1" => "Test Product 2",
"L_DESC1" => "Test Product 2 description",
"L_AMT1" => "1.00",
"L_TAXAMT1"=> "0.08",
"L_QTY1" => "1",
"CUSTOM" => "Custom Text Here",
"INVNUM" => "Invoice12345",
"CURRENCY" => "USD",
"CREATESECURETOKEN" => "Y",
"SECURETOKENID" => "token_here",
Any ideas what I'm doing wrong?

According to this small section in the Express Checkout for Payflow Pro document (page 19):
To enable line-item support in reference transactions, which includes the parameters below,
you must contact Merchant Technical Support at http://www.paypal.com/mts:
L_NAMEn
L_DESCn
L_COSTn
L_TAXAMTn
L_QTYn
So I called PayPal tech support and they turned on line item support in my paypal manager account. However line-items still weren't being sent in the transaction. So I called them again, and they informed me that, for payflow, the line-items won't show in the express checkout and you can't view them in the transaction details in your paypal account either. They are pretty much ignored. They are actually used for certain processors, but since my processor is PayPal, they weren't being used for anything.
The idea is that (say you have a shopping cart) you show a breakdown of line-items at the payment screen, just before a user pays (perhaps same screen where you have the payments advanced iframe, a.k.a. hosted checkout page). Then if you ever want to look up what line items were purchased for a specific invoice, you need to make sure you saved this on your web server, not paypal. Then you can look up the invoice number on paypal and compare with the order details stored in your own database.

I stumbled across your post after running into a similar situation. I also use paypal advanced on two of my websites. One website has been processing orders through the iFrame and has successfully managed to achieve line item support while the other one was having difficulties. I got the same run around with paypal support about how line item for certain PP advanced transactions wasn't supported...But this is false. After talking with all different levels of merchant technical support, both sites now support line item details for all the transaction types available through PP advanced.
We use shiprush, so pulling orders directly from PP is much easier than trying to link shiprush and the shopping cart..

Related

How is this PayPal Integration secure? [duplicate]

This question already has answers here:
PayPal Checkout: Is it safe to receive a payment with only client-side code?
(2 answers)
Closed 2 years ago.
Looking at this example here:
https://developer.paypal.com/docs/archive/checkout/integrate/
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '30.11',
currency: 'USD',
details: {
subtotal: '30.00',
tax: '0.07',
shipping: '0.03',
handling_fee: '1.00',
shipping_discount: '-1.00',
insurance: '0.01'
}
},
description: 'The payment transaction description.',
custom: '90048630024435',
This is present in the JavaScript that the client can see, how is this secure? Can the user not just modify these values and change total to a smaller value to pay less?
Similar question regarding their 'server' example which also has seemingly private information present in the client side presented JavaScript.
no you just can't change the value that way
+ even if you somehow end up changing value lets say using some kind of network spoofing thing that can override the payload, you would end up paying modified amount which the paypal & app/owner both can clearly see & validate
which means instead of $10 if you paid $5 the app/owner would also see the same $5 & not $10
basically you won't be able to get away depicting you paid $10 when you actually didn't pay $10
You've linked to old archived documentation that should not be used, but the issues are the same: Anything in client-side code can be changed. Payments can always be sent for a lower amount. That's how client side payments work.
Any logic to keep track of which payments are valid and for the correct amount must be on your server.
For PayPal Checkout, here's the front-end UI you should use: https://developer.paypal.com/demo/checkout/#/pattern/server
You'll need two corresponding routes on your server, one for 'Create Order' and one for 'Capture Order', documented here: https://developer.paypal.com/docs/business/checkout/server-side-api-calls/#server-side-api-calls
Validate correctness when capturing on the server. If it's wrong, don't capture.

Are there any changes to IPN params with Enhanced Recurring Payments

I'm using Paypal Website Payments Standard to accept recurring payments, but thinking of upgrading to "Enhanced Recurring Payments" to accept recurring payments from people without paypal accounts. I want to know, what if any are the changes to the APIs? Specifically, do the IPN messages differ at all? I can't find any information on how Enhanced Recurring Payments changes it, if at all.
If anybody knows, or can post a sample IPN for an Enhanced Recurring Payment without a PayPal account, that would be great!
There is a difference of only one variable between the IPN for PayPal Payments and the Credit card Payments . For the credit IPN you will receive an extra variable "receipt_id" in addition to the other variables . I have posted the two sample IPN's below :
ERP IPN when somebody pays via credit card option
mc_gross=1.00 &protection_eligibility=Eligible &address_status=confirmed &payer_id=ZQSC4
4KE3MPNE &address_street=3710 Spring Haven Trail ada &payment_date=07:49:47 Sep 29, 2014 PDT
&payment_status=Completed &charset=UTF-8 &address_zip=07054 &first_name=Eshan &
option_selection1=Small &option_selection2=Red &option_selection3=Value for the text field &
amp;mc_fee=0.33 &address_country_code=US &address_name=Eshan agag &notify_version=3.8 &a
mp;subscr_id=I-KJR1N7DVTSFV &custom=THIS IS CUSTOM VARIABLE FOR SUBSCRIPTION &payer_status=u
nverified &business=XXXXXXXXX &address_country=United States &address_city=Pa
rsippany &verify_sign=Aw6X5vyHflgdAgaJGWvPoCJ8QoI9AGpk50cgjQn5vFFAb.keQURphbSq &payer_email=
jain#jainwain.com &option_name1=First Drop Down &option_name2=Second Drop Down &option_n
ame3=This is Text field &contact_phone=434-343-3434 &txn_id=9E162447RW023401J &payment_t
ype=instant &last_name=agag &address_state=NJ &receiver_email=XXXXXXXXXX &
payment_fee=0.33 &receiver_id=XXXXXXXXX &txn_type=subscr_payment &item_name=Passing
custom field in subs button to see if it comes in IPN and show up in Account &mc_currency=USD &a
mp;residence_country=US &test_ipn=1 & **receipt_id=3610-4109-0310-2116** &transaction_subject
=Passing custom field in subs button to see if it comes in IPN and show up in Account &payment_g
ross=1.00 &ipn_track_id=42d902b155b6d
IPN when someone pays via PayPal
mc_gross=1.00 &invoice= 12345678 &protection_eligibility=Eligible &address_status=confir
med &payer_id=XXXXXXXXXX &address_street=cxas asa &payment_date=09:40:46 Sep 29, 2014
PDT &payment_status=Completed &charset=UTF-8 &address_zip=95616 &first_name=Eshan P
ersonal Test &option_selection1=Small &option_selection2=Red &option_selection3=Using th
e text field as the hidden one and also passed invoice id &mc_fee=0.33 &address_country_code
=US &address_name=Eshan Personal Test Account &notify_version=3.8 &subscr_id=I-79KEGCFRB
8V6 &custom=THIS IS CUSTOM VARIABLE FOR SUBSCRIPTION &payer_status=verified &business=XXXXXXX
&address_country=United States &address_city=FL &verify_sign=ABoC7zeo
JKOS8-FgzxlPH0pKFIpkABi1td4dId5Vndd1boMDXpvdWXfX &payer_email=XXXXXXXXX &option_n
ame1=First Drop Down &option_name2=Second Drop Down &option_name3=This is Text field &co
ntact_phone=408-767-7151 &txn_id=5LX310552A647342M &payment_type=instant &last_name=Acco
unt &address_state=FL &receiver_email=XXXXXXX &payment_fee=0.33 &receiv
er_id=XXXXXXX &txn_type=subscr_payment &item_name=Passing custom field in subs button
to see if it comes in IPN and show up in Account &mc_currency=USD &residence_country=US &
;test_ipn=1 &transaction_subject=Passing custom field in subs button to see if it comes in IPN a
nd show up in Account &payment_gross=1.00 &ipn_track_id=80ffac6da5284
I have attached Screen Shot also :

Multiple option of payment on paypal

I did a button of 3 options for payment (Buy Now) on PayPal, and when I pasted the code on my website.
Everything looks ok until you click on Buy now, It's transfer to error code on PayPal.
This is the link for the website: http://compx.co.il/?page_id=43
The error code that I get is:
1.Can not process your request at this time. Return to CompX IT Services and try another option.
2. PayPal can not process this transaction because of a problem on the site of the seller. Contact the seller directly to resolve this issue.
Any suggestion?
Regards,
Dvir
It's probably a character set issue. The default character set doesn't recognize them so you can fix this problem by changing the text of your option values or by changing the "charset" you're posting to PayPal.
You can follow these steps to modify the character set within your PayPal account:
- Log into your PayPal account at https://www.paypal.com
- Click the Profile link
- Click the 'Language Encoding' link under the Selling Preferences column
- Click the gray 'More Options' button
- Choose the same encoding you are using for your data off your site
- Select 'Yes' for 'Do you want to use the same encoding for data sent from PayPal to you (e.g., IPN, downloadable logs, emails)?'
- Click 'Save'
You can also define the charset value in the button code to match the charact values you have set in your options.

Display users's email after purchase with Paypal Website Payments Standard

I have a simple button created with Paypal's Website Payments Standard, and I'm using the feature "Take customers to this URL when they finish checkout".
On that page which users are being redirected to when the purchase is successful (on my site) I'd like to simply display the email associated with their paypal purchase, telling them something like "an invoice will be sent to this email address: xxx".
Is that possible without using the API or IPN (which I'd rather avoid because it seems like I can't set different IPN urls for deifferent buttons/products.)
Ended up using PDT, there's a great example of how to simply do this here:
http://www.geekality.net/2010/10/19/php-tutorial-paypal-payment-data-transfers-pdt/
Thanks PP_MTS_Chad, I wouldn't have found it if it wasn't for you pointing out that option.
You could use 1 of 2 ways to get information back to your return URL, without having to use IPN or an API. You could use PDT to return information back to your site, or you could use the return method which uses the variable "rm". You can find more out about IPN here, and there are also some sample scripts you can use on that site as well.
If you want to use the return method, this is a little different from PDT. With the return method you do not have to post the information back to PayPal to verify it. If you wanted PayPal to post the information over to your return page you would just simply enable auto return in your account under your profile. Then you would just include the following lines of code in your button code.
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="http://www.mysite.com/return.php">
The variable "rm", controls how you want the information sent back to you. You can set it to be a GET or a POST.
Allowable values are:
0 – all shopping cart payments use the GET method
1 – the buyer's browser is redirected to the return URL by using the GET method, but no payment variables are included
2 – the buyer's browser is redirected to the return URL by using the POST method, and all payment variables are included
The default is 0.
Note: The rm variable takes effect only if the return variable is set.

One of delivery charge for paypal shopping cart

Is there a way of setting a one of delivery charge for multiple items using the paypal shopping cart. I have a website that sells postcards for the small local museum but I can only get the delivery charge added on for every different item, or not at all. Delivery is 65p, So if someone buys;
6 x "a" postcard
there is one delivery charge 65p.
The problem is that when someone orders;
1 x "a" postcard
1 x "b" postcard
1 x "c" postcard
1 x "d" postcard
1 x "e" postcard
1 x "f" postcard
The delivery charge is £3.90 which is way too much for 6 postcards.
Is there a way of setting the delivery charge to 65p for any number of variations?
Thanks anyone who can help.
Ok, Worked it out! I think I am just going to have to base the shipping on a total order value and not specify it at all in my coding... Heres what I did in case anyone else finds this with the same problem.
Login to Paypal account.
Click on the "Profile" tab near the top of the page and under "Selling Preferences" click on the "Shipping Calculations" link and follow the steps to set up for instance £0.01 - £9.99 delivery £1.15, £10.00-£14.99 delivery £1.95 etc etc etc.
Thanks for your help everyone!!
I think PayPal has a value called "shipping_1" and "shipping_2", depending on the platforn you just need to override these values, we used something like this for our PHP form
<input type="hidden" name="shipping_1" value="<?php echo $order->delivery - $order->discount_delivery ?>">
This link says you can do this by setting
Setting the Shipping Charge for the Entire Cart
Use the shipping variable without
additional shipping2 variables to
specify the shipping charge for the
entire transaction. The value of
shipping is used for the shipping
charges, regardless of the merchant’s
profile-based shipping rates and rate
basis.
Also see https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=brc/three_common_shipping_issues