定制 open-pix/php-sdk 二次开发

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

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

open-pix/php-sdk

最新稳定版本:v1.1.4

Composer 安装命令:

composer require open-pix/php-sdk

包简介

PHP OpenPix/Woovi SDK

README 文档

README

PHP version Download stats Latest release CI status

Welcome to the OpenPix PHP SDK! This SDK provides convenient access to the OpenPix REST API, allowing you to easily integrate payment services into your PHP applications.

usage example screenshot

Documentation

See SDK documentation and Rest API documentation.

Installation

Install the SDK with the necessary dependencies using Composer:

$ composer require open-pix/php-sdk guzzlehttp/guzzle guzzlehttp/psr7

Basic usage

Here is the basic usage of the SDK. See SDK documentation for more details.

use OpenPix\PhpSdk\Client;

// Load autoload of Composer.
require_once __DIR__ . "/vendor/autoload.php";

$client = Client::create("YOUR_APP_ID");

// Create a customer.
$customer = [
    "name" => "Dan PHP-SDK",
    "taxID" => "00000000000", // CPF
    "email" => "email0@example.com",
    "phone" => "5511999999999",
    "correlationID" => "test-php-sdk-customer-" . mt_rand(1, 10000),
];

$client->customers()->create($customer);

// Create a charge using above customer.
$charge = [
    // Charge value.
    "value" => 1000, // (R$ 10,00)

    // Your correlation ID to keep track of this charge.
    "correlationID" => "test-php-sdk-charge-" . mt_rand(1, 10000),

    // Charge customer.
    "customer" => $customer,
];

$result = $client->charges()->create($charge);

// Get the generated dynamic BR code to be rendered as a QR Code.
echo $result["brCode"] . "\n";

Contributing

If you have suggestions for how OpenPix PHP SDK could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

OpenPix PHP SDK is distributed under the terms of the MIT license.

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-08