thecodingcompany/laravel-paypal-light 问题修复 & 功能扩展

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

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

thecodingcompany/laravel-paypal-light

Composer 安装命令:

composer require thecodingcompany/laravel-paypal-light

包简介

Laravel PayPal Light library for Google App Engine. This library does NOT require Curl.

README 文档

README

Laravel PayPal Light library for Google App Engine

Installation using Composer

composer require thecodingcompany/laravel-paypal-light

Examples

Create Payment Example

require_once __DIR__.'/src/PayPalLight/HttpRequest.php';
require_once __DIR__.'/src/PayPalLight/PayPalLight.php';
require_once __DIR__.'/src/PayPalLight/PayPalPayment.php';
require_once __DIR__.'/src/PayPalLight/CreditCardPayment.php';
require_once __DIR__.'/src/PayPalLight/PayPalTransaction.php';

use CodingCompany\PayPal\PayPalPayment as PayPalPayment;
use CodingCompany\PayPal\PayPalTransaction as PayPalTransaction;

$p = new PayPalPayment(array(
    'client_id'         => 'AddMFxCjj3QgJZT4kYgrgegbfdbgthre9Qj24o_P8Ldag7yeu2A',
    'client_secret'     => 'EFNXQgBjL9PQO0ZeuC5_4567547y6htet5ert34435_tct4nFU7g'
));

$p->set_endpoint("https://api.paypal.com");

$transaction = new PayPalTransaction();
$transaction->amount = array(
    "total" => "1.00",
    "currency" => "USD"
);
$transaction->description = "PayPal transaction";
$p->set_transaction($transaction);

$p->set_return_url("http://localhost:8000/paypal/callback");
$p->set_cancel_url("http://localhost:8000/paypal/cancel");

$response = $p->authorize_payment();

User wil be routed to PayPal to authorize the payment. After that the user will be redirected to the 'RETURN' URL supplied.

Authorize Payment Example

require_once __DIR__.'/src/PayPalLight/HttpRequest.php';
require_once __DIR__.'/src/PayPalLight/PayPalLight.php';
require_once __DIR__.'/src/PayPalLight/PayPalPayment.php';
require_once __DIR__.'/src/PayPalLight/CreditCardPayment.php';
require_once __DIR__.'/src/PayPalLight/PayPalTransaction.php';

use CodingCompany\PayPal\PayPalPayment as PayPalPayment;
use CodingCompany\PayPal\PayPalTransaction as PayPalTransaction;

$p = new PayPalPayment(array(
    'client_id'         => 'AddMFxCjj3QgJZT4kYgrgegbfdbgthre9Qj24o_P8Ldag7yeu2A',
    'client_secret'     => 'EFNXQgBjL9PQO0ZeuC5_4567547y6htet5ert34435_tct4nFU7g'
));

$p->set_endpoint("https://api.paypal.com");

$response = $p->execute_payment(array(
    "paymentId" => "PAY-554",
    "token" => "EC-45645",
    "PayerID" => "455454"
));

$response looks like:

Array ( [id] => PAY-554 [intent] => sale [state] => approved [cart] => 10E457GK130324L [payer] => Array ( [payment_method] => paypal etc etc etc ) )

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固