title: how to add discount information in paypal php rest api?
body: <p>I am currently using paypal php rest api 0.6. I am unable set discount amount.</p>
  
  <p>I am able to see the item list, tax and shipment amount. But don't know how to configure discount.
                  $payer = new Payer();
                  $payer->setPaymentMethod("paypal");</p>
  
  <pre><code>            $item = new Item();
              $item-&gt;setQuantity("1");
              $item-&gt;setName("Classic Shirt");
              $item-&gt;setPrice("100.00");
              $item-&gt;setCurrency("USD");
              $item-&gt;setSku("CS00001");
              $item2 = new Item();
              $item2-&gt;setQuantity("1");
              $item2-&gt;setName("Classic Brown Shirt");
              $item2-&gt;setPrice("100.00");
              $item2-&gt;setCurrency("USD");
              $item2-&gt;setSku("CS00002");
  
              $amount = new Amount();
              $amount-&gt;setCurrency("USD");
  
              $amountDetails = new Details();
  
              $amountDetails-&gt;setSubtotal('200');
              $amountDetails-&gt;setTax('10');
              $amountDetails-&gt;setShipping('10');
              //$amountDetails-&gt;setDiscount('10');
              $amount-&gt;setDetails($amountDetails);
              $amount-&gt;setTotal("210.00");
              $item_list = new ItemList();
              $item_list-&gt;setItems(array($item,$item2));
  
              $transaction = new Transaction();
              $transaction-&gt;setAmount($amount);
              $transaction-&gt;setDescription("This is incredibly awesome.");
              $transaction-&gt;setItem_list($item_list);
  
              $baseUrl = getBaseUrl();
              $redirectUrls = new RedirectUrls();
              $redirectUrls-&gt;setReturnUrl("$baseUrl/ExecutePayment.php?success=true")
                      -&gt;setCancelUrl("$baseUrl/ExecutePayment.php?success=false");
  
              // ### Payment
              // A Payment Resource; create one using
              // the above types and intent set to 'sale'
              $payment = new Payment();
              $payment-&gt;setIntent("sale")
                      -&gt;setPayer($payer)
                      -&gt;setRedirectUrls($redirectUrls)
                      -&gt;setTransactions(array($transaction));
  </code></pre>