Skip to content

Instantly share code, notes, and snippets.

$purchase = new Recurly_Purchase();
$purchase->currency = 'USD';
$purchase->account = new Recurly_Account();
$purchase->account->account_code = '[email protected]';
$purchase->account->first_name = 'jane';
$purchase->account->last_name = 'doe';
$billing_info = new Recurly_BillingInfo();
$billing_info->number = '4111-1111-1111-1111';
$billing_info->country = 'US';
O:15:"Recurly_Invoice":7:{s:10:"*_values";a:18:{s:7:"account";O:12:"Recurly_Stub":5:{s:10:"objectType";s:7:"account";s:8:"*_href";s:83:"https://fabfitfun-dev.recurly.com/v2/accounts/dummy_account_5dc47cdb095978.18119852";s:8:"*_type";N;s:10:"*_client";O:14:"Recurly_Client":2:{s:23:"Recurly_Client_apiKey";N;s:31:"Recurly_Client_acceptLanguage";s:5:"en-US";}s:9:"*_links";a:0:{}}s:7:"address";O:15:"Recurly_Address":7:{s:10:"*_values";a:3:{s:5:"state";s:2:"NY";s:3:"zip";s:5:"10009";s:7:"country";s:2:"US";}s:15:"*_unsavedKeys";a:0:{}s:10:"*_errors";O:17:"Recurly_ErrorList":3:{s:11:"transaction";N;s:17:"transaction_error";N;s:25:"Recurly_ErrorListerrors";a:0:{}}s:8:"*_href";N;s:8:"*_type";N;s:10:"*_client";O:14:"Recurly_Client":2:{s:23:"Recurly_Client_apiKey";N;s:31:"Recurly_Client_acceptLanguage";s:5:"en-US";}s:9:"*_links";a:0:{}}s:4:"uuid";s:32:"4fb652fb64117a9f97e75647ce876763";s:5:"state";s:4:"open";s:12:"tax_in_cents";i:0;s:14:"total_in_cents";i:500;s:8:"currency";s:3:"USD";s:26:"attempt_next_collection_at";O:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>FabFitFun</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" rel="stylesheet" type="text/css" />
<style type="text/css">*{
box-sizing:border-box;
-moz-box-sizing:border-box;
}
require_once APPPATH . 'third_party/Recurly215/recurly.php'; // using recurly 2.15 client lib
$subscription = new Recurly_Subscription();
$subscription->plan_code = 'access_trial';
// .. fill in more subscription info
$account = new Recurly_Account();
$account->account_code = '[email protected]';
// .. fill in more account info
////////// DB info + queries ////////////
To get active season's edit or addon campaign id & customize campaign id:
select campaign_id as addon_or_edit_sale_campaign_id, customize_campaign_id from shop_seasons where position = 1;
To get select (and in the future annual_access_select) role's addon/edit shopping window period:
select title, start_date as select_start_date, select_end_date, regular_start_date, end_date as regular_end_date from shop_addons_campaigns where id = 48;
To get regular (non select) role's shopping window period:
select title, regular_start_date, end_date as regular_end_date from shop_addons_campaigns where id = 48;
no prewarm:
SET, 60, 1575424458655149:shop_:default:profile-userId-9629727, getProfileImage, /var/www/html/shop/wp-content/themes/fabfitfun/template-parts/header/menu-my-account.php, setAvatarUrl, /var/www/html/shop/wp-content/plugins/woocommerce-recurly-subscriptions/models/Profile.php
SET, 0, 1575424458655149:shop_:default:is_blog_installed, wp_not_installed, /var/www/html/shop/wp-settings.php, is_blog_installed, /var/www/html/shop/wp-includes/load.php
SET, 0, 1575424458655149:shop_:options:notoptions, members_get_setting, /var/www/html/shop/wp-content/plugins/members/inc/functions-options.php, get_option, /var/www/html/shop/wp-content/plugins/members/inc/functions-options.php
SET, 1800, 1575424459796322:shop_:site-transient:theme_roots, search_theme_directories, /var/www/html/shop/wp-includes/theme.php, set_site_transient, /var/www/html/shop/wp-includes/theme.php
SET, 0, 1575424458655149:shop_:options:notoptions, wc_template_debug_mode, , get_option, /var/www/html/shop/wp-content/plugins/woocommerce/inclu
no prewarm:
SET, 0, 1575490661003714:shop_:default:is_blog_installed, wp_not_installed, /var/www/html/shop/wp-settings.php, is_blog_installed, /var/www/html/shop/wp-includes/load.php
SET, 0, 1575490661003714:shop_:options:notoptions, members_get_setting, /var/www/html/shop/wp-content/plugins/members/inc/functions-options.php, get_option, /var/www/html/shop/wp-content/plugins/members/inc/functions-options.php
SET, 1800, 1575490662076318:shop_:site-transient:theme_roots, search_theme_directories, /var/www/html/shop/wp-includes/theme.php, set_site_transient, /var/www/html/shop/wp-includes/theme.php
SET, 0, 1575490661003714:shop_:options:notoptions, wc_template_debug_mode, , get_option, /var/www/html/shop/wp-content/plugins/woocommerce/includes/wc-core-functions.php
SET, 0, 1575490661003714:shop_:transient:woocommerce_cache_excluded_uris, prevent_caching, , set_transient, /var/www/html/shop/wp-content/plugins/woocommerce/includes/class-wc-cache-helper.php
SET, 0, 1575490661003714:shop_:wc_session_id:wc_wc_session
MISS, shop_site-options:1:notoptions, get_site_option, /var/www/html/shop/wp-content/plugins/discourse-sso/public/class-discourse-sso.php, get_network_option, /var/www/html/shop/wp-includes/option.php
MISS, shop_site-transient:as3cf_notices, find_notice_by_id, /var/www/html/shop/wp-content/plugins/amazon-s3-and-cloudfront-pro/classes/as3cf-notices.php, get_site_transient, /var/www/html/shop/wp-content/plugins/amazon-s3-and-cloudfront-pro/classes/as3cf-notices.php
MISS, shop_:post_amazonS3_cache:264, filter_content_pagination, , get_post_cache, /var/www/html/shop/wp-content/plugins/amazon-s3-and-cloudfront-pro/classes/filters/as3cf-local-to-s3.php
MISS, shop_:posts:get_pages:a1c8f7c340b447affad82e0c398b121d:0.880355001576709857, get_body_class, /var/www/html/shop/wp-includes/post-template.php, get_pages, /var/www/html/shop/wp-includes/post-template.phpclass="home page-template page-template-page-dashboard page-template-page-dashboard-php page page-id-264 logged-in admin-bar no-customize-support custom-backgrou
$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 = '[email protected]';
$account = new Recurly_Account();
$account->account_code = $email;
$account->email = $email;
{
"currentBox":{
"id":59,
"name":"Spring 2020",
"year":2020,
"quarter":1,
"description":null,
"imageUrl":"https://static.fabfitfun.com/wp-content/uploads/2020/04/01-January0328-optimzed_1585958179.4151_1585958179.7093.png",
"sku":null,