承接 helios-api/helios-hpp-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

helios-api/helios-hpp-sdk

Composer 安装命令:

composer require helios-api/helios-hpp-sdk

包简介

Helios HPP payment system PHP SDK

关键字:

README 文档

README

NOTICE: This branch is under active development.

This repository contains the open source PHP SDK that allows you to access the Helios HPP from your PHP app. Documentation fo Helios API documentation.dp.ag.

Installation

The Helios HPP PHP SDK can be installed with Composer. Run this command:

composer require helios/helios-hpp-sdk

Usage

Note: This version of the Helios HPP SDK for PHP requires PHP 5.6 or greater.

Simple transaction registration example.

$heliosApp = new \HeliosHpp\HeliosHpp(['accountId' => '{account-id}', 'url' => '{helios-hpp-url}']);
$payment = new \HeliosHpp\Model\Payment('{account-id}', 'USD', 1000);

try {
    $createdPayment = $heliosApp->createPayment($payment);
} catch(\HeliosHpp\Exception\HeliosHppException $exception) {
    // When Helios HPP returns an error
    echo 'Helios HPP returned an error: ' . $exception->getMessage();
    exit;
} catch(\HeliosHpp\Exception\PaymentBodyException $exception) {
    // When Helios HPP returns invalid response
    echo 'Helios HPP returned invalid response: ' . $exception->getMessage();
    exit;
}

echo 'Payment Token ' . $createdPayment->getToken() 

WebHook registration.

$heliosApp = new \HeliosHpp\HeliosHpp(['accountId' => '{account-id}', 'url' => '{helios-hpp-url}']);

try {
    $paymentStatusChange = $heliosApp->registerWebHook();
} catch(\HeliosHpp\Exception\WebHookRequestException $exception) {
    // When Helios HPP call or payload is invalid
    echo 'Helios HPP called with invalid request: ' . $exception->getMessage();
    exit;
}

echo 'Payment Status event type' . $paymentStatusChange->getEventType(); 

Tests

  1. Composer is a prerequisite for running the tests. Install composer globally, then run composer install to install required files.
  2. The tests can be executed by running this command from the root directory:
$ ./vendor/bin/phpunit

By default the tests will send live HTTP requests to the Helios HPP server. If you are without an internet connection you can skip these tests by excluding the internet group.

$ ./vendor/bin/phpunit --exclude-group internet

License

Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固