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

PHP error when transaction fails #20

Closed
steve-obrien opened this issue Dec 1, 2011 · 2 comments
Closed

PHP error when transaction fails #20

steve-obrien opened this issue Dec 1, 2011 · 2 comments
Labels
V2 V2 Client

Comments

@steve-obrien
Copy link

PHP Error [8]
Undefined property: Recurly_TransactionError::$field (/lib/recurly/resource.php:146)

This occurs on the test account when using the test credit card number 4000-0000-0000-0077 (failed due to insuficient funds)

A fix was to add var $field, to the Recurly_TransactionError class

@mbeale
Copy link

mbeale commented Dec 18, 2012

I know it has been a while, but I am unable to reproduce this error. I tried this code:

$subscription = new Recurly_Subscription();
$subscription->plan_code = 'gold';
$subscription->currency = 'EUR';

$account = new Recurly_Account();
$account->account_code = '3';
$account->email = 'verena@example.com';
$account->first_name = 'Verena';
$account->last_name = 'Example';

$billing_info = new Recurly_BillingInfo();
$billing_info->number = '4000-0000-0000-0077';
$billing_info->month = 1;
$billing_info->year = 2014;

$account->billing_info = $billing_info;
$subscription->account = $account;

$subscription->create();

And I get the expected result:

PHP Fatal error: Uncaught exception 'Recurly_ValidationError' with message 'Your transaction was declined due to insufficient funds in your account. Please use a different card or contact your bank.' in /home/mbeale/php/recurly-client-php/lib/recurly/response.php:30
Stack trace:
#0 /home/mbeale/php/recurly-client-php/lib/recurly/resource.php(64): Recurly_ClientResponse->assertSuccessResponse(Object(Recurly_Subscription))
#1 /home/mbeale/php/recurly-client-php/lib/recurly/subscription.php(29): Recurly_Resource->_save('POST', '/subscriptions')
#2 /home/mbeale/php/sample.php(411): Recurly_Subscription->create()
#3 {main}
thrown in /home/mbeale/php/recurly-client-php/lib/recurly/response.php on line 30

Let me know the code you used to get the error you spoke about

@drewish
Copy link

drewish commented Feb 8, 2013

Since Michael wasn't able to reproduce this and there wasn't any further follow up, I'm going to close this.

@drewish drewish closed this as completed Feb 8, 2013
shulmang added a commit that referenced this issue Aug 27, 2015
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

4 participants