perfectpanel/extlib-checkout-sdk-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

perfectpanel/extlib-checkout-sdk-php

Composer 安装命令:

composer require perfectpanel/extlib-checkout-sdk-php

包简介

Checkout.com SDK for PHP

README 文档

README

The Checkout SDK for PHP enables developers to easily work with Checkout.com APIs. It requires PHP 5.6.

Getting Help

If you encounter a bug with Checkout SDK for PHP please search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. The GitHub issues are intended for bug reports and feature requests. For help and questions with using Checkout SDK for PHP please contact our integration support team.

For full usage details, see the Wiki.

Installation

Installation with Composer (Recommended)

Either run the following command in the root directory of your project:

composer require checkout/checkout-sdk-php

Or require the Checkout.com package inside the composer.json file of your project:

"require": { "php": ">=5.6", "perfectpanel/extlib-checkout-sdk-php": "1.0.0"}.

Clone repository

Alternatively you can clone the repository from GitHub with git clone

git clone git@github.com:checkout/checkout-sdk-php.git

Quickstart

A card token can be obtained using one of Checkout.com's JavaScript frontend solutions such as Frames or any of the mobile SDKs

Include a checkout-sdk-php/checkout.php to access the operations for each API:

use perfectpanel\Checkout\CheckoutApi;
use perfectpanel\Checkout\Models\Tokens\Card;
use perfectpanel\Checkout\Models\Payments\TokenSource;
use perfectpanel\Checkout\Models\Payments\Payment;

// Set the secret key
$secretKey = 'sk_test_key';

// Initialize the Checkout API
$checkout = new CheckoutApi($secretKey);


// Create a payment method instance with card details
$method = new TokenSource('tok_key_goes_here');

// Prepare the payment parameters
$payment = new Payment($method, 'GBP');
$payment->amount = 1000; // = 10.00

// Send the request and retrieve the response
$response = $checkout->payments()->request($payment);

Tests

Install PHPUnit by running composer require --dev phpunit/phpunit and execute the tests with ./vendor/bin/phpunit.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-01