Download the PHP package rajakannan/paypal without Composer
On this page you can find all versions of the php package rajakannan/paypal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rajakannan/paypal
More information about rajakannan/paypal
Files in rajakannan/paypal
Package paypal
Short Description Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.
License MIT
Informations about the package paypal
Laravel PayPal
- Introduction
- PayPal API Credentials
- Installation
- Configuration
- Usage
- Override PayPal API Configuration
- Set Currency
- Additional PayPal API Parameters
- Express Checkout
- SetExpressCheckout
- GetExpressCheckoutDetails
- DoExpressCheckoutPayment
- RefundTransaction
- CreateBillingAgreement
- CreateRecurringPaymentsProfile
- GetRecurringPaymentsProfileDetails
- UpdateRecurringPaymentsProfile
- ManageRecurringPaymentsProfileStatus
- Adaptive Payments
- Pay
- Handling PayPal IPN
- Creating Subscriptions
- Support
- PayPal Documentation
Introduction
By using this plugin you can process or refund payments and handle IPN (Instant Payment Notification) from PayPal in your Laravel application.
Currently only PayPal Express Checkout API Is Supported.
I have also created a demo application which utilizes this package. Following is the demo link for the application:
https://laravel-paypal-demo.srmk.info/
PayPal API Credentials
This package uses the classic paypal express checkout. Refer to this link on how to create API credentials:
https://developer.paypal.com/docs/classic/api/apiCredentials/#create-an-api-signature
Installation
-
Use following command to install:
-
Add the service provider to your
$providers
array inconfig/app.php
file like: -
Add the alias to your
$aliases
array inconfig/app.php
file like: - Run the following command to publish configuration:
Configuration
- After installation, you will need to add your paypal settings. Following is the code you will find in config/paypal.php, which you should update accordingly.
Usage
Following are some ways through which you can access the paypal provider:
Override PayPal API Configuration
You can override PayPal API configuration by calling setApiCredentials
method:
Set Currency
By default the currency used is USD
. If you wish to change it, you may call setCurrency
method to set a different currency before calling any respective API methods:
Additional PayPal API Parameters
By default only a specific set of parameters are used for PayPal API calls. However, if you wish specify any other additional parameters you may call the addOptions
method before calling any respective API methods:
Warning: Any parameters should be referenced accordingly to the API call you will perform. For example, if you are performing SetExpressCheckout
, then you must provide the parameters as documented by PayPal for SetExpressCheckout
to addOptions
method.
Express Checkout
- SetExpressCheckout
- GetExpressCheckoutDetails
- DoExpressCheckoutPayment
- RefundTransaction
- CreateBillingAgreement
- CreateRecurringPaymentsProfile
- GetRecurringPaymentsProfileDetails
- UpdateRecurringPaymentsProfile
- ManageRecurringPaymentsProfileStatus
Adaptive Payments
To use adaptive payments, you must set the provider to use Adaptive Payments:
- Pay
Next, you need to redirect the user to PayPal to authorize the payment
Handling PayPal IPN
You can also handle Instant Payment Notifications from PayPal. Suppose you have set IPN URL to http://example.com/ipn/notify/ in PayPal. To handle IPN you should do the following:
-
First add the
ipn/notify
tp your routes file: -
Open
App\Http\Middleware\VerifyCsrfToken.php
and add your IPN route to$excluded
routes variable. - Write the following code in the function where you will parse IPN response:
Create Subscriptions
-
For example, you want to create a recurring subscriptions on paypal, first pass data to
SetExpressCheckout
API call in following format: - Next perform the remaining steps listed in
SetExpressCheckout
. - Next perform the exact steps listed in
GetExpressCheckoutDetails
. - Finally do the following for
CreateRecurringPaymentsProfile
Support
This plugin only supports Laravel 5.1 or greater.
- In case of any issues, kindly create one on the Issues section.
- If you would like to contribute:
- Fork this repository.
- Implement your features.
- Generate pull request.
All versions of paypal with dependencies
illuminate/support Version ~5.1|~5.2|~5.3|~5.4|~5.5
nesbot/carbon Version ~1.0