chico-rei/cielo-ecommerce-v3-php
最新稳定版本:2.0.0
Composer 安装命令:
composer require chico-rei/cielo-ecommerce-v3-php
包简介
chico-rei
关键字:
README 文档
README
This is a PHP client wrapper for Cielo e-Commerce v3.
Install
Via Composer
$ composer require chico-rei/cielo-ecommerce-v3-php "dev-master"
Requires PHP 7.4 or newer.
Features
- Create Payment
- Credit/Debit Card
- Wallet (Visa Checkout / Masterpass / Apple Pay / Samsung Pay)
- Boleto
- Eletronic Transfer
- Recurrent
- Update Payment
- Capture
- Void
- Recurrent Payment
- Query Payment
- By Payment ID
- By Order ID
- Query Card Bin
- Tokenize Card
- Fraud Analysis
- Velocity
- Zero Auth
- Silent Order Post
Usage
require 'path/to/vendor/autoload.php'; use \ChicoRei\Packages\Cielo\Cielo; use \ChicoRei\Packages\Cielo\Merchant; use \ChicoRei\Packages\Cielo\Util; $merchant = Merchant::create([ 'id' => 'Your_ID', 'key' => 'Your_KEY', ]); $cielo = new Cielo($merchant); // For sandbox use: new Cielo($merchant, true); try { $response = $cielo->sale()->create([ 'merchantOrderId' => '19800731', 'payment' => [ 'type' => 'CreditCard', 'amount' => 15700, // 157,00 'installments' => 2, 'softDescriptor' => 'Your Company', 'capture' => true, 'creditCard' => [ 'cardNumber' => '4551870000000000', 'holder' => 'Name', 'expirationDate' => '12/2021', 'securityCode' => '123', 'brand' => 'Visa' ] ] ]); echo $response->getPayment()->getStatus(); // Transaction Status Code $returnCode = $response->getPayment()->getReturnCode(); // Ex: '00' $details = Util::getReturnCodeDetails($returnCode); echo $details['definition']; // Transação autorizada com sucesso. } catch (CieloAPIException $e) { // Handle API errors (or validation errors) } catch (Exception $e) { // Handle exceptions }
See examples for more.
Testing
$ composer test
Credits
Project based on DeveloperCielo/API-3.0-PHP
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 13.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-05