28

I am implementing Paypal's new REST API Pay with Paypal method that can be referenced here: https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/

The payment executes fine, exactly the way it should be. The user chooses to pay with Paypal and is then redirected to the Paypal site where he is expected to log in and approve the payment. The JSON data that I am sending Paypal is pretty much what is specified in the above link and mine looks like this:

{
  "intent":"sale",
  "redirect_urls":{
    "return_url":"http://<return URL here>",
    "cancel_url":"http://<cancel URL here>"
  },
  "payer":{
    "payment_method":"paypal"
  },
  "transactions":[
    {
      "amount":{
        "total":"7.47",
        "currency":"USD"
      },
      "description":"This is the payment description."
    }
  ]

}

As it redirects the user to the paypal website, the description and total amount column is shown blank

I am not sure if this is a mistake on Paypal's REST API but I believe I am providing the necessary description + amount payment to be reflected on this page. If this information is not shown, it is typically a deterrent to the user since they would definitely like to see the amount they are paying on the Paypal site even though this amount is listed on my website.

This is what it looks like:

enter image description here

For those who would like to indicate that the user has not logged in, well, even after logging in, the description and the current purchase column remain blank.

Am I missing any parameters that need to be sent to Paypal in order to indicate this description data?

Note: This issue persists for both the live and sandbox servers.

Parijat Kalia
  • 4,929
  • 10
  • 50
  • 77

1 Answers1

39

The left hand pan in above page displays: 1. Item details from order. You can include item list as part of the transaction details in payment resource. The same will be displayed here. 2. Components of the transaction amount e.g. shipping amount, tax, etc. if you include them in request.

Try this request to see example:

{
    "intent": "sale",
    "payer": {
        "payment_method": "paypal"
    },
    "redirect_urls": {
        "return_url": "http://<return url>",
        "cancel_url": "http://<cancle url>"
    },
    "transactions": [
        {
            "amount": {
                "total": "8.00",
                "currency": "USD",
                "details": {
                    "subtotal": "6.00",
                    "tax": "1.00",
                    "shipping": "1.00"
                }
            },
            "description": "This is payment description.",
            "item_list": { 
                "items":[
                    {
                        "quantity":"3", 
                        "name":"Hat", 
                        "price":"2.00",  
                        "sku":"product12345", 
                        "currency":"USD"
                    }
                ]
            }
        }
    ]
}
Anthon
  • 69,918
  • 32
  • 186
  • 246
Deepesh Dwivedi
  • 424
  • 5
  • 3
  • 1
    Thank you. Paypal rest api still in beta and needs serious documentation rewrite. Thank you btw. – Murtaza Khursheed Hussain Dec 12 '13 at 07:02
  • Hi Deepesh,I am using paypal with version 1.4.3.But i am not having any method to send the item details.Please help me. – Madhu Dec 21 '13 at 07:26
  • I don't believe item list or transaction list is currently supported by the rest api. – YorkshireKev Jun 11 '14 at 18:13
  • 2
    Pasting that exact example in the REST API playground and adding valid redirect URLs brings creates a valid request but when you follow the approval URL the sidebar does not display the payment description. – Gerry Shaw Jun 17 '14 at 01:08
  • 1
    Mid 2015 this is still a game of guess to get things done with PayPal documentation (REST API). Too many options improperly sorted and unclear description. – Arnaud Leyder May 29 '15 at 06:41
  • @Gerry It worked for me, sidebar shows the transaction details as supposed to. – M K Aug 17 '15 at 08:50
  • 2015 is nearly over and I spent an hour trying to figure out why the users were redirected to a blank PayPal checkout. Thank you, this answer fixed it! :) – MrD Dec 19 '15 at 14:27
  • True and weird that "item_list" property must be set in order to display the amount, and it is not noted explicitely in the doc. – dmidz Mar 20 '16 at 12:32
  • solves the case. Wish paypal mentioned these things explicitly in documentation – exexzian Jan 25 '17 at 20:22
  • solves it for me too! thanks. definitely need a rewrite of the documentation. – codemax Mar 02 '17 at 15:09
  • NOT working for me. The amount is being instantaneously transferred from buyer to merchant account but the transaction/activity is not showing up either on Buyer of Merchant dashboard – Ahmed Numaan Oct 16 '18 at 10:46