Ruby library to access the FastSpring Saasy API.
gem install fastspring-saasy
FastSpring::Account.setup do |config|
config[:username] = 'user'
config[:password] = 'password'
config[:company] = 'company'
end
sub = FastSpring::Subscription.find('reference')
sub.renew
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)
sub.cancel!
FastSpring::Subscription.create_subscription_url('test_product', 'new_co')
# => http://sites.fastspring.com/acme/product/test_product?referrer=new_co
orders = FastSpring::Order.search('search-string')
orders.each do |order|
puts order.inspect
end
order = FastSpring::Order.find('reference')
order.items.each do |item|
puts item.inspect
end
order.payments.each do |payment|
puts payment.inspect
end
#customer details
order.purchaser.inspect
store_pricing = FastSpring::LocalizedStorePricing.find(['/standard'], http_request)
puts store_pricing.inspect
Copyright (c) 2016 Richard Patching. See LICENSE.txt for further details.