Example with ACH
Call the ChargeOver.Signup.signup(...)
method to sign up a new customer and store ACH/bank account information
securely.
// The data we want to send to ChargeOver
var my_data = {
'send_welcome_notice': true, // Default is FALSE. TRUE sends a welcome e-mail to new sign-ups, while FALSE will not send them anything.
'send_payment_receipt': true, // Default is FALSE. TRUE sends a payment receipt e-mail to new sign-ups, while FALSE will not send them anything.
'customer': {
company: 'My Company Name, LLC',
bill_addr1: '56 Cowles Road',
bill_addr2: '',
bill_addr3: '',
bill_city: 'Mt Pleasant',
bill_state: 'MI',
bill_postcode: '48858',
bill_country: 'United States',
},
'user': {
name: 'John Doe',
email: 'test@chargeover.com',
phone: '888-924-2347'
},
'ach': {
number: '8566602',
routing: '072403004',
name: 'John Doe',
// address: '',
// city: '',
// state: '',
// postcode: '',
// country: ''
},
items: [
1 // This is the item_id value of the product you want them signed up for
]
};
// Our callback function (this gets called after data is sent to ChargeOver)
function my_callback_function(code, message, response)
{
if (code == ChargeOver.Core.CODE_OK)
{
alert('You have signed up! Thanks ' + response.user.first_name + '!');
}
else
{
alert('An error occurred: ' + message);
}
}
// Call the signup method
ChargeOver.Signup.signup(my_data, my_callback_function);