承接 soliantconsulting/soliant-payment 相关项目开发

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

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

soliantconsulting/soliant-payment

Composer 安装命令:

composer require soliantconsulting/soliant-payment

包简介

Authoize.net XML API Library

README 文档

README

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads License

Quickstart

Installation

Via composer

{
    "require": {
        "soliantconsulting/soliant-payment": "^2.0.0" // ZF2 v1.0.1
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/goetas/serializer.git"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true
}

Usage

ZF3 v2.0.0

Add modules to modules.config.php

return [
    'Zend\Filter',
    'Zend\Hydrator',
    'Zend\Router',
    'Zend\Validator',
    'Soliant\Payment\Base',
    'Soliant\Payment\Authnet',
    'Soliant\Payment\Demo', // (Optional) Access demo via /soliant-payment route
];

ZF2 v1.0.1

Add modules to project config/application.config.php.

'modules' => [
    'Soliant\Payment\Base', // Required for all payment modules
    'Soliant\Payment\[Payment Module]', // Where "Payment Module" is one of the following ("Authnet")
    'Soliant\Payment\Demo', // Access demo via /soliant-payment route
 ],

Copy the local.php.dist file from the payment module config directory to the project autoload directory.

$ cp vendor/soliantconsulting/soliant-payment/module/[Payment Module]/[Payment Module].payment.local.php.dist 
config/autoload/[Payment Module].payment.local.php

Inject the desired payment service via factory using one of the following available aliases.

"authorizeAndCapture" // Authorize and capture credit card or eCheck

ZF3 v2.0.0

public function __invoke(ContainerInterface $sm)
{
    return new MyService($sm->get("[Service Alias]"));
}

ZF2 v1.0.1

public function createService(ServiceLocatorInterface $serviceLocator)
{
    return new MyService($serviceLocator->get("[Service Alias]"));
}

Each payment service should implement the following request structure. Request data is passed via array to the "sendRequest" method which returns a response object. (See the implemented payment modules payment.local.php.dist file for data array structure and info on overriding data field names. Ex. a link). The response object can be tested for success with the "isSuccess" method which returns a boolean response.

If the request was successful, any data returned from the requested service should be access via the "getData" method.
The "getMessages" method will be populated in the event the request was unsuccessful.

$response = $this->[Service Alias]->sendRequest([
    'paymentType' => 'creditCard',
    'amount' => '5.00',
    'expirationDate' => '2017-01',
    'cardNumber' => '4111111111111111'
]);

if ($response->isSuccess()) {
    // get the response data
    $data = $response->getData();
} else {
    // get the errors
    $errors = $response->getMessages();
}

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固