I'm currently developing a Rails application to accept recurring billing using Chargify. I've installed their gem and managed to connect to Chargify with the gem. However, some subscriptions go through and some do not.
My question is how do I handle or even process the response once the gem communicates with the server?
I don't see anything in the development logs that gives me any indication of a successful data transfer or a failed one. The gem documentation also does not mention anything regarding this.
Thanks for looking.
UPDATE
The code I'm playing around with is in my checkout controller:
def checkout @customer = Customer.new(params[:customer])
Chargify::Customer.create(
:first_name => "Charlie",
:last_name => "Bull",
:email => "charlie@example.com",
:organization => "Chargify"
)
Chargify::Subscription.create(
:product_handle => 'recurring',
:customer_attriburtes => {
:first_name => @customer.shipping_first_name,
:last_name => @customer.shipping_last_name,
:email => @customer.email
},
:payment_profile_attributes => {
:first_name => @customer.shipping_first_name,
:last_name => @customer.shipping_last_name,
:full_number => "1",
:expiration_month => 1,
:expiration_year => 2012,
:billing_address => @customer.shipping_street_address,
:billing_city => @customer.shipping_city,
:billing_state => @customer.shipping_state,
:billing_zip => @customer.shipping_zip_code,
:billing_country => @customer.shipping_country
}
)
#if @subscription.save
# logger.info "saved description"
# redirect_to process_path
#else
# redirect_to :back, :alert =>"There was an error."
#end
end
The customer create is going through, but the Subscription does not. I'm just looking for a callback from the server so I can act based off whether it succeeded and find out why the subscription isn't going through.