Joseph Jacobs
Joseph Jacobs

Reputation: 1

Recurlyv3 API doesn't find any data associated with valid token id

This is the essential bit of PHP:

// Add subscription
$subscription = new Recurly_Subscription();
$subscription->plan_code = $planCode;
$subscription->currency = 'USD';
$subscription->quantity = 1;

if ($couponCode != "") { $subscription->coupon_code = $couponCode; }

$subscription->account = new Recurly_Account();
$subscription->account->account_code = $customerID;

$subscription->billing_info = new Recurly_BillingInfo();
$subscription->account->billing_info->token_id = $token;

$subscription->create();

When this code runs, $token has the tokenID created by an earlier call to recurly.token (...) with the billing info.

The account already exists on Recurly -- the account ID, first and last names, but no billing info. This is because we allow people to signup for a complimentary service before subscribing. So I want to create the subscription on the extant account. Initially, following the code examples, the create() call was subscription->account->create(). But that failed because the account existed already.

Upvotes: 0

Views: 116

Answers (1)

Rachel Davis
Rachel Davis

Reputation: 1804

This sounds like an issue with the old PHP library, which did not support tokenization of billing information. An upgrade to the PHP client library should fix this issue.

Upvotes: 2

Related Questions