0

I am new to paypal integration,

Requirement (paypal USA): Admin should be able to generate paypal invoice from website admin panel. As this is service invoice and charges will be different depending on client requirement. And User, from website client area can receive paypal invoice and pay it online.

I ve read few documents of paypal api but couldn't decide which flow/API to use.

Please suggest best way with least coding to integrate paypal with my website.

TechnoPulseLabs
  • 111
  • 4
  • 15

2 Answers2

2

You can use the Invoicing API for that. My PHP class library for PayPal will make this very simple for you. It comes with fully functional samples and ready-made templates so you can get calls working very quickly and easily.

For example, take a look at the CreateAndSendInvoice sample. All you would need to do is replace the static values with your own static or dynamic values and it would create the invoice in the PayPal system as well as send the user an email to pay the invoice.

It also comes with all the other calls like CreateInvoice, SendInvoice, DeleteInvoice, CancelInvoice, etc, so you can easily make any call you need for a complete PayPal invoicing system.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • Seems great, but how can I show this invoice in customer account in my website, can this link be created? – TechnoPulseLabs Feb 03 '15 at 10:39
  • That would be done however you want within your own system. You may want to save all of the data in your own invoices database and then generate the PayPal invoice from that, or you could do it vice-verse. You could just use the invoicing API and then use IPN to update your database when new invoices are created, paid, etc. There are a number of ways to handle that side of things. – Drew Angell Feb 03 '15 at 11:03
0

There are two API endpoints that could serve your purpose.

  1. Invoicing using Classic APIs, which uses SOAP, NVP and at times REST to make calls
  2. Invoicing using New REST APIs which is the new API set that PayPal is actively developing.

The REST APIs are getting actively developed and supported, and we encourage external developers to start using REST APIs over Classic APIs, to ensure long term support from PayPal with any issues, and features. However, as these APIs, are getting developed, few specific features are still getting developed, and should be available soon. However, Invoicing APIs is developed with most features as Classic APIs.

REST APIs also comes with these APIs:

  • Create an invoice
  • Send an invoice
  • Update an invoice
  • Retrieve an invoice
  • Get invoices of a merchant
  • Search for invoices
  • Send an invoice reminder
  • Cancel an invoice
  • Delete an invoice
  • Retrieve a QR code
  • Record a payment
  • Record a refund

We are currently supporting PayPal-PHP-SDK, an SDK for making calls to PayPal REST APIs. There is a lot of documentation around the SDK from installing it, to running samples, etc.

Wiki Page

Samples Page

I would definitely recommend you to download this SDK, and run the samples locally in your machine, (which generally takes few seconds to setup), and try out Invoicing Samples. You could modify the samples, to verify the specific use case that you are trying to accomplish. You could view the sample source code online here.

Please let me know if you run into any issues, and we would be more than happy to help.

Jay Patel - PayPal
  • 1,489
  • 1
  • 11
  • 20
  • Hi thanks jay, this is great help, but I am running short of time and I want quick option for online payment, hence decided to use paypal button. But there I am stuck at fix price, can I have user input price and proceed for payment button? – TechnoPulseLabs Feb 06 '15 at 18:27
  • For standard buttons you can either use the new JS buttons (https://github.com/paypal/JavaScriptButtons#editable-inputs) or you can use the old school HTML button code and create your own using the variables available (https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/) – Jay Patel - PayPal Feb 06 '15 at 22:34
  • Hi, how can I use the Amount Only template? I don't need the Quantity in my case. Thanks – Waiyl Karim Mar 28 '18 at 09:18