PayPal is one of the most popular ways to sell / buy online things, in this article, we deeply examine how it works in Laravel Framework.
In this tutorial, we will create a request for demonstration for punctual and recurring payments with Paypal:
So let’s start!
Preparation and database
First of all, let’s create a new typical Laravel application
laravel new paypal-demo
Next – usual installation steps:
composer install cp .env.example .env (and then editing .env with credentials) php artisan key:generate php artisan migrate
In this case, we will also run PHP Artisan Make: Auth To have a little better visual theme.
Then, for this tutorial, we will use a package called Laravel-Paypal which has a great reputation for the community and is fully recommended, to avoid reinventing the wheel.
composer require srmklive/paypal
Then add a service provider to $ suppliers make Config / App.php (Not necessary for Laravel 5.5):
Srmklive\PayPal\Providers\PayPalServiceProvider::class
And publish the configuration:
php artisan vendor:publish --provider "Srmklive\PayPal\Providers\PayPalServiceProvider"
We must now configure our PayPal payment information in the.
PAYPAL_SANDBOX_API_USERNAME= PAYPAL_SANDBOX_API_PASSWORD= PAYPAL_SANDBOX_API_SECRET=
To do this, you need to connect to your dashboard.
Click on Sandbox accounts> in the menu.
Create new commercial accounts and buyers, so that we can “play” in the sandbox of our Paypal.

Click on your professional user and access Profile, then open the API Identials tab.

Fill your .G deposit
PAYPAL_SANDBOX_API_USERNAME=qa-facilitator_api1.quickadminpanel.com PAYPAL_SANDBOX_API_PASSWORD=JL6YMPSV3JJRPCUT PAYPAL_SANDBOX_API_SECRET=AFcWxV21C7fd0v3bYYYRCpSSRl31AsqWRQpDCA8YSkVq5GfjhMIjbsw4
Then let’s create a new Bill Model with its migration, so we have a place to store our payment information.
php artisan make:model Invoice --migration
Add fields to fill at Invoice.php model
protected $fillable = ['title', 'price', 'payment_status'];
To check if the invoice has been paid, let’s add a paying attribute
public function getPaidAttribute() {
if ($this->payment_status == 'Invalid') {
return false;
}
return true;
}
And our migration of the database looks like this:
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->double('price', 2);
$table->string('payment_status')->nullable();
$table->string('recurring_id')->nullable();
$table->timestamps();
});
}
Ok, we have finished with the database layer, let’s now go to visual things.
Itineraries, views and redirect to Paypal
Now we can create routes For our candidacy
Route::get('paypal/express-checkout', 'PaypalController@expressCheckout')->name('paypal.express-checkout');
Route::get('paypal/express-checkout-success', 'PaypalController@expressCheckoutSuccess');
Route::post('paypal/notify', 'PaypalController@notify');
For this application, we will have two buttons: one will represent a Single payment, the second will be a recurrent payment. Let’s create them in Resources / Views / Welcome.Blade.Php::
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
@if (Session::has('message'))
<div class="alert alert-{{ Session::get('code') }}">
<p>{{ Session::get('message') }}</p>
</div>
@endif
<div class="panel panel-default">
<div class="panel-heading">Express checkout</div>
<div class="panel-body">
Pay $20 via:
<a href=" route("paypal.express-checkout') }}" class="btn-info btn">PayPal</a>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Recurring payments</div>
<div class="panel-body">
Pay $20/month:
<a href=" route("paypal.express-checkout', ['recurring' => true]) }}" class="btn-info btn">PayPal</a>
</div>
</div>
</div>
</div>
</div>
@endsection

After creating routes and views, we have to make a ControllerTo manage all our payment logic.
php artisan make:controller PaypalController
The first thing our controller needs is a manufacturer’s method, so we can use our Laravel-Paypal package.
use Srmklive\PayPal\Services\ExpressCheckout;
protected $provider;
public function __construct() {
$this->provider = new ExpressCheckout();
}
Then we need our Expresscheckout Method, which will redirect the user to Paypal, so that he can approve the payment.
public function expressCheckout(Request $request) {
// check if payment is recurring
$recurring = $request->input('recurring', false) ? true : false;
// get new invoice id
$invoice_id = Invoice::count() + 1;
// Get the cart data
$cart = $this->getCart($recurring, $invoice_id);
// create new invoice
$invoice = new Invoice();
$invoice->title = $cart['invoice_description'];
$invoice->price = $cart['total'];
$invoice->save();
// send a request to paypal
// paypal should respond with an array of data
// the array should contain a link to paypal's payment system
$response = $this->provider->setExpressCheckout($cart, $recurring);
// if there is no link redirect back with error message
if (!$response['paypal_link']) {
return redirect('/')->with(['code' => 'danger', 'message' => 'Something went wrong with PayPal']);
// For the actual error message dump out $response and see what's in there
}
// redirect to paypal
// after payment is done paypal
// will redirect us back to $this->expressCheckoutSuccess
return redirect($response['paypal_link']);
}
At this point, we should take a look at the $ This-> Getcart () Method to discover the information that Paypal wishes to make a payment.
private function getCart($recurring, $invoice_id)
{
if ($recurring) {
return [
// if payment is recurring cart needs only one item
// with name, price and quantity
'items' => [
[
'name' => 'Monthly Subscription ' . config('paypal.invoice_prefix') . ' #' . $invoice_id,
'price' => 20,
'qty' => 1,
],
],
// return url is the url where PayPal returns after user confirmed the payment
'return_url' => url('/paypal/express-checkout-success?recurring=1'),
'subscription_desc' => 'Monthly Subscription ' . config('paypal.invoice_prefix') . ' #' . $invoice_id,
// every invoice id must be unique, else you'll get an error from paypal
'invoice_id' => config('paypal.invoice_prefix') . '_' . $invoice_id,
'invoice_description' => "Order #". $invoice_id ." Invoice",
'cancel_url' => url('/'),
// total is calculated by multiplying price with quantity of all cart items and then adding them up
// in this case total is 20 because price is 20 and quantity is 1
'total' => 20, // Total price of the cart
];
}
return [
// if payment is not recurring cart can have many items
// with name, price and quantity
'items' => [
[
'name' => 'Product 1',
'price' => 10,
'qty' => 1,
],
[
'name' => 'Product 2',
'price' => 5,
'qty' => 2,
],
],
// return url is the url where PayPal returns after user confirmed the payment
'return_url' => url('/paypal/express-checkout-success'),
// every invoice id must be unique, else you'll get an error from paypal
'invoice_id' => config('paypal.invoice_prefix') . '_' . $invoice_id,
'invoice_description' => "Order #" . $invoice_id . " Invoice",
'cancel_url' => url('/'),
// total is calculated by multiplying price with quantity of all cart items and then adding them up
// in this case total is 20 because Product 1 costs 10 (price 10 * quantity 1) and Product 2 costs 10 (price 5 * quantity 2)
'total' => 20,
];
}
So, we must first specify the articles of the basket. It may be certain products that have a name, a price and a quantity:
'items' => [
[
'name' => 'Product 1',
'price' => 10,
'qty' => 1,
],
[
'name' => 'Product 2',
'price' => 5,
'qty' => 2,
],
],
To return to our application after the user has confirmed the payment, Paypal needs a Return URL::
'return_url' => url('/paypal/express-checkout-success?recurring=1'),
Important: The return URL for recurring payment has a parameter recurrent = 1We need this parameter later, to create a recurring payment profile.
Each paypal transaction needs a invoice_id And invoice_description
'invoice_id' => config('paypal.invoice_prefix') . '_' . $invoice_id,
'invoice_description' => "Order #". $invoice_id ." Invoice",
And the last thing our basket needs is a total price of the basket
'total' => 20,
The total is calculated by multiplying each amount of element by its price, then by adding them. So, in our case, it should be (10 * 1) + (5 * 2) = 20.
Note: If the total of Cart is poorly calculated, Paypal will redirect you with an error and the payment will not be processed.
Transaction processing
Now that we have understood the cart that we can proceed to Expresscheckoutsuccess () method. This method is carried out when the user confirms payment in PayPal and is returned to our application.
public function expressCheckoutSuccess(Request $request) {
// check if payment is recurring
$recurring = $request->input('recurring', false) ? true : false;
$token = $request->get('token');
$PayerID = $request->get('PayerID');
// initaly we paypal redirects us back with a token
// but doesn't provice us any additional data
// so we use getExpressCheckoutDetails($token)
// to get the payment details
$response = $this->provider->getExpressCheckoutDetails($token);
// if response ACK value is not SUCCESS or SUCCESSWITHWARNING
// we return back with error
if (!in_array(strtoupper($response['ACK']), ['SUCCESS', 'SUCCESSWITHWARNING'])) {
return redirect('/')->with(['code' => 'danger', 'message' => 'Error processing PayPal payment']);
}
// invoice id is stored in INVNUM
// because we set our invoice to be xxxx_id
// we need to explode the string and get the second element of array
// witch will be the id of the invoice
$invoice_id = explode('_', $response['INVNUM'])[1];
// get cart data
$cart = $this->getCart($recurring, $invoice_id);
// check if our payment is recurring
if ($recurring === true) {
// if recurring then we need to create the subscription
// you can create monthly or yearly subscriptions
$response = $this->provider->createMonthlySubscription($response['TOKEN'], $response['AMT'], $cart['subscription_desc']);
$status="Invalid";
// if after creating the subscription paypal responds with activeprofile or pendingprofile
// we are good to go and we can set the status to Processed, else status stays Invalid
if (!empty($response['PROFILESTATUS']) && in_array($response['PROFILESTATUS'], ['ActiveProfile', 'PendingProfile'])) {
$status="Processed";
}
} else {
// if payment is not recurring just perform transaction on PayPal
// and get the payment status
$payment_status = $this->provider->doExpressCheckoutPayment($cart, $token, $PayerID);
$status = $payment_status['PAYMENTINFO_0_PAYMENTSTATUS'];
}
// find invoice by id
$invoice = Invoice::find($invoice_id);
// set invoice status
$invoice->payment_status = $status;
// if payment is recurring lets set a recurring id for latter use
if ($recurring === true) {
$invoice->recurring_id = $response['PROFILEID'];
}
// save the invoice
$invoice->save();
// App\Invoice has a paid attribute that returns true or false based on payment status
// so if paid is false return with error, else return with success message
if ($invoice->paid) {
return redirect('/')->with(['code' => 'success', 'message' => 'Order ' . $invoice->id . ' has been paid successfully!']);
}
return redirect('/')->with(['code' => 'danger', 'message' => 'Error processing PayPal payment for Order ' . $invoice->id . '!']);
}
Ok, so this method may seem large, but it’s quite simple.
1. Get PayPal information on payment
$response = $this->provider->getExpressCheckoutDetails($token);
2. Check if the payment has succeeded.
3. Then we check if the payment was recurrent or not?
Note: This parameter is not added by Paypal. We define this parameter in our return basket_url as recurrent = 1 If the payment was recurrent. So, if our payment was recurrent, we must create a user subscription profile, so he doesn’t need to pay us manually.
$response = $this->provider->createMonthlySubscription($response['TOKEN'], $response['AMT'], $cart['subscription_desc']);
4. Otherwise, treat payment.
$payment_status = $this->provider->doExpressCheckoutPayment($cart, $token, $PayerID);
5. Finally, we update our invoice and redirect the user to the home page.
At this point, you should be able to make your first test payment, Yay!
Simply access the home page of your applications and click on one of the buttons we have created. You should be redirected to Paypal.

Important: For Sandbox, you should here use the buyer account that we created earlier.

Hit Agree and continueAnd you should be redirected to your application with a message of success.

If you have made a recurring payment, you can check your buyer account in Paypal Sandbox to see if a recurring profile has been created. Simply access the settings> Payments> Manage pre-appliance payments and you should see the active subscription.

Note: You can also connect to your sales account in Paypal Sandbox.
Instant payment notifications
For the last part of this demo, we must manage the Paypal Ipns (Instant payment notification) which will be sent to our request to each payment cycle after the subscription.
Add this method to the controller
public function notify(Request $request)
{
// add _notify-validate cmd to request,
// we need that to validate with PayPal that it was realy
// PayPal who sent the request
$request->merge(['cmd' => '_notify-validate']);
$post = $request->all();
// send the data to PayPal for validation
$response = (string) $this->provider->verifyIPN($post);
//if PayPal responds with VERIFIED we are good to go
if ($response === 'VERIFIED') {
/**
This is the part of the code where you can process recurring payments as you like
in this case we will be checking for recurring_payment that was completed
if we find that data we create new invoice
*/
if ($post['txn_type'] == 'recurring_payment' && $post['payment_status'] == 'Completed') {
$invoice = new Invoice();
$invoice->title="Recurring payment";
$invoice->price = $post['amount'];
$invoice->payment_status="Completed";
$invoice->recurring_id = $post['recurring_payment_id'];
$invoice->save();
}
// I leave this code here so you can log IPN data if you want
// PayPal provides a lot of IPN data that you should save in real world scenarios
/*
$logFile="ipn_log_".Carbon::now()->format('Ymd_His').'.txt';
Storage::disk('local')->put($logFile, print_r($post, true));
*/
}
}
Once Paypal has sent a request to our request, we check the data published with Paypal and if the answer is “verified”, we can process the information
The only thing to do is go to Paypal sandbox then connect to your commercial account that we created at the start of this tutorial to go to Settings> My sales tools.

Go to Instant payment notificationsThen enter your application and check “Receive IPN messages (activated)”.

Recording the parameters and PayPal will send you recurrent payment notifications.
An interesting thing about Paypal is that you can test the IPNs in the console of your developers, but that you cannot test recurring payments!
So, if we want to test them, we must make simulations of recurring payments that were going to reach our information route.
To do this, simply add one more route
Route::get('/test', function() {
return view('test');
});
Create a new file Resources / views / test.blade.php And add a few forms for tests.
<!-- Profile Created -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="verify_sign" value="ASsJ54wcfEJZVuwOMU8vBNHZb1TpAf7F4PMLvKL2uni1hb11jdOgdd2V" />
<input type="hidden" name="period_type" value="Regular" />
<input type="hidden" name="payer_status" value="verified" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="tax" value="0.00" />
<input type="hidden" name="payer_email" value="sandbo_1204199080_biz@angelleye.com" />
<input type="hidden" name="first_name" value="Drew" />
<input type="hidden" name="receiver_email" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="payer_id" value="E7BTGVXBFSUAU" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="payer_business_name" value="Drew Angell's Test Store" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="amount_per_cycle" value="30.00" />
<input type="hidden" name="profile_status" value="Active" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="amount" value="30.00" />
<input type="hidden" name="outstanding_balance" value="0.00" />
<input type="hidden" name="recurring_payment_id" value="I-VYR2VN3XPVW4" />
<input type="hidden" name="product_name" value="The HALO Foundation Donation" />
<input type="hidden" name="ipn_track_id" value="348867a2b7815" />
<input type="submit" value="Send Profile Created"/> </form>
<!-- Payment Made -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="mc_gross" value="10.00" />
<input type="hidden" name="period_type" value=" Regular" />
<input type="hidden" name="outstanding_balance" value="0.00" />
<input type="hidden" name="next_payment_date" value="02:00:00 Dec 16, 2013 PST" />
<input type="hidden" name="protection_eligibility" value="Ineligible" />
<input type="hidden" name="payment_cycle" value="every 3 Months" />
<input type="hidden" name="tax" value="0.00" />
<input type="hidden" name="payer_id" value="3HMDJA96TEQN4" />
<input type="hidden" name="payment_date" value="05:19:33 Sep 16, 2013 PDT" />
<input type="hidden" name="payment_status" value="Completed" />
<input type="hidden" name="product_name" value="platypu subscription" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="recurring_payment_id" value="I-R52C41AGNEAP" />
<input type="hidden" name="first_name" value="test" />
<input type="hidden" name="mc_fee" value="0.64" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="amount_per_cycle" value="10.00" />
<input type="hidden" name="payer_status" value="unverified" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="business" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="verify_sign" value="A4QWarlQUU0cupDGeAi-McuvfslGA7lrbrWV735PGPsr3OKdTRFyJtOq" />
<input type="hidden" name="payer_email" value="test@domain.com" />
<input type="hidden" name="initial_payment_amount" value="0.00" />
<input type="hidden" name="profile_status" value="Active" />
<input type="hidden" name="amount" value="10.00" />
<input type="hidden" name="txn_id" value="34Y69196BK064583G" />
<input type="hidden" name="payment_type" value="instant" />
<input type="hidden" name="last_name" value="test" />
<input type="hidden" name="receiver_email" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="payment_fee" value="0.64" />
<input type="hidden" name="receiver_id" value="ATSCG2QMC9KAU" />
<input type="hidden" name="txn_type" value="recurring_payment" />
<input type="hidden" name="mc_currency" value="USD" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="receipt_id" value="1660-1430-7506-9911" />
<input type="hidden" name="transaction_subject" value="" />
<input type="hidden" name="payment_gross" value="10.00" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="time_created" value="07:54:24 Sep 05, 2013 PDT" />
<input type="hidden" name="ipn_track_id" value="efd4ee6ea4474" />
<input type="submit" value="Send Payment Made"/> </form>
<!-- Payment Skipped -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="payment_cycle" value="Monthly" />
<input type="hidden" name="txn_type" value="recurring_payment_skipped" />
<input type="hidden" name="last_name" value="Smith" />
<input type="hidden" name="next_payment_date" value="03:00:00 Sep 21, 2013 PDT" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="initial_payment_amount" value="0.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="time_created" value="19:42:33 Jan 11, 2013 PST" />
<input type="hidden" name="verify_sign" value="AcyQRlWufyrh0B6-n5swEgNB9oNJAkMm65cAu2bQLTevdnT2JnuIyDQO" />
<input type="hidden" name="period_type" value=" Regular" />
<input type="hidden" name="payer_status" value="unverified" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="tax" value="0.00" />
<input type="hidden" name="payer_email" value="tester@hey.com" />
<input type="hidden" name="first_name" value="working" />
<input type="hidden" name="receiver_email" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="payer_id" value="4ATNY663RDKJA" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="amount_per_cycle" value="10.00" />
<input type="hidden" name="profile_status" value="Active" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="amount" value="10.00" />
<input type="hidden" name="outstanding_balance" value="60.00" />
<input type="hidden" name="recurring_payment_id" value="I-LH2MJXG27TR6" />
<input type="hidden" name="product_name" value="Angell EYE Web Hosting" />
<input type="hidden" name="ipn_track_id" value="e3a52d6772d28" />
<input type="submit" value="Send Payment Skipped"/> </form>
<!-- Payment Failed -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="payment_cycle" value="every 4 Weeks" />
<input type="hidden" name="txn_type" value="recurring_payment_failed" />
<input type="hidden" name="last_name" value="Tester" />
<input type="hidden" name="next_payment_date" value="03:00:00 Oct 03, 2013 PDT" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="initial_payment_amount" value="0" />
<input type="hidden" name="currency_code" value="JPY" />
<input type="hidden" name="time_created" value="05:14:37 Aug 01, 2012 PDT" />
<input type="hidden" name="verify_sign" value="AOTn5qT2D05NGLBeQowuGwhI5kTFAIPV01VWay1FayueRmXhAYd2KLZp" />
<input type="hidden" name="period_type" value=" Regular" />
<input type="hidden" name="payer_status" value="unverified" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="payer_email" value="prachi@signyit.com" />
<input type="hidden" name="first_name" value="Ecaf" />
<input type="hidden" name="receiver_email" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="payer_id" value="VCLJR9E79V4KJ" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="shipping" value="0" />
<input type="hidden" name="amount_per_cycle" value="1" />
<input type="hidden" name="profile_status" value="Active" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="amount" value="1" />
<input type="hidden" name="outstanding_balance" value="1" />
<input type="hidden" name="recurring_payment_id" value="I-P90BX92X15DR" />
<input type="hidden" name="product_name" value="Welcome to the world of shopping where you get everything" />
<input type="hidden" name="ipn_track_id" value="ab99ea6823e24" />
<input type="submit" value="Send Payment Failed"/> </form>
<!-- Profile Suspended -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="payment_cycle" value="Monthly" />
<input type="hidden" name="txn_type" value="recurring_payment_suspended_due_to_max_failed_payment" />
<input type="hidden" name="last_name" value="Lang" />
<input type="hidden" name="next_payment_date" value="N/A" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="initial_payment_amount" value="4.90" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="time_created" value="13:45:44 Nov 04, 2010 PDT" />
<input type="hidden" name="verify_sign" value="A65EYvoNuupMDbNU-2RPi609XJ7LAQ8CzxOV03bR4.O-nKSYG9LjBf10" />
<input type="hidden" name="period_type" value=" Regular" />
<input type="hidden" name="payer_status" value="unverified" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="tax" value="0.00" />
<input type="hidden" name="payer_email" value="corey@angelleye.com" />
<input type="hidden" name="first_name" value="Corey" />
<input type="hidden" name="receiver_email" value="sandbo_1215254764_biz@angelleye.com" />
<input type="hidden" name="payer_id" value="HKHX3D32P9DXG" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="amount_per_cycle" value="29.95" />
<input type="hidden" name="profile_status" value="Suspended" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="amount" value="29.95" />
<input type="hidden" name="outstanding_balance" value="149.75" />
<input type="hidden" name="recurring_payment_id" value="I-Y0E6UC684RS4" />
<input type="hidden" name="product_name" value="Achieve Formulas 30 day supply, monthly." />
<input type="hidden" name="ipn_track_id" value="95c39c8a4b39d" />
<input type="submit" value="Send Profile Suspended"/> </form>
<!-- Profile Canceled -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="payment_cycle" value="Monthly" />
<input type="hidden" name="txn_type" value="recurring_payment_profile_cancel" />
<input type="hidden" name="last_name" value="Testerson" />
<input type="hidden" name="next_payment_date" value="N/A" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="initial_payment_amount" value="69.90" />
<input type="hidden" name="rp_invoice_id" value="4603" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="time_created" value="09:40:52 Feb 11, 2013 PST" />
<input type="hidden" name="verify_sign" value="AGiC06LknLf7LnPNSt03A0q0ajKiAZt35jsIvkcPn5dU7GtRl-ITAf5Q" />
<input type="hidden" name="period_type" value=" Regular" />
<input type="hidden" name="payer_status" value="verified" />
<input type="hidden" name="tax" value="0.00" />
<input type="hidden" name="payer_email" value="payer@email.com" />
<input type="hidden" name="first_name" value="Tester" />
<input type="hidden" name="receiver_email" value="sandbox@domain.com" />
<input type="hidden" name="payer_id" value="Q28888N" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="amount_per_cycle" value="1.95" />
<input type="hidden" name="profile_status" value="Cancelled" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.7" />
<input type="hidden" name="outstanding_balance" value="0.00" />
<input type="hidden" name="recurring_payment_id" value="I-553Y5PRWJ29F" />
<input type="hidden" name="product_name" value="USBSwiper Monthly Subscription" />
<input type="hidden" name="ipn_track_id" value="5ecdc90112398" />
<input type="submit" value="Send Profile Canceled"/> </form>
<!-- Recurring Payment Expired -->
<form target="_new" method="post" action="{{ url('/paypal/notify') }}">
<input type="hidden" name="payment_cycle" value="Monthly" />
<input type="hidden" name="txn_type" value="recurring_payment_expired" />
<input type="hidden" name="last_name" value="Testerson" />
<input type="hidden" name="next_payment_date" value="N/A" />
<input type="hidden" name="residence_country" value="US" />
<input type="hidden" name="initial_payment_amount" value="0.00"/>
<input type="hidden" name="rp_invoice_id" value="1580"/>
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="time_created" value="09:42:46 Jan 12, 2011 PST"/>
<input type="hidden" name="verify_sign" value="AbBIww12EQnvrHwYmd1wb98zYz53APIJHOa.GTV4C9Ef0HVE1FWBtxMP"/>
<input type="hidden" name="period_type" value=" Regular"/>
<input type="hidden" name="payer_status" value="unverified"/>
<input type="hidden" name="tax" value="0.00"/>
<input type="hidden" name="first_name" value="Tester" />
<input type="hidden" name="receiver_email" value="payments@domain.com" />
<input type="hidden" name="payer_id" value="R7J55555MN" />
<input type="hidden" name="product_type" value="1" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="amount_per_cycle" value="1.00" />
<input type="hidden" name="profile_status" value="Cancelled" />
<input type="hidden" name="charset" value="windows-1252" />
<input type="hidden" name="notify_version" value="3.0" />
<input type="hidden" name="amount" value="1.00" />
<input type="hidden" name="outstanding_balance" value="0.00" />
<input type="hidden" name="recurring_payment_id" value="I-M0555555RY" />
<input type="hidden" name="product_name" value="USBSwiper Rental Program" />
<input type="submit" value="Send Recurring Payment Expired"/> </form>
Now go to your applications /test Road and there will be all possible recurring payment calls available for your testing ends.
So that’s all! It was an overview of how you can use Paypal inside Laravel. Was it useful?
Find out more: