定制 litwicki/chargify-bundle 二次开发

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

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

litwicki/chargify-bundle

Composer 安装命令:

composer require litwicki/chargify-bundle

包简介

Chargify billing service integration

README 文档

README

A bundle intending to seamlessly integrate to Chargify via their Api.

Development Status Seeking Maintainers License Symfony PHP

Build Accessibility Simplicity Bugs

Setup

Installation and configuration requires three simple steps.

1. Download the bundle

IMPORTANT While in early development, you will need to set your minimum-stability to dev-master to use this bundle.

$ composer require "litwicki/chargify-bundle"

2. Enable the bundle

// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Litwicki\Bundle\ChargifyBundle\LitwickiChargifyBundle(),
        );

        // ...
    }
}

3. Configure the bundle

# app/config/config.yml
litwicki_chargify:
    test_mode: false
    data_format: json
    route_prefix: /chargify
    domain: ~
    api_key: ~
    shared_key: ~

Optionally, you can include integration for Chargify Direct (API V2)

# app/config/config.yml
litwicki_chargify:
    # ...
    direct:
        api_id: ~
        api_secret: ~
        api_password: ~

4. Serialization

Serialization is required to process Objects with the API so you will need to make sure you have enabled the serializer.

If not, you can do that by following these instructions

# app/config/config.yml
framework:
    # ...
    serializer:
        enabled: true

# app/config/services.yml
services:
    # ...
    get_set_method_normalizer:
        class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
        tags:
            - { name: serializer.normalizer }

Usage

This Bundle functions as a middle-tier layer between your Symfony app and Chargify. The handler for each entity leverages the available RESTful operations available.

Please make sure to reference the Chargify Api Docs for available parameters for each object.

GET - Find an object.

//example load a Subscription by Id.
$id = 12345;
$handler = $this->get('chargify.handler.subscription');
$subscription = $handler->get($id);

POST - Create a new object.

//let's create an example customer
$data = array(
    'first_name' => 'John',
    'last_name' => 'Doe',
    'email' => 'john.doe@example.com'
);

$handler = $this->get('chargify.handler.customer');
$customer = $handler->post($data);

PUT - Updating an existing object.

Let's update the customer record we just created (example above).

//...
$customer->setFirstName('Jonathan');
$customer = $handler->put($customer);

DELETE - Remove an object.

We changed our mind, let's remove this customer.

$response = $handler->delete($customer);

Contributing

Thank you for considering contributing to this bundle! This bundle is in early development and is actively seeking maintainers.

I am particularly interested in help with the following:

  • Testing all the things
  • Identityfing and patching any security issues
  • Ongoing support and improvements

Work-In-Progress Items:

  • Develop v2 API layer (handlers) for handling calls, signups, and card updates
  • Force all submissions to pass through Form validation
  • Setup serialization groups so read_only fields aren't submitted via POST or PUT when serializing a full entity.

License

This bundle is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-07