A bundle intending to seamlessly integrate to Chargify via their Api.
Installation and configuration requires three simple steps.
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"
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Litwicki\Bundle\ChargifyBundle\LitwickiChargifyBundle(),
);
// ...
}
}
# 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: ~
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 }
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.
//example load a Subscription by Id.
$id = 12345;
$handler = $this->get('chargify.handler.subscription');
$subscription = $handler->get($id);
//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);
Let's update the customer record we just created (example above).
//...
$customer->setFirstName('Jonathan');
$customer = $handler->put($customer);
We changed our mind, let's remove this customer.
$response = $handler->delete($customer);
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
- 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.
This bundle is open-sourced software licensed under the MIT license.