Last active
September 27, 2016 21:31
-
-
Save phpdave/0804dec42e88a9ae192db73eaba7ff27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//run this in developer console on Firefox or firebug console in your browser. Appears to only work on Mac... will need the jquery selector updated | |
//scrapes https://dev.recurly.com/docs/ | |
//Iterate over an array of objects we want to pick up based on h1 headers | |
var entities, entitieslength, i; | |
entities = ["Create Subscription","Account Object","Adjustment Object","Create Account's Billing Info (Token)","Create Account's Billing Info (Credit Card)","Create Subscription","Create Plan","Transaction Object"]; | |
for (i = 0; i < entities.length; i++) { | |
console.log('/**'); | |
console.log(' * '+entities[i]); | |
$('html.ng-scope.wf-proximanova-n4-active.wf-proximanova-n6-active.wf-proximanova-n7-active.wf-proximanova-i4-active.wf-proximanova-i7-active.wf-proximanova-i6-active.wf-proximanova-n3-active.wf-proximanova-i3-active.wf-active body.layout.page-docs.body-threes.theme-solid.header-custom.header-bg-size-cover.header-bg-pos-tc.header-overlay-triangles.lumosity-normal.undefined.theme-threes.ng-scope.os-osx div.wrapper div.container.body-container div.main-content div.main-head div.section-right-parent div.section-right div.docs-page.ng-scope div.docs-content div.docs-header h1:contains("'+entities[i]+'")').parent().parent().children().children().children().find('.table').children().filter('div').each(function( index ) { | |
parts = $( this ).find('strong').text().split(":"); | |
fieldname=parts[0]; | |
datatype=parts[1]; | |
description = $( this ).find('p').text(); | |
console.log(' * @property '+datatype+' $'+fieldname+' '+description); | |
});//end dom traversal | |
console.log(' */'); | |
}//end entities loop |
This file contains hidden or 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
/* | |
* Account Object | |
* @property string $adjustments The URL of adjustments for the specified account. | |
* @property string $account_balance The URL of the account balance for the specified account. | |
* @property string $billing_info The URL of billing info for the specified account. | |
* @property string $invoices The URL of invoices for the specified account. | |
* @property string $redemption The URL of the coupon redemption for the specified account. | |
* @property string $subscriptions The URL of subscriptions for the specified account. | |
* @property string $transactions The URL of transactions for the specified account. | |
* @property string $account_code The unique identifier of the account. | |
* @property string $state The state of accounts to return: active or closed. | |
* @property string $username The username of the account. | |
* @property string $email The email address of the account. | |
* @property array of strings $cc_emails Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the email field also receives. | |
* @property string $first_name The first name of the account. | |
* @property string $last_name The last name of the account. | |
* @property string $company_name The company name of the account. | |
* @property string $vat_number The VAT number of the account (to avoid having the VAT applied). | |
* @property boolean $tax_exempt The tax status of the account. true exempts tax on the account, false applies tax on the account. | |
* @property object $address The nested address information of the account: address1, address2, city, state, zip, country, phone. | |
* @property string $accept_language The ISO 639-1 language code from the user's browser, indicating their preferred language and locale. | |
* @property string $hosted_login_token The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: https://:subdomain.recurly.com/account/:hosted_login_token. | |
* @property datetime $created_at The date and time the account was created in Recurly. | |
* @property datetime $updated_at The date and time the account or its billing info was last updated. | |
* @property datetime $closed_at For closed accounts, the date and time it was closed. | |
*/ | |
/* | |
* Adjustment Object | |
* @property string $type The type of adjustment to return: charge or credit. | |
* @property string $account The URL of the account for the specified adjustment. | |
* @property string $invoice The URL of the invoice for the specified adjustment. | |
* @property string $uuid The unique identifier of the adjustment. | |
* @property string $state The state of the adjustments to return: pending or invoiced. | |
* @property string $description Description of the adjustment for the adjustment. Max 255 characters. | |
* @property string $accounting_code Accounting code. Max of 20 characters. | |
* @property string $origin The origin of the adjustment to return: plan, plan_trial, setup_fee, add_on, add_on_trial, one_time, debit, credit, coupon, or carryforward. | |
* @property integer $unit_amount_in_cents Positive amount for a charge, negative amount for a credit. Max 10000000. | |
* @property string $quantity Quantity. | |
* @property string $original_adjustment_uuid Only shows if adjustment is a credit created from another credit. | |
* @property integer $discount_in_cents The discount on the adjustment, in cents. | |
* @property integer $tax_in_cents The tax on the adjustment, in cents. | |
* @property integer $total_in_cents The total amount of the adjustment, in cents. | |
* @property string $currency Currency, 3-letter ISO code. | |
* @property boolean $taxable true if the current adjustment is taxable, false if it is not. | |
* @property string $tax_type The tax type of the adjustment. | |
* @property string $tax_region The tax region of the adjustment. | |
* @property string $tax_rate The tax rate of the adjustment. | |
* @property boolean $tax_exempt true exempts tax on the charge, false applies tax on the charge. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative adjustments). Credits are always post-tax. Pre-tax discounts should use the Coupons feature. | |
* @property array of mixed $tax_details The nested address information of the adjustment: name, type, tax_rate, tax_in_cents. | |
* @property string $tax_code Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of unknown, physical, or digital. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules. | |
* @property datetime $start_date A timestamp associated with when the adjustment began. | |
* @property datetime $end_date A timestamp associated with when the adjustment ended. | |
* @property datetime $created_at A timestamp associated with when the adjustment was created. | |
*/ | |
/* | |
* Create Account's Billing Info (Token) | |
* @property string $account_code Account's unique code. | |
* @property string $token_id A token generated by Recurly.js | |
* @property string $currency Currency in which invoices will be posted. Only applicable if this account is enrolled in a plan has a different currency than your site's default. | |
*/ | |
/* | |
* Create Subscription | |
* @property object $gift_card The gift card object is required in order to redeem a redemption code. | |
* @property string $redemption_code The redemption code for the gift card being redeemed. | |
* @property string $plan_code plan_code for the subscription. | |
* @property object $account Nested account attributes. | |
* @property string $currency Currency for the subscription. | |
* @property array of mixed $subscription_add_ons Nested add-ons. | |
* @property string $coupon_code Optional coupon code to redeem on the account and discount the subscription. Please note, the subscription request will fail if the coupon is invalid. | |
* @property integer $unit_amount_in_cents Override the unit amount of the subscription plan by setting this value in cents. If not provided, the subscription will inherit the price from the subscription plan for the provided currency. Max 10000000. | |
* @property integer $quantity Optionally override the default quantity of 1. | |
* @property datetime $trial_ends_at If set, overrides the default trial behavior for the subscription. This must be a date and time, preferably in UTC. The date must be in the future. | |
* @property datetime $starts_at If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial. | |
* @property integer $total_billing_cycles Renews the subscription for a specified number of cycles, then automatically cancels. Defaults to the subscription renewing indefinitely. | |
* @property datetime $first_renewal_date Indicates a date at which the first renewal should occur. Subsequent renewals will be offset from this date. The first invoice will be prorated appropriately so that the customer only pays for the portion of the first billing period for which the subscription applies. Useful for forcing a subscription to renew on the first of the month. | |
* @property string $collection_method Optional field to set the collection for an invoice as automatic or manual. The default is automatic if it's not set. | |
* @property integer $net_terms Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to 0, it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly. Defaults to 0. | |
* @property string $po_number Optional notes field. Attach a PO number to the invoice. | |
* @property boolean $bulk Optional field to be used only when needing to bypass the 60 second limit on creating subscriptions. Should only be used when creating subscriptions in bulk from the API. Set to 'true' or 'false'. Defaults to 'false'. | |
* @property string $terms_and_conditions Optional notes field. This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes with this tag to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals. | |
* @property string $customer_notes Optional notes field. This will default to the Customer Notes text specified on the Invoice Settings page in your Recurly admin. Specify custom notes with this tag to add or override Customer Notes. Custom notes will stay with a subscription on all renewals. | |
* @property string $vat_reverse_charge_notes VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription. Specify custom notes with this tag to add or override VAT Reverse Charge Notes. Custom notes will stay with a subscription on all renewals. | |
* @property timestamp $bank_account_authorized_at Merchants importing recurring subscriptions paid with ACH into Recurly can backdate the subscription's authorization with this attribute using an ISO 8601 timestamp. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared. | |
* @property string $revenue_schedule_type Optional field for setting a revenue schedule type. This will determine how revenue for the associated Subscription should be recognized. When creating a Subscription, available schedule types are never, evenly, at_range_start, or at_range_end. If no revenue_schedule_type is set, the Subscription will inherit the revenue_schedule_type from its Plan. | |
* @property string $add_on_code The code for the Add-On. | |
* @property integer $unit_amount_in_cents Amount of the transaction in cents. Max 10000000. | |
* @property integer $quantity Optionally override the default quantity of 1 | |
* @property string $usage_percentage If add_on_type = usage and usage_type = percentage, you can set a custom usage_percentage for the subscription add-on. Must be between 0.0000 and 100.0000. | |
* @property string $revenue_schedule_type Optional field for setting a revenue schedule type. This will determine how revenue for the associated Subscription Add-On should be recognized. When creating a Subscription Add-On, available schedule types are never, evenly, at_range_start, or at_range_end. If no revenue_schedule_type is set, the Subscription Add-On will inherit the revenue_schedule_type from its Plan Add-On. | |
*/ | |
/* | |
* Create Plan | |
* @property string $plan_code Unique code to identify the plan. This code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 50 characters. | |
* @property string $name Plan name. Max of 255 characters. | |
* @property array of objects $unit_amount_in_cents Array of currency objects, see example below. Max 10000000. | |
* @property string $description Optional plan description, not displayed. | |
* @property string $plan_interval_unit days, or months, defaults to months. | |
* @property integer $plan_interval_length Plan interval length, defaults to 1 | |
* @property string $trial_interval_unit days or months, defaults to months. | |
* @property integer $trial_interval_length Defaults to 0, for no trial | |
* @property string $success_url URL to redirect to after signup on the hosted payment pages. | |
* @property string $accounting_code Accounting code for related invoice line items, code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 20 characters. | |
* @property string $revenue_schedule_type Optional field for setting a revenue schedule type. This will determine how revenue for the associated Plan should be recognized. When creating a Plan, available schedule types are never, evenly, at_range_start, or at_range_end. | |
* @property string $setup_fee_accounting_code Accounting code for a Setup Fee, code may only contain the following characters: [a-z 0-9 @ - _ .]. Max of 20 characters. | |
* @property string $setup_fee_revenue_schedule_type Optional field for setting a revenue schedule type. This will determine how revenue for the associated Plan Setup Fee should be recognized. When creating a Plan Setup Fee, available schedule types are never, evenly, at_range_start, or at_range_end. | |
* @property array of objects $setup_fee_in_cents Array of currency objects, see examples. Max 10000000. | |
* @property string $total_billing_cycles Number of billing cycles before the plan stops renewing, defaults to null for continuous auto renewal. | |
* @property stringDeprecated $unit_name Deprecated Unit description for the quantity, e.g. users. | |
* @property boolean $display_quantity Display the quantity field on the hosted payment page if true, defaults to false. | |
* @property stringDeprecated $cancel_url Deprecated URL to redirect to on canceled signup on the hosted payment pages. | |
* @property boolean $tax_exempt true exempts tax on the plan, false applies tax on the plan. If not defined, then defaults to the Plan and Site settings. | |
* @property string $tax_code Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of unknown, physical, or digital. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules. | |
* @property string $plan_code The unique plan code | |
* @property string $add_on_code Add-on code. Max of 50 characters. | |
* @property string $add_on_type Whether the add-on is Fixed-Price (fixed), or Usage-Based (usage). | |
* @property integer $default_quantity Default quantity for the hosted pages. | |
* @property array of objects $unit_amount_in_cents Array of unit amounts with their currency code. Max 10000000. | |
* @property string $name Add-on name. Max of 255 characters. | |
* @property boolean $display_quantity_on_hosted_page If true, display a quantity field on the hosted pages for the add-on. | |
* @property string $accounting_code Accounting code for invoice line items for the add-on, defaults to the value of add_on_code. Max of 20 characters. | |
* @property string $revenue_schedule_type Optional field for setting a revenue schedule type if add_on_type=fixed. This will determine how revenue for the associated Plan Add-On should be recognized. When creating a Plan Add-On, available schedule types are never, evenly, at_range_start, or at_range_end. | |
* @property string $tax_code Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of unknown, physical, or digital. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules. | |
* @property boolean $optional Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. | |
* @property string $measured_unit_id The id of the measured unit on your site associated with the add-on. | |
* @property string $usage_type If add_on_type = usage, you must set a usage_type, which can be price or percentage. If price, the price is defined in unit_amount_in_cents. If percentage, the percentage is defined in usage_percentage. | |
* @property string $usage_percentage If add_on_type = usage and usage_type = percentage, you must set a usage_percentage. Must be between 0.0000 and 100.0000. | |
*/ | |
/* | |
* Transaction Object | |
* @property string $uuid Transaction's unique identifier. | |
* @property string $account The URL of the account associated with the transaction. | |
* @property string $invoice The URL of the invoice associated with the transaction. | |
* @property string $subscription The URL of the subscription associated with the transaction. | |
* @property string $original_transaction For refund transactions, the URL of the original transaction. | |
* @property string $uuid The unique identifier of the transaction. | |
* @property string $action purchase, verify or refund. | |
* @property integer $amount_in_cents Total transaction amount in cents. | |
* @property integer $tax_in_cents Amount of tax or VAT within the transaction, in cents. | |
* @property string $currency 3-letter currency for the transaction. | |
* @property string $status success, declined, or void. | |
* @property string $payment_method credit_card, paypal, check, wire_transfer, money_order. | |
* @property string $reference Transaction reference from your payment gateway. | |
* @property string $source Source of the transaction. Possible values: transaction for one-time transactions, subscription for subscriptions, billing_info for updating billing info. | |
* @property boolean $recurring True if transaction is recurring. | |
* @property boolean $test True if test transaction. | |
* @property boolean $voidable True if the transaction may be voidable, accuracy depends on your gateway. | |
* @property string $refundable True if the transaction may be refunded. | |
* @property string $ip_address Customer's IP address on the transaction, if applicable. | |
* @property string $cvv_result CVV result, if applicable. | |
* @property string $avs_result AVS result, if applicable. | |
* @property string $avs_result_street AVS result for the street address, line 1. | |
* @property string $avs_result_postal AVS result for the postal code. | |
* @property datetime $created_at Date the transaction took place. | |
* @property datetime $updated_at Date the transaction was last modified. | |
* @property string $details Nested account and billing information submitted at the time of the transaction. When writing a client library, do not map these directly to Account or Billing Info objects. | |
* @property string $error_code For declined transactions, the error code (if applicable). | |
* @property string $error_category For declined transactions, the error category (if applicable). | |
* @property string $merchant_message For declined transactions, the message displayed to the merchant (if applicable). | |
* @property string $customer_message For declined transactions, the message displayed to the customer (if applicable). | |
* @property string $gateway_error_code For declined transactions, this field lists the gateway error code sent to us from the gateway (if applicable). | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment