Last active
February 6, 2020 17:53
-
-
Save nishapanFFF/a8997997142011ef6a5a01267d901b1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$billingInfo = new Recurly_BillingInfo(); | |
// billingToken is given back to us from recurly.js javascript library when user provides Credit Card info. | |
// Credit card info includes bill_first_name & bill_last_name, and should have been validated by recurly.js | |
// before the token is generated. | |
$billingInfo->token_id = $billingToken; | |
$email = 'npdev0205-1@yopmail.com'; | |
$account = new Recurly_Account(); | |
$account->account_code = $email; | |
$account->email = $email; | |
$account->first_name = 'nisha'; // this is the only place we set first name | |
$account->last_name = 'pan'; // this is the only place we set last name | |
$account->address = $address; // $address obj is populated upstream | |
$account->billing_info = $billingInfo; // billinginfo is attached to account | |
$subscription = new Recurly_Subscription(); | |
$subscription->plan_code = 'fffvip'; | |
$subscription->currency = 'USD'; | |
$subscription->quantity = 1; | |
$subscription->account = $account; // account is attached to subscription | |
// subscription is created in addition to account | |
// and i assume this is where the error "last name cannot be blank" is thrown? | |
$subscription->create(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment