incevio/cybersource-wrapper
Composer 安装命令:
composer require incevio/cybersource-wrapper
包简介
This is a simple cybersource wrapper
README 文档
README
This package wraps the Cybersource Secure Acceptance REST API in a convenient, easy to use package for Laravel.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Requirements
- PHP 5.6+
- Enable cURL PHP Extension
- Enable JSON PHP Extension
- Enable PHP_APCU PHP Extension. You will need to download it for your platform (Windows/Linux/Mac)
- CyberSource Account
- CyberSource API Keys
Installation
composer require incevio/cybersource-wrapper
If you use laravel < 5.5 you must add this to config\app.php
Providers Array
Incevio\Cybersource\Providers\CybersourceServiceProvider::class
Facade Array
"CybersourcePayments" => Incevio\Cybersource\Facades\CybersourcePaymentsFacade::class
Publishing Configuration
php artisan vendor:publish --tag=cybersource-config-file
To set your own sandbox credentials for an API request, configure the following information in cybersource_config.php file:
- Http
$this->authType = "http_signature"; $this->merchantID = "your_merchant_id"; $this->apiKeyID = "your_key_serial_number"; $this->screteKey = "your_shared_secret";
- Jwt
$this->authType = "jwt"; $this->merchantID = "your_merchant_id"; $this->keyAlias = "your_merchant_id"; $this->keyPass = "your_merchant_id"; $this->keyFilename = "your_merchant_id";
Switching between the sandbox environment and the production environment
CyberSource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the appropriate environment constant. For example:
// For TESTING use $this->runEnv = "cyberSource.environment.SANDBOX"; // For PRODUCTION use $this->runEnv = "cyberSource.environment.PRODUCTION";
The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.
Usage REST API Payments
Example usage using Facade:
$cliRefInfoArr = [
"code" => "test_payment"
];
$amountDetailsArr = [
"totalAmount" => "102.21",
"currency" => "USD"
];
$billtoArr = [
"firstName" => "John",
"lastName" => "Doe",
"address1" => "1 Market St",
"postalCode" => "94105",
"locality" => "san francisco",
"administrativeArea" => "CA",
"country" => "US",
"phoneNumber" => "4158880000",
"company" => "ABC Company",
"email" => "test@cybs.com"
];
$paymentCardInfo = [
"expirationYear" => "2031",
"number" => "4111111111111111",
"securityCode" => "123",
"expirationMonth" => "12"
];
$response = $response = CybersourcePayments::processPayment($cliRefInfoArr, $amountDetailsArr, $billtoArr, $paymentCardInfo, "true");
Developed By
- Incevio - Web Development Team - www.incevio.com
License
This project is licensed under the MIT License
incevio/cybersource-wrapper 适用场景与选型建议
incevio/cybersource-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.28k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 03 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 incevio/cybersource-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 incevio/cybersource-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-29