cardinity/client-bundle 问题修复 & 功能扩展

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

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

cardinity/client-bundle

最新稳定版本:v1.0.2

Composer 安装命令:

composer require cardinity/client-bundle

包简介

Cardinity Credit Card payments bundle for Symfony2

README 文档

README

Build Status Scrutinizer Code Quality SensioLabsInsight

Deprecation notice

This repository is deprecated.

Installation

Installing via Composer

$ php composer.phar require cardinity/client-bundle

Configuration

To use the bundle you have to define two parameters in your app/config/config.yml file under cardinity_client section

# app/config/config.yml
cardinity_client:
    consumer_key: key
    consumer_secret: secret

Where:

  • consumer_key: You can find your Consumer Key and Consumer Secret in Cardinity member’s area.
  • consumer_secret: You can find your Consumer Key and Consumer Secret in Cardinity member’s area.

Registering the Bundle

You have to add CardinityClientBundle to your AppKernel.php:

# app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ... other bundles
            new Cardinity\ClientBundle\CardinityClientBundle()
        );

        return $bundles;
    }
}

Enable credit card processing with 3-D secure DEMO

Include following lines to app/config/routing.yml:

cardinity_client:
    resource: "@CardinityClientBundle/Resources/config/routing.yml"
    prefix: /cardinity

And if you are using PHP built-in web server:

    app/console server:run

Try to open browser with address http://localhost:8000/cardinity.

Usage

Services

This bundle comes with following service which simplifies the Cardinity implementation in your project:

/** @type Cardinity\Client */
$client = $this->container->get('cardinity_client.service.client');

Available Methods

Validates and executes Cardinity query

/** @type Cardinity\Method\ResultObjectInterface
$result = $client->call($query);

Available Queries

Payment

Cardinity\Payment\Create($body)
Cardinity\Payment\Finalize($paymentId, $authorizeData)
Cardinity\Payment\Get($paymentId)
Cardinity\Payment\GetAll($limit)

Settlement

Cardinity\Settlement\Create($paymentId, $amount, $description = null)
Cardinity\Settlement\Get($paymentId, $settlementId)
Cardinity\Settlement\GetAll($paymentId)

Void

Cardinity\Void\Create($paymentId, $description = null)
Cardinity\Void\Get($paymentId, $voidId)
Cardinity\Void\GetAll($paymentId)

Refund

Cardinity\Refund\Create($paymentId, $amount, $description = null)
Cardinity\Refund\Get($paymentId, $refundId)
Cardinity\Refund\GetAll($paymentId)

Usage

use Cardinity\Method\Payment;

/** @type Cardinity\Client */
$client = $this->container->get('cardinity_client.service.client');
try {
    /** @type Payment\Payment */
    $payment = $client->call(new Payment\Create([
        'amount' => 50.00,
        'currency' => 'EUR',
        'settle' => false,
        'description' => 'some description',
        'order_id' => '12345678',
        'country' => 'LT',
        'payment_method' => Cardinity\Payment\Create::CARD,
        'payment_instrument' => [
            'pan' => '4111111111111111',
            'exp_year' => 2018,
            'exp_month' => 12,
            'cvc' => '456',
            'holder' => 'Mike Dough'
        ]
    ]));

    /** @type Payment\Payment */
    $finalizedPayment = $client->call(new Payment\Finalize(
        $payment->getId(),
        $payment->getAuthorizationInformation()->getData()
    ));
} catch (Cardinity\Exception\Declined $e) {
    // Payment has been declined
} catch (Cardinity\Exception\Runtime $e) {
    // Other type of error happened
}

More usage examples available at Cardinity PHP client repository.

Official API documentation can be found here.

cardinity/client-bundle 适用场景与选型建议

cardinity/client-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.73k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 cardinity/client-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cardinity/client-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 cardinity/client-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-13