承接 epmnzava/paypal-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

epmnzava/paypal-laravel

最新稳定版本:1.7

Composer 安装命令:

composer require epmnzava/paypal-laravel

包简介

This is a laravel package for intergration with paypal

README 文档

README

Latest Version on Packagist Build Status Total Downloads Emmanuel Mnzava

This package is meant to help laravel developers to easily integrate their server side web application or web service with Paypal

alt text

Installation

Version Matrix

Version Laravel PHP Version
1.5 8.0 >= 8.0
1.3 8.0 >= 7.3
1.2 7.0 >= 7.2.5

You can install the package via composer:

composer require epmnzava/paypal-laravel

Update your config (for Laravel 5.4 and below)

Add the service provider to the providers array in config/app.php:

"Epmnzava\PaypalLaravel\PaypalLaravelServiceProvider"::class

Add the facade to the aliases array in config/app.php:

'Paypal'=>Epmnzava\PaypalLaravel\PaypalLaravelFacade::class,

Publish the package configuration (for Laravel 5.4 and below)

Publish the configuration file and migrations by running the provided console command:

php artisan vendor:publish --provider="Epmnzava\PaypalLaravel\PaypalLaravelServiceProvider"

Environmental Variables

PAYPAL_CLIENT_ID your provided paypal client id

PAYPAL_CLIENT_SECRET your provided paypal client secret

PAYPAL_REDIRECT_URL your redirect url

PAYPAL_CANCEL_URL your cancel url

PAYPAL_ENVIRONMENT your environment either test or production

PAYPAL_CURRENCY_CODE currency put TZS for Tanzanian Shillings

PAYPAL_ORG_NAME your organization name

Usage

<?php>
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Epmnzava\PaypalLaravel\PaypalLaravel as Paypal;
class TestController extends Controller
{
    



public function payments(Request $request){


$paypal_payments=new paypal;      
$response=$paypal_payments->CreatePayment(int $amount, $tax, $shipping, $handling_fee, $description);

// You will need the order_id to reference the transaction hence save it from here.
$payment_id=$response["order_id"]; 


//the checkout link will lead the user  you to paypal  where he/she can approve the payment.
return redirect($response["checkout_link"]);
    }

After payment approval the user will be redirected back to your application on PAYPAL_REDIRECT_URL which you have set on your .env

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Epmnzava\PaypalLaravel\PaypalLaravel as Paypal;
class TestController extends Controller
{
    


    public function paypal_redirect(Request $request){
      $paypal=new Paypal;

      // This will execute the approved payment notice that the redirected url comes back with PayerID which we reuse it
      $response=$paypal->executePayment($request->paymentId,$request->PayerID);

      if(json_decode($response)->state=="approved"){
// update your database and share the success message to the user.
      }



    }

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email epmnzava@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Any questions or comments hit me up on

统计信息

  • 总下载量: 829
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固