amsify42/paypal-masspayment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

amsify42/paypal-masspayment

最新稳定版本:1.0

Composer 安装命令:

composer require amsify42/paypal-masspayment

包简介

This is a laravel 5 package for simply executing mass payment of paypal

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Paypal Mass Payment for Laravel 5

This is a laravel 5 package only for PayPal Mass Payment.

Installation:

composer require amsify42/paypal-masspayment

[OR]
Add the PaypalMassPayment package to your composer.json file

{
    "require": {
        "amsify42/paypal-masspayment": "dev-master"
    }
}

Service Provider

In your app config, add the PaypalMassPaymentServiceProvider to the providers array.

'providers' => [
    'Amsify42\PaypalMassPayment\PaypalMassPaymentServiceProvider',
    ];

Facade (optional)

If you want to make use of the facade, add it to the aliases array in your app config.

'aliases' => [
    'PaypalMassPayment'	=> 'Amsify42\PaypalMassPayment\PaypalMassPaymentFacade',
    ];

Publish file

$ php artisan vendor:publish

Now file with name paypalmasspayment.php will be copied in directory Config/ and you can add your settings

For what to use in all the options available in this config file go to Using the Mass Payments API

Add this line at the top of any class to use PaypalMassPayment

use       PaypalMassPayment;

Array of payments looks something like this

For what parameters to use in payment array MassPay API Using NVP MassPay API Using SOAP

$receivers = array(
		  0 => array(
		    'ReceiverEmail' => "something@somewhere.com", 
		    'Amount'        => "0.01",
		    'UniqueId'      => "id_001", 
		    'Note'          => " Test Streammer 1"), 
		  1 => array(
		    'ReceiverEmail' => "something@somewhere.com",
		    'Amount'        => "0.01",
		    'UniqueId'      => "id_002", 
		    'Note'          => " Test Streammer 2"), 
		);
		
$response = PaypalMassPayment::executeMassPay('Some Subject', $receivers);

or you can directly call PaypalMassPayment without adding it at the top

$response = \PaypalMassPayment::executeMassPay('Some Subject', $receivers);

For response codes and errors visit MassPay Error Codes

Passing custom config at run time for particular object context

$config = [
    'authentication'    => 'api_signature',
    'environment'       => 'sandbox',
    'operation_type'    => 'nvp',
    'api_vesion'        => '51.0',
    'receiver_type'     => 'email',
    'currency'          => 'USD',
    'sandbox' => [
		        'api_username'    => 'random-facilitator_api1.gmail.com',
		        'api_password'    => 'FKJHS786JH3454',
		        'api_certificate' => '',
		        'api_signature'   => 'sdfrfsf3rds3435432545df3124dg34tDFG#$sG23rfSD3',
	   ],
    'live' => [
		       'api_username'    => '',
		       'api_password'    => '',
		       'api_certificate' => '',    
		       'api_signature'   => '',
		],
];
$payment    = PaypalMassPayment::setConfig($config);
$response   = $payment->executeMassPay('Some Subject', $receivers);

You can also pass just required keys to custom config

$config = [
    'environment'       => 'live',
    'live' => [
		       'api_username'    => '',
		       'api_password'    => '',
		       'api_certificate' => '',    
		       'api_signature'   => '',
		],
];
$payment    = PaypalMassPayment::setConfig($config);
$response   = $payment->executeMassPay('Some Subject', $receivers);

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固