Created
March 8, 2019 23:35
-
-
Save nishapanFFF/2d0cfe3de070e1524ab210f477c5ec2b 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
try { | |
$subscription = new Recurly_Subscription(); | |
$subscription->plan_code = 'fffvip'; | |
$subscription->currency = 'USD'; | |
$subscription->quantity = 1; | |
$accountcode = 'nplocalsgtf0301_14@yopmail.com'; | |
$account = Recurly_Account::get($accountcode); | |
$billing_info = new Recurly_BillingInfo(); | |
$billing_info->token_id = $billingToken; //token contains bad credit card | |
$account->billing_info = $billingInfo; | |
$subscription->account = $account; | |
$subscription->create(); | |
} catch (Exception $e) | |
{ | |
// Ian: $e is Recurly_ValidationError without any transcation error info. | |
// can you confirm if $e->getMessage() would give us the same message as Recurly_TransactionError > customer_message? | |
$message_for_user = $e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment