All Projects → srmklive → Laravel Paypal

srmklive / Laravel Paypal

Licence: mit
Laravel plugin for processing payments through PayPal. Can be used separately.

Labels

Projects that are alternatives of or similar to Laravel Paypal

crowdfunding-backend
[DEPRECATED] A crowdfunding backend written with NodeJS, Apollo and PostgreSQL. Features an extensive data model, mult. payment integrations, passwordless auth, statistics and admin endpoints.
Stars: ✭ 23 (-96.5%)
Mutual labels:  paypal
react-smart-payment-buttons
React integration for PayPal Smart Payment Buttons
Stars: ✭ 18 (-97.26%)
Mutual labels:  paypal
Blacklist
Blacklist and Adware Blocking for the Ubiquiti EdgeMax Router
Stars: ✭ 393 (-40.27%)
Mutual labels:  paypal
PayumYiiExtension
Rich payment solutions for Yii framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Stars: ✭ 13 (-98.02%)
Mutual labels:  paypal
Nest-Js-Boiler-Plate
Nest Js Boilerplate with JWT authentication, CRUD functions and payment gateways.
Stars: ✭ 14 (-97.87%)
Mutual labels:  paypal
fiber-boilerplate
This is the go boilerplate on the top of fiber web framework. With simple setup you can use many features out of the box
Stars: ✭ 184 (-72.04%)
Mutual labels:  paypal
wp-ispconfig3
Wordpress ISPConfig plugin with Gutenberg support
Stars: ✭ 28 (-95.74%)
Mutual labels:  paypal
Django Payments
Universal payment handling for Django.
Stars: ✭ 575 (-12.61%)
Mutual labels:  paypal
XLsn0wPay
XLsn0w WeChat And Alipay SDK Pay Manager 微信支付SDK/支付宝SDK/银联支付/Paypal支付 接入指南(一键支付管理工具类)
Stars: ✭ 31 (-95.29%)
Mutual labels:  paypal
Digota
ecommerce microservice
Stars: ✭ 382 (-41.95%)
Mutual labels:  paypal
Cartkit
Cartkit - The [quick] starter kit!
Stars: ✭ 39 (-94.07%)
Mutual labels:  paypal
django ecommerce
Scalable Django E-Commerce, perfect to start one new online shop project.
Stars: ✭ 25 (-96.2%)
Mutual labels:  paypal
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (+417.48%)
Mutual labels:  paypal
procesa-pagos-con-laravel
Código fuente resultado del curso "Procesa pagos con Laravel y las mejores plataformas de pagos"
Stars: ✭ 38 (-94.22%)
Mutual labels:  paypal
Braintree ios
Braintree SDK for iOS
Stars: ✭ 469 (-28.72%)
Mutual labels:  paypal
Apollo
A basic Application with multiple functionalities built with FastAPI aim to help Users Buy New Items Provided using PaypalAPI 🚀
Stars: ✭ 22 (-96.66%)
Mutual labels:  paypal
solidus braintree
Braintree v.zero support for solidus
Stars: ✭ 19 (-97.11%)
Mutual labels:  paypal
Django Paypal
A pluggable Django application for integrating PayPal Payments Standard or Payments Pro
Stars: ✭ 602 (-8.51%)
Mutual labels:  paypal
Qrpay
五合一收款码在线生成,40个模板 支持微信支付、支付宝支付、手机QQ支付、京东钱包、百度钱包,PayPal五合一收款,将其二维码合并为一个二维码,无需手续费,支持qq头像,昵称判断(HTML单页版多模板免安装) 腾讯云服务器 https://api.isoyu.com/qrpay/ 腾讯云COS https://qrpay.isoyu.com/
Stars: ✭ 477 (-27.51%)
Mutual labels:  paypal
Yclas
Yclas Self Hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few seconds.
Stars: ✭ 276 (-58.05%)
Mutual labels:  paypal

Laravel PayPal

Software License Latest Version on Packagist Total Downloads StyleCI Tests Coverage Status Code Quality

Introduction

By using this plugin you can process or refund payments and handle IPN (Instant Payment Notification) from PayPal in your Laravel application.

This plugin supports the new paypal rest api.

PayPal API Credentials

This package uses the new paypal rest api. Refer to this link on how to create API credentials:

https://developer.paypal.com/docs/api/overview/

Installation

  • Use following command to install:

If you intend to use ExpressCheckout, please to the following README. v2.0 & v3.0 uses the new rest api.

composer require srmklive/paypal:~3.0

To use this package for Laravel 5.1 to 5.8 use the following commands

composer require srmklive/paypal:~2.0
  • Run the following command to publish configuration:
php artisan vendor:publish --provider "Srmklive\PayPal\Providers\PayPalServiceProvider"

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.
return [
    'mode'    => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used.
    'sandbox' => [
        'client_id'         => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_SANDBOX_CLIENT_SECRET', ''),
        'app_id'            => 'APP-80W284485P519543T',
    ],
    'live' => [
        'client_id'         => env('PAYPAL_LIVE_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_LIVE_CLIENT_SECRET', ''),
        'app_id'            => '',
    ],

    'payment_action' => env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order'
    'currency'       => env('PAYPAL_CURRENCY', 'USD'),
    'notify_url'     => env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application.
    'locale'         => env('PAYPAL_LOCALE', 'en_US'), // force gateway language  i.e. it_IT, es_ES, en_US ... (for express checkout only)
    'validate_ssl'   => env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client.
];
  • Add this to .env.example and .env
#PayPal Setting & API Credentials - sandbox
PAYPAL_SANDBOX_CLIENT_ID=
PAYPAL_SANDBOX_CLIENT_SECRET=

#PayPal Setting & API Credentials - live
PAYPAL_LIVE_CLIENT_ID=
PAYPAL_LIVE_CLIENT_SECRET=

Usage

Following are some ways through which you can access the paypal provider:

// Import the class namespaces first, before using it directly
use Srmklive\PayPal\Services\PayPal as PayPalClient;

$provider = new PayPalClient;

// Through facade. No need to import namespaces
$provider = PayPal::setProvider();

Override PayPal API Configuration

You can override PayPal API configuration by calling setApiCredentials method:

$provider->setApiCredentials($config);

Get Access Token

After setting the PayPal API configuration by calling setApiCredentials method. You need to get access token before performing any API calls

$provider->getAccessToken();

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:

$provider->setCurrency('EUR');

Initiating an order for Checkout

Use the createOrder method to initiate an order

$provider->createOrder([
  "intent"=> "CAPTURE",
  "purchase_units"=> [
      "amount"=> [
        "currency_code"=> "USD",
        "value"=? "100.00"
      ]
  ]
]);

The response from this will include an order ID which you will need to retail, and a links collection so you can direct the user to Paypal to complete the order with their payment details

When the user returns to the notifcation url you can capture the order payment with

$provider->capturePaymentOrder($order_id); //order id from the createOrder step 

Support

This version supports Laravel 6 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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].