Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching errors rather than an exception #12

Open
normal1ze opened this issue Feb 5, 2015 · 0 comments
Open

Catching errors rather than an exception #12

normal1ze opened this issue Feb 5, 2015 · 0 comments

Comments

@normal1ze
Copy link

With your example:

charge = PinPayment::Charge.create(
customer: customer, # or you can pass customer.token, either way
email: customer.email,
amount: 1000,
currency: 'USD', # only AUD and USD are supported by pin.net.au
description: 'Widgets',
ip_address: request.remote_ip
)

if charge.success?

You would now store charge.token as a reference for this payment

end

Is there a way to return an error say "charge.errors" rather than raising an exception. With your example if the card returns an "Insaficiant funds" error it raises it as an exception. Would be awesome to have that as a return of charge.

Cheers. Ian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant