Spreedly is a cloud-based credit card vault that allows users to work with multiple payment gateways simultaneously.

 

Payment Gateway?

Payment Processor?

Payment Aggregator?

Billing-Subscription Solution? 

 

env = Spreedly::Environment.new(environment_key, access_secret)

transaction = env.purchase_on_gateway(gateway_token, payment_method_token, 4432)

transaction.succeeded?    # => true
transaction.token         # => "aGJlY5srn7TFeYKxO5pmwi3CyJd"

A Gateway

 

gateway = env.add_gateway(:test)
gateway.token     # => "DnbEJaaY2egcVkCvg3s8qT38xgt"



####################################
# Grab info for supported gateways
###################################

env.gateway_options

A Payment Information aka payment method

 

Action payment method

 
env.verify_on_gateway(gateway_token, payment_method_token, retain_on_success: true)

auth_transaction = env.authorize_on_gateway(gateway_token, payment_method_token, 250)

if auth_transaction.succeeded?
  capture_transaction = env.capture_transaction(auth_transaction.token)
end

capture_transaction = env.capture_transaction(auth_transaction.token, amount: 100)

env.purchase_on_gateway(gateway_token, payment_method_token, amount,
                        order_id: "123",
                        description: "The Description",
                        ip: "192.31.123.112",
                        merchant_name_descriptor: "SuperDuper Corp",
                        merchant_location_descriptor: "http://super.com",
                        currency_code: "GBP",
                        retain_on_success: true)
Made with Slides.com