定制 gomzyakov/payture 二次开发

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

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

gomzyakov/payture

最新稳定版本:v0.5.0

Composer 安装命令:

composer require gomzyakov/payture

包简介

PHP client for Payture InPay API

README 文档

README

Simple PHP client for Payture InPay API.

InPay is an easy way to accept payments without saving cards. Customer’s card details are entered at Payture gateway web page and all required data security is provided by Payture, saving Merchant efforts and expenses related to card information protection.

codecov

Installation

composer require gomzyakov/payture

Usage

<?php

$configuration = new \Gomzyakov\Payture\TerminalConfiguration(
    'MerchantKey',
    'MerchantPassword',
    'https://sandbox.payture.com/'
);

$transport = new \Gomzyakov\Payture\GuzzleHttp\GuzzleHttpPaytureTransport(
    new \GuzzleHttp\Client(),
    $configuration
);

$terminal = new \Gomzyakov\Payture\PaytureInPayTerminal($configuration, $transport);

$terminal->charge('ORDER_NUMBER_123', 100500);

Tuning

Client configuration

You can pass 3-rd argument to the GuzzleHttpPaytureTransport with the instance of \Gomzyakov\Payture\GuzzleHttp\GuzzleHttpOptionsBag. Instance is preconfigured with guzzle \GuzzleHttp\RequestOptions both global (first constructor argument) and per-operation (second constructor argument indexed by operation name)

Logging

You can pass 4-th argument to the GuzzleHttpPaytureTransport with instance of PSR-3 LoggerInterface in order to log operations with parameters.

Also you can configure generic Guzzle logging middleware.

Testing

vendor/bin/phpunit -c phpunit.xml

You can test this library against your own test terminal providing PAYTURE_TEST_MERCHANT_KEY and PAYTURE_TEST_MERCHANT_PASSWORD environment variables while running the tests.

 PAYTURE_TEST_MERCHANT_KEY=MerchantKey \
 PAYTURE_TEST_MERCHANT_PASSWORD=MerchantPassword \
 vendor/bin/phpunit -c phpunit.xml

These test will run order processing sequence against payture sandbox.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-04