GithubHelp home page GithubHelp logo

fastspring-saasy's Introduction

fastspring-saasy

Ruby library to access the FastSpring Saasy API.

Installation

gem install fastspring-saasy

Usage

Setup account credentials

FastSpring::Account.setup do |config|
  config[:username] = 'user'
  config[:password] = 'password'
  config[:company] = 'company'
end

Get subscription

sub = FastSpring::Subscription.find('reference')

Renew subscription

sub.renew

Update subscription

attributes = {
  first_name: 'John',
  last_name: 'Doe',
  company: 'Doe Inc.',
  email: '[email protected]',
  phone_number: '+1 123 456 789',
  product_path: '/product',
  quantity: 1,
  tags: 'tag1, tag2, tag3',
  coupon: 'code',
  proration: true
}
sub.update!(attributes)

Cancel subscription

sub.cancel!

Create subscriptions url

FastSpring::Subscription.create_subscription_url('test_product', 'new_co')
=> http://sites.fastspring.com/acme/product/test_product?referrer=new_co

Search Orders

orders = FastSpring::Order.search('search-string')
orders.each do |order|
  # order.inspect
end

Find Order

order = FastSpring::Order.find('reference')
order.items.each do |item|
  # item.inspect
end

order.payments.each do |payment|
  # payment.inspect
end

#customer details
order.purchaser.inspect

Localized Store Pricing

store_pricing = FastSpring::LocalizedStorePricing.find(['/standard'], http_request)

puts store_pricing.inspect

FastSpring

FastSpring have their own gem at github.com/fastspring/fastspring-ruby

Copyright © 2014 Richard Patching. See LICENSE.txt for further details.

fastspring-saasy's People

Contributors

foobarwidget avatar patchfx avatar plindelauf avatar railsmechanic 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.