定制 vatps/paypal-rest-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vatps/paypal-rest-api

Composer 安装命令:

composer require vatps/paypal-rest-api

包简介

Very Easy to use PayPal REST API Wrapper Class.

README 文档

README

Very Easy to use PayPal REST Enabled API Wrapper Class in PHP.

Requires PHP 5.4 and curl extension.

Installation

You can install the paypal-rest-api using Composer. Just add the following to your composer.json:

{
    "require": {
        "vatps/paypal-rest-api": "dev-master"
    }
}

You will then need to:

  • run composer install to get these dependencies added to your vendor directory
  • add the autoloader to your application with this line: require("vendor/autoload.php")

Alternatively you can just download the PayPal.php file and include it manually.

Laravel Installation

Run composer require vatps/paypal-rest-api in terminal.

Code Example (Create a Payment)

<?php
use \VPS\PayPal;

$client_id = 'ATTUpBCpxG7h9PLUpENHKmhMiJsZqsJ-4tib0_oflCL9WFs8enQEGOxxIGZJ';
$client_secret = 'EM9xPhC2KJUiIoZ3l6965T0b7_X5QQX035JJfc9ijHtMKn4bGmE_qyTR45A9';
$sandbox = true;										

$pp = new PayPal($client_id, $client_secret, $sandbox);

$data = array(
	'intent' => 'sale',
	'payer' => array(
		'payment_method' => 'paypal'
	),
	'transactions' => array(
		array(
			'amount' => array(
				'total' => '9.99',
				'currency' => 'USD'
			),
			'description' => 'Demo Request'
		)
	),
	'redirect_urls' => array(
		'return_url' => 'http://mydomain.dev/return.php',
		'cancel_url' => 'http://mydomain.dev/cancel.php'
	)
);

$request = $pp->post('/v1/payments/payment', $data);

var_dump($request);

You can find all available API operations at https://developer.paypal.com/docs/api/

Contact me if you need any help.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固