2017 © Pedro Peláez
 

library affirm-php

Affirm PHP Library

image

funnylookinhat/affirm-php

Affirm PHP Library

  • Tuesday, May 5, 2015
  • by funnylookinhat
  • Repository
  • 1 Watchers
  • 0 Stars
  • 671 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

affirm-php

Affirm PHP Library., (*1)

Current Version: 2.0.0, (*2)

Installation

You can install affirm-php through composer. Note that the version you request is directly tied to the version of the API it expects ( i.e. 2.x.x is for v2 of the API ). Extremely bleeding edge development is tagged at a prepended 0. - so the bleeding edge for v2 is 0.2.x.x., (*3)

{
  "require": {
    "funnylookinhat/affirm-php": "0.2.*"
  }
}

Usage

Right now there's only one API-endpoint for Affirm's service offering - charges. Coincidentally, there is only one major interaction class for this library., (*4)

Before anything, you have to initialize the library., (*5)

Affirm\Resource::Init(
    'public-key',
    'private-key',
    'product-key',
    'https://sandbox.affirm.com/api/v2'
);

Passing the URL is optional - as the library will default to the live API if nothing else is provided., (*6)

Charge

All end-points mirror the documented API: (http://docs.affirm.com/v2/api/charges/)[http://docs.affirm.com/v2/api/charges/] They return the decoded object that is documented there - in most cases that is a Charge ( or an Event that is appended to the Charge )., (*7)

Get, (*8)

$affirm_charge = Affirm\Resource::Get(array(
    'id' => "ASDF-HJKL",
));

Create, (*9)

$affirm_charge = Affirm\Resource::Create(array(
    'checkout_token' => "jibberjabber",
));

Capture, (*10)

$affirm_charge = Affirm\Resource::Capture(array(
    'id' => "ASDF-HJKL",
    'order_id' => "ASDF-HJKL",
    'shipping_carrier' => "UPS",
    'shipping_confirmation' => "1Z9999999999999999",
));

Void, (*11)

$affirm_event = Affirm\Resource::Void(array(
    'id' => "ASDF-HJKL",
));

Refund, (*12)

$affirm_event = Affirm\Resource::Refund(array(
    'id' => "ASDF-HJKL",
    'amount' => 12345,
));

The Versions

05/05 2015

dev-master

9999999-dev http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

05/05 2015

2.0.1

2.0.1.0 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

20/03 2015

2.0.0

2.0.0.0 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

20/03 2015

0.2.0.6

0.2.0.6 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

20/03 2015

0.2.0.5

0.2.0.5 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

20/03 2015

0.2.0.4

0.2.0.4 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm

19/03 2015

0.2.0.0

0.2.0.0 http://github.com/funnylookinhat/affirm-php

Affirm PHP Library

  Sources   Download

MIT

The Requires

 

by David Overcash

api library affirm