承接 smart2pay/sdk-php 相关项目开发

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

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

smart2pay/sdk-php

Composer 安装命令:

composer require smart2pay/sdk-php

包简介

Smart2Pay SDK - enable payments on your site easily 200+ methods, 80+ countries

README 文档

README

NB: If you installed our SDK using composer, please read the note at the end of the file.

For quick information about available SDK methods and functionalities, please open {SDK directory}/play.php script in a browser (requires a web server).

For live demo of methods and functionalities available in current version of SDK, please open {SDK directory}/demo.php script in a browser (requires a web server).

Please note that in order to test a full end-to-end transaction you will require a valid Smart2Pay test account which you can obtain at https://www.smart2pay.com/en/SignUpStart. After you registered a test account, use API Key and Site ID found at Technical Integration > Integration Roadmap > Integration Site and configure your SDK by copying config.dist.php to config.php and fill in S2P_SDK_SITE_ID, S2P_SDK_API_KEY and S2P_SDK_ENVIRONMENT constants.

Creating your test merchant account

  1. Go to https://www.smart2pay.com/en/SignUpStart and complete the form. Make sure you tick the checkbox REST API interface to let system know you will integrate SDK solution. If you will also use any e-commerce plugins specify this by ticking plugins checkbox.
  2. Log into your account and go to Technical Integration > Integration Roadmap > Integration Site.
  3. You should use Site ID and API Ke
  4. y found on that page to fill constants in config.php of your test SDK environment.

Configuring your SDK

  1. Copy config.dist.php file located in root directory of your SDK to config.php and edit the file.

  2. Paste Site ID (from Technical Integration > Integration Roadmap > Integration Site) in constant definition S2P_SDK_SITE_ID like below:

        if( !defined( 'S2P_SDK_SITE_ID' ) )
            define( 'S2P_SDK_SITE_ID', 'SiteID_of_your_Integration_Site' );
  3. Paste API Key (from Technical Integration > Integration Roadmap > Integration Site) in constant definition S2P_SDK_API_KEY like below:

        if( !defined( 'S2P_SDK_API_KEY' ) )
            define( 'S2P_SDK_API_KEY', 'APIKey_of_your_Integration_Site' );
  4. Configure environment to test:

        if( !defined( 'S2P_SDK_ENVIRONMENT' ) )
            define( 'S2P_SDK_ENVIRONMENT', 'test' ); // live or test
  5. When environment is set to custom, you can provide a custom REST API base URL (used for debugging purposes). In production leave this empty:

        if( !defined( 'S2P_SDK_CUSTOM_BASE_URL' ) )
            define( 'S2P_SDK_CUSTOM_BASE_URL', '' );
  6. Setup return URL. This URL is the location where end-user will be redirected after a transaction finishes (successful or not):

        if( !defined( 'S2P_SDK_PAYMENT_RETURN_URL' ) )
            define( 'S2P_SDK_PAYMENT_RETURN_URL', 'https://www.myshop.com/sdk/samples/_return.php' );

Once all above steps are completed you can test a full end-to-end transaction and check log files generated.

demo.php script will generate logs when redirected back to return page in log_return.log and also for notifications in log_demo.log. Please make sure PHP has rights to create and write in these files located in root of SDK directory. If PHP doesn't have creation rights on SDK directory create these two log files first and give PHP write rights on them.

For quick samples on how you should implement SDK methods and functionalities please check samples directory.

Composer installs note

If you installed our SDK using composer and you don't want to create a custom config.php file, you will have to define S2P_SDK_SITE_ID, S2P_SDK_API_KEY and S2P_SDK_ENVIRONMENT constants in SDK wrapper script. Please check files in samples directory.

There were reports about composer deleting config.php file in SDK root dir when updating the SDK. To overcome this, you can define S2P_SDK_CONFIG_PATH constant in your wrapper script which contains directory where config.php file resides in your project.

smart2pay/sdk-php 适用场景与选型建议

smart2pay/sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20.83k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-07