Giter Site home page Giter Site logo

stripe-provider's Introduction

Vapor Stripe Provider

Swift Vapor CircleCI

Stripe is a payment platform that handles credit cards, bitcoin and ACH transfers. They have become one of the best platforms for handling payments for projects, services or products.

Getting Started

In your Package.swift file, add the following

.package(url: "https://github.com/vapor-community/stripe-provider.git", from: "2.0.0")

Register the config and the provider to your Application

let config = StripeConfig(apiKey: "sk_12345678")

services.register(config)

try services.register(StripeProvider())

app = try Application(services: services)

stripeClient = try app.make(StripeClient.self)

And you are all set. Interacting with the API is quite easy and adopts the Future syntax used in Vapor 3. Making calls to the api is straight forward.

let cardParams = ["exp_month": 1,
                  "exp_year": 2030,
                  "number": "4242424242424242",
                  "cvc": 123,
                  "object": "card"]

let futureCharge = try stripeClient.charge.create(amount: 2500, currency: .usd, source: cardParams)

futureCharge.do({ (charge) in
    // do something with charge object...
}).catch({ (error) in
    print(error)
})

And you can always check the documentation to see the required paramaters for specific API calls.

Whats Implemented

Core Resources

  • Balance
  • Charges
  • Customers
  • Disputes
  • Events
  • File Uploads
  • Payouts
  • Refunds
  • Tokens

Payment Methods

  • Bank Accounts
  • Cards
  • Sources

Subscriptions

  • Coupons
  • Discounts
  • Invoices
  • Invoice Items
  • Plans
  • Subscriptions
  • Subscription items

Connect

  • Account
  • Application Fee Refunds
  • Application Fees
  • Country Specs
  • External Accounts
  • Transfers
  • Transfer Reversals

Relay

  • Orders
  • Order Items
  • Products
  • Returns
  • SKUs
  • Ephemeral Keys

License

Vapor Stripe Provider is available under the MIT license. See the LICENSE file for more info.

Want to help?

Feel free to submit a pull request whether it's a clean up, a new approach to handling things, adding a new part of the API, or even if it's just a typo. All help is welcomed! ๐Ÿ˜€

stripe-provider's People

Contributors

andrewangeta avatar anthonycastelli avatar calebkleveter avatar balestrapatrick avatar vzsg avatar andreaferrando avatar tanner0101 avatar

Watchers

Raymond Kelly 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.