I have a form where the user can enter their credit information. When they submit I keep getting 'Object not found'.
I checked the keys and subdomain everything is correct. What could be the issue?
public function createSubscription($plan,$token,$email,$fname,$lname,$currency,$starts_at,$company_name)
{
try {
$subscription = new \Recurly_Subscription();
$subscription->plan_code = $plan;
$subscription->currency = $currency;
$subscription->starts_at = $starts_at;
$account = new \Recurly_Account();
$account->account_code = $email;
$account->first_name = $fname;
$account->last_name = $lname;
$account->email = $email;
$account->company_name = $company_name;
$billing_info = new \Recurly_BillingInfo();
$billing_info->token_id = $token;
$account->billing_info = $billing_info;
$subscription->account = $account;
$subscription->create();
}
catch (\Recurly_ValidationError $e){
throw new CreditDeclined($e->getMessage());
}
catch ( \Exception $e) {
throw new InvalidGeneral($e->getMessage());
}
}
The two things I'd check first are that the plan code and billing token are valid.
The other thing to check is that you've loaded our PHP libraries. You need to have this someplace in your code: