Sha256: 7429889983a60a1ce2fc0df30e8f833b41910bf4a1cba596780484d4d5e065ae

Contents?: true

Size: 906 Bytes

Versions: 10

Compression:

Stored size: 906 Bytes

Contents

$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
$:.unshift(File.join(File.dirname(__FILE__), 'spec'))

require 'multi_json'
require 'slidepay'
require 'spec_helper'

include SlidePay

SlidePay.configure(development: true)
SlidePay.api_key = ENV["api_key"]

RestClient.proxy = "http://127.0.0.1:8888"

p = Payment.new
p["amount"] = 1.01
p["method"] = "CreditCard"
p["cc_number"] = "4111111111111111"
p["cc_cvv2"] = "111"
p["cc_billing_zip"] = "11111"
p["cc_expiry_month"] = "10"
p["cc_expiry_year"] = "14"
r = p.process()

if r
  puts "Payment created with id: #{p.id}"

  # Find the payment that was just created.
  payments_found = Payment.find_where(payment_id: p.id)

  puts "Payments found: #{payments_found.length}"
  puts "============================================="
  payments_found.each do |payment|
    puts "#{payment.id} - #{payment["amount"]}"
  end


else
  puts "Payment failed. "
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
slidepay-0.0.13 scenarios/payment_find_where_id.rb
slidepay-0.0.12 scenarios/payment_find_where_id.rb
slidepay-0.0.11 scenarios/payment_find_where_id.rb
slidepay-0.0.10 scenarios/payment_find_where_id.rb
slidepay-0.0.9 scenarios/payment_find_where_id.rb
slidepay-0.0.8 scenarios/payment_find_where_id.rb
slidepay-0.0.7 scenarios/payment_find_where_id.rb
slidepay-0.0.6 scenarios/payment_find_where_id.rb
slidepay-0.0.5 scenarios/payment_find_where_id.rb
slidepay-0.0.4 scenarios/payment_find_where_id.rb