Giter Site home page Giter Site logo

ec0g / bluesnap-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tdanielcox/bluesnap-php

0.0 0.0 0.0 33 KB

A Modern PHP Library for the Bluesnap API

Home Page: https://github.com/tdanielcox/bluesnap-php

License: MIT License

PHP 100.00%

bluesnap-php's Introduction

Bluesnap PHP Library

NOTE this library is not production ready as my company decided against using bluesnap shortly after starting this project. Please feel free to fork it and make it fit your needs, all endpoints are working as of June 2017, however the library is missing several features that bluesnap offers. Development and maintence on this project has been discontinued.


This (unofficial) library standardizes and simplifies working with the bluesnap api.

All the standard api documentation is applicable to this library.

View the bluesnap documentation here: https://developers.bluesnap.com/v8976-JSON/docs

This library currently supports:

  • CardTransactions
  • VaultedShoppers
  • Vendors
  • Subscriptions
  • Plans (Subscriptions)
  • Refunds
  • Reports

Installation

Install this package with composer

composer require tdanielcox/bluesnap-php

Usage

Initialize the library in your class constructor

public function __construct()
{
    $environment = 'sandbox'; // or 'production'
    \tdanielcox\Bluesnap\Bluesnap::init($environment, 'YOUR_API_KEY', 'YOUR_API_PASSWORD');
}

Create a New Transaction

public function createTransaction()
{
    $response = \tdanielcox\Bluesnap\CardTransaction::create([
        'creditCard' => [
            'cardNumber' => '4263982640269299',
            'expirationMonth' => '02',
            'expirationYear' => '2018',
            'securityCode' => '837'
        ],
        'amount' => 10.00,
        'currency' => 'USD',
        'recurringTransaction' => 'ECOMMERCE',
        'cardTransactionType' => 'AUTH_CAPTURE',
    ]);

    if ($response->failed())
    {
        $error = $response->data;
        
        // handle error
    }

    $transaction = $response->data;
    
    return $transaction;
}

See examples for further details on using the library

License

This package is licensed under the MIT License

bluesnap-php's People

Contributors

tdanielcox avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.