About the libraryA simple PayPal library for .NET. Simple implementation of the Express Checkout. A simple library for non-technical users. The library allows creating custom checkout. It incorporates three main methods: for setting up the payment, for getting the shipping details from PayPal and for confirming the payment.
The library also has a feature that allows setting the mobile checkout page, so that users checking out on mobile platforms get a customized PayPal checkout page for a mobile device.
How to useThe library is documented in the provided XML file with the intelli-sense data integrated. The main class in the library is the PayPalAPICaller class. To use this class the following steps are necessary:
- Instantiate a single object of the class and store it on the application level (not mandatory, the class can be reinstantiated for each method call, as it does not store any data internaly except for the API credentials). If the class is instantiated for each method call, before each method call, the credentials should be set.
- Set the PayPal API credentials using the SetCredentials function.
- Invoke the ExpressCheckout method which will call PayPal API to obtain the token and start the transaction.
- Redirect the user to the provided url.
- After the user is redirected back to your site from PayPal, process their shipping details using the method GetShippingDetails.
- Show a confirmation message to the user and allow them to confirm the payment
- Confirm the payment using the ConfirmPayment function.
- Process the payment with your own application logic.
NOTE: Make sure to use the same amount and currency in the ExpressCheckout and ConfirmPayment methods.
For testing set the Sandbox attribute to true (it is false by default).