Created
August 2, 2010 06:36
-
-
Save matthodan/504213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
credit_card = { | |
:type => '[cc type, e.g. 'visa']', | |
:number => '[cc number, from test account]', | |
:verification_value => '123', | |
:month => '[expiration month, from test account]', | |
:year => '[expiration year, from test account]', | |
:first_name => '[first name, can be anything]', | |
:last_name => '[last name, can be anything]', | |
:street_1 => '[street address, can be anything]', | |
:city => '[city, can be anything]', | |
:state => '[state, can be anything]', | |
:country => '[use 'US' if you used a U.S. state code above]', | |
:zip => '[zip code, can be anything]', | |
:email => '[payor email address, can be anything]' | |
} | |
# I have the 'billing_start_date' set to one-month from today, but | |
# this can be set to any date as long as it's not in the past | |
recurring = { | |
:description => '[text description of the transaction]', | |
:billing_start_date => Time.now.advance(:months => 1).iso8601, | |
:periodicity => :monthly, | |
:amount => [amount in cents], | |
:auto_bill_outstanding_amount => true | |
} | |
# Initial payment is optional, read the PayPal API docs to learn more | |
initial = { | |
:amount => [amount in cents] | |
} | |
# Trial is optional, read the PayPal API docs to learn more | |
trial = { | |
:periodicity => :monthly, | |
:total_billing_cycles => 1, | |
:amount => [amount in cents] | |
} | |
currency = 'USD' | |
@response = GATEWAY.create_recurring_profile( | |
:credit_card => credit_card, | |
:address => address, | |
:recurring => recurring, | |
:initial => initial, | |
:trial => trial, | |
:currency => currency) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment