2017 © Pedro Peláez
 

library cloudswipe-wp

CloudSwipe library for WordPress integrations

image

cloudswipe/cloudswipe-wp

CloudSwipe library for WordPress integrations

  • Tuesday, February 7, 2017
  • by joeybeninghove
  • Repository
  • 2 Watchers
  • 1 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

CloudSwipe WordPress Library

This library can be used to interact with the CloudSwipe API., (*1)

Requirements

Composer

You can install it via Composer. Run the following command:, (*2)

composer require cloudswipe/cloudswipe-wp

To use the bindings, use Composer's autoload:, (*3)

require_once('vendor/autoload.php');

Usage

Authentication

All API authentication is done using HTTP Authentication with the Secret Key available in your CloudSwipe account., (*4)

You can set the Secret Key for all requests like this:, (*5)

CloudSwipe_Wp::set_secret_key( "sk_store_12345" );

Invoices

Create New Invoice

// bare minimum invoice
$invoice = CloudSwipe_Wp_Invoice::create([
  "description" => "T-Shirt",
  "total" => 1995,
  "currency" => "USD"
]);

// more detailed invoice
$invoice = CloudSwipe_Wp_Invoice::create([
  "total" => 2705,
  "currency" => "USD",
  "customer" => [
    "name" => "Bud Abbott",
    "email" => "bud@abbott.com"
    "billing_address" => [
      "name" => "Bud Abbott",
      "company" => "Laugh Lines",
      "line1" => "123 Anystreet",
      "line2" => "Suite A",
      "city" => "Anytown",
      "state" => "VA",
      "zip" => "12345",
      "country" => "US",
      "phone" => "111-222-3333"
    ],
    "shipping_address" => [
      "name" => "Lou Costello",
      "company" => "Laugh Lines",
      "line1" => "456 Otherstreet",
      "line2" => "Suite Z",
      "city" => "Othertown",
      "state" => "VA",
      "zip" => "12345",
      "country" => "US",
      "phone" => "111-222-3333"
    ],
    "line_items" => [
      "header" => ["Item", "Description", "Quantity", "Total"],
      "rows" => [
        ["T-Shirt", "Small, Blue", 1, 1095],
        ["Mug", "Branded Coffee Mug", 2, 535]
      ]
    ],
    "line_totals" => [
      "rows" => [
        ["Discount" => 500],
        ["Tax" => 245],
        ["Shipping" => 795]
      ]
    ],
    "metadata" => [
      "some-custom-field" => "some-custom-value"
    ]
  ]
]);

Get A Single Invoice

$invoice = CloudSwipe_Wp_Invoice::get_one( "in_12345" );

Get All Invoices

$invoices = CloudSwipe_Wp_Invoice::get_all();

The Versions

07/02 2017

dev-master

9999999-dev

CloudSwipe library for WordPress integrations

  Sources   Download

MIT

The Requires

 

by Joey Beninghove

wordpress api json cloudswipe

07/02 2017

0.1.2

0.1.2.0

CloudSwipe library for WordPress integrations

  Sources   Download

MIT

The Requires

 

by Joey Beninghove

wordpress api json cloudswipe

07/02 2017

0.1.1

0.1.1.0

CloudSwipe library for WordPress integrations

  Sources   Download

MIT

The Requires

 

by Joey Beninghove

wordpress api json cloudswipe

07/02 2017

0.1

0.1.0.0

CloudSwipe library for WordPress integrations

  Sources   Download

MIT

The Requires

 

by Joey Beninghove

wordpress api json cloudswipe