Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 11 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
24 README.md
@@ -245,21 +245,23 @@ In special cases, you may want to create payment types programmatically and will
* Successful execution will return an AddPaymentMethodTransaction object (*not* a PaymentMethod object). Adding a payment method is wrapped in a transaction much like doing a purchase or authorize request is. The returned object will have the PaymentMethod object as a child.
* You still need to manually call `retain` on the payment method if you wish to retain the card.
- SpreedlyCore.configure
-
- pm_transaction = SpreedlyCore::PaymentMethod.create(:credit_card => good_card_hash)
- pm_token = pm_transaction.payment_method.token
- puts "Payment method token is #{pm_token}"
-
- retain_transaction = pm_transaction.payment_method.retain
- retain_transaction.succeeded? # true
-
- begin
+The example below illustrates both a successful payment method creation, and how to handle one with errors.
+
+ SpreedlyCore.configure
+
+ pm_transaction = SpreedlyCore::PaymentMethod.create(:credit_card => good_card_hash)
+ pm_token = pm_transaction.payment_method.token
+ puts "Payment method token is #{pm_token}"
+
+ retain_transaction = pm_transaction.payment_method.retain
+ retain_transaction.succeeded? # true
+
+ begin
pm_transaction = SpreedlyCore::PaymentMethod.create(:credit_card => bad_card_hash)
rescue Exception => e
puts "Errors when submitting the card: #{e.errors.join(",")}"
end
-
+
Contributing
------------
1. [Fork](http://help.github.com/forking/) spreedly-core-ruby
View
1  lib/spreedly-core-ruby.rb
@@ -6,6 +6,7 @@
require 'spreedly-core-ruby/base'
require 'spreedly-core-ruby/payment_method'
require 'spreedly-core-ruby/gateway'
+require 'spreedly-core-ruby/test_extensions'
require 'spreedly-core-ruby/test_gateway'
require 'spreedly-core-ruby/transactions'
require 'active_support/core_ext/hash/conversions'
View
4 lib/spreedly-core-ruby/base.rb
@@ -1,3 +1,5 @@
+require 'spreedly-core-ruby/version'
+
module SpreedlyCore
# Base class for all SpreedlyCore API requests
class Base
@@ -14,7 +16,7 @@ class Base
# timeout requests after 10 seconds
default_timeout 10
- base_uri "https://www.spreedlycore.com/#{API_VERSION}"
+ base_uri "https://spreedlycore.com/#{SpreedlyCore::API_VERSION}"
def self.configure(login, secret, options = {})
@@login = login
View
2  lib/spreedly-core-ruby/version.rb
@@ -1,4 +1,4 @@
module SpreedlyCore
- Version = VERSION = "0.1.3"
+ Version = VERSION = "0.1.9"
ApiVersion = API_VERSION = "v1"
end

No commit comments for this range

Something went wrong with that request. Please try again.