Coder Social home page Coder Social logo

omnipay-stripe's Introduction

Omnipay: Stripe

Stripe driver for the Omnipay PHP payment processing library

Build Status Latest Stable Version Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Stripe support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "omnipay/stripe": "~2.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

The following gateways are provided by this package:

For general usage instructions, please see the main Omnipay repository.

Stripe.js

The Stripe integration is fairly straight forward. Essentially you just pass a token field through to Stripe instead of the regular credit card data.

Start by following the standard Stripe JS guide here: https://stripe.com/docs/tutorials/forms

After that you will have a stripeToken field which will be submitted to your server. Simply pass this through to the gateway as token, instead of the usual card array:

        $token = $_POST['stripeToken'];

        $response = $gateway->purchase([
            'amount' => '10.00',
            'currency' => 'USD',
            'token' => $token,
        ])->send();

Stripe Connect

Stripe connect applications can charge an additional fee on top of Stripe's fees for charges they make on behalf of their users. To do this you need to specify an additional transactionFee parameter as part of an authorize or purchase request.

When a charge is refunded the transaction fee is refunded with an amount proportional to the amount of the charge refunded and by default this will come from your connected user's Stripe account effectively leaving them out of pocket. To refund from your (the applications) Stripe account instead you can pass a refundApplicationFee parameter with a boolean value of true as part of a refund request.

Note: making requests with Stripe Connect specific parameters can only be made using the OAuth access token you received as part of the authorization process. Read more on Stripe Connect here.

Test Mode

Stripe accounts have test-mode API keys as well as live-mode API keys. These keys can be active at the same time. Data created with test-mode credentials will never hit the credit card networks and will never cost anyone money.

Unlike some gateways, there is no test mode endpoint separate to the live mode endpoint, the Stripe API endpoint is the same for test and for live.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

omnipay-stripe's People

Contributors

aderuwe avatar amacneil avatar aperdomo avatar captainquirk avatar cfreear avatar delatbabel avatar dizda avatar drewm avatar gadelkareem avatar greydnls avatar kinglozzer avatar laoneo avatar philsturgeon avatar pilot avatar qlik avatar radarhere avatar ruudk avatar sudiptpa avatar tapha avatar w3guy avatar wellingguzman avatar

Watchers

 avatar  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.