定制 ladela/paypal-adaptivepayments-sdk-php 二次开发

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

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

ladela/paypal-adaptivepayments-sdk-php

Composer 安装命令:

composer require ladela/paypal-adaptivepayments-sdk-php

包简介

Paypal PHP Adaptive Payments SDK

README 文档

README

Prerequisites

PayPal's PHP Adaptive Payments SDK requires

  • PHP 5.2 and above with curl/openssl extensions enabled

Using the SDK

To use the SDK,

  • Copy the config and lib folders into your project. Modify the config file to suit your needs.
  • Make sure that the lib folder in your project is available in PHP's include path
  • Include the services\AdaptivePayments\AdaptivePaymentsService.php file in your code.
  • Instantiate a service wrapper object
  • Instantiate a request object as per your project's needs. All the API request and response classes are available in services\AdaptivePayments\AdaptivePaymentsService.php
  • Invoke the appropriate method on the service object passing in the request object.

For example,

	require_once('services/AdaptivePayments/AdaptivePaymentsService.php');

    $payRequest = new PayRequest($requestEnvelope, $actionType, $cancelUrl, 
                                  $currencyCode, $receiverList, $returnUrl);
    // Add optional params
    if($_POST["feesPayer"] != "") {
	   $payRequest->feesPayer = $_POST["feesPayer"];
    }
	......

	$service = new AdaptivePaymentsService();
	$response = $service->Pay($payRequest);	
	$ack = strtoupper($response->responseEnvelope->ack); 
	if($ack == 'SUCCESS') {
		// Success
	}

The SDK provides multiple ways to authenticate your API call.

	$service = new AdaptivePaymentsService();
	
	// Use the default account (the first account) configured in sdk_config.ini
	$response = $service->Pay($payRequest);	

	// Use a specific account configured in sdk_config.inig
	$response = $service->Pay($payRequest, 'jb-us-seller_api1.paypal.com');	
	 
	// Pass in a dynamically created API credential object
    $cred = new PPCertificateCredential("username", "password", "path-to-pem-file");
    $cred->setThirdPartyAuthorization(new PPTokenAuthorization("accessToken", "tokenSecret"));
	$response = $service->Pay($payRequest, $cred);	

SDK Configuration

Replace the API credential in config/sdk_config.ini . You can use the configuration file to configure

  • (Multiple) API account credentials.
  • Service endpoint and other HTTP connection parameters
  • Logging

Please refer to the sample config file provided with this bundle.

Using multiple SDKs together

*copy the contents in 'lib/service/' to one of the SDKs *add the service endpoint to 'config/sdk_config.ini', for the endpoints refer the list below

Endpoint Configuration

*The list below specifies endpoints for different services, in SANDBOX and PRODUCTION, with their property keys and end-point as property values.

------------------------------SANDBOX------------------------------

------------------------------PRODUCTION------------------------------

For additional information please refer to https://www.x.com/developers/paypal/documentation-tools/api

Instant Payment Notification (IPN)

refer to the IPN-README in 'samples/IPN' directory

Getting help

If you need help using the SDK, a new feature that you need or have a issue to report, please visit

https://www.x.com/developers/paypal/forums/adaptive-payments-api

 OR

https://github.com/paypal/adaptivepayments-sdk-php/issues

ladela/paypal-adaptivepayments-sdk-php 适用场景与选型建议

ladela/paypal-adaptivepayments-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 121 次下载、GitHub Stars 达 3, 最近一次更新时间为 2013 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sdk」 「paypal」 「adaptive payments」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ladela/paypal-adaptivepayments-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ladela/paypal-adaptivepayments-sdk-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 ladela/paypal-adaptivepayments-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 68
  • 开发语言: PHP

其他信息

  • 授权协议: SDK
  • 更新时间: 2013-01-10