Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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.
base fork: tfwright/active_merchant
...
head fork: tfwright/active_merchant
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
5 lib/active_merchant/billing/gateways/cyber_source/cyber_source_recurring_api.rb
@@ -29,10 +29,7 @@ def recurring(credit_card, options = {})
#
# This transaction updates an existing Recurring Billing Profile
# and the subscription must have already been created previously
- # by calling +recurring()+. The ability to change certain
- # details about a recurring payment is dependent on transaction history
- # and the type of plan you're subscribed with paypal. Web Payment Pro
- # seems to have the ability to update the most field.
+ # by calling +recurring()+.
#
# ==== Parameters
#
View
48 test/remote/gateways/remote_cyber_source_test.rb
@@ -35,6 +35,21 @@ def setup
:ignore_avs => 'true',
:ignore_cvv => 'true'
}
+
+ @subscription_options = {
+ :order_id => 12345,
+ :email => 'someguy1232@fakeemail.net',
+ :credit_card => @credit_card,
+ :setup_fee => 100,
+ :billing_address => address.merge(:first_name => 'Jim', :last_name => 'Smith'),
+ :subscription => {
+ :frequency => "weekly",
+ :start_date => Date.today.next_week,
+ :occurrences => 4,
+ :auto_renew => true,
+ :amount => 100
+ }
+ }
end
@@ -165,4 +180,37 @@ def test_successful_credit
assert_success response
assert response.test?
end
+
+ def test_successful_create_subscription
+ assert response = @gateway.create_subscription(@credit_card, @subscription_options)
+ assert_equal 'Successful transaction', response.message
+ assert_success response
+ assert response.test?
+ end
+
+ def test_successful_create_subscription_with_setup_fee
+ assert response = @gateway.recurring(@credit_card, @subscription_options.merge(:setup_fee => 100))
+ assert_equal 'Successful transaction', response.message
+ assert_success response
+ assert response.test?
+ end
+
+ def test_successful_update_subscription
+ response = @gateway.recurring(@credit_card, @subscription_options)
+
+ assert response = @gateway.update_recurring(response.authorization, {:order_id =>generate_unique_id,:credit_card => @credit_card, :setup_fee => 100})
+ assert_equal 'Successful transaction', response.message
+ assert_success response
+ assert response.test?
+ end
+
+ def test_successful_bill_outstanding_amount
+ assert response = @gateway.recurring(@credit_card, @subscription_options)
+
+ assert response = @gateway.bill_outstanding_amount(response.authorization, @amount, {})
+ assert_equal 'Successful transaction', response.message
+ assert_success response
+ assert response.test?
+ end
+
end

No commit comments for this range

Something went wrong with that request. Please try again.