Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Enable IntelliSense (IDE friendly) for class properties #278

Merged
merged 34 commits into from
Sep 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8441a34
Update transaction.php
phpdave Sep 27, 2016
3d0f21c
Update transaction.php
phpdave Sep 27, 2016
e4396ba
Update transaction.php
phpdave Sep 27, 2016
6950eae
Update transaction.php
phpdave Sep 27, 2016
017383e
Update account.php
phpdave Sep 27, 2016
5f8a0c2
Update adjustment.php
phpdave Sep 27, 2016
042ab50
Update billing_info.php
phpdave Sep 27, 2016
289fd2e
Update plan.php
phpdave Sep 27, 2016
8444ab9
Update account.php
phpdave Sep 27, 2016
3f0ce67
Update adjustment.php
phpdave Sep 27, 2016
5170424
Update transaction.php
phpdave Sep 27, 2016
a4c8bb5
Update billing_info.php
phpdave Sep 27, 2016
ecd6440
Update transaction.php
phpdave Sep 27, 2016
988c269
Update transaction.php
phpdave Sep 27, 2016
48a61e1
Update transaction.php
phpdave Sep 27, 2016
e054ae0
Update transaction.php
phpdave Sep 27, 2016
2fd71eb
Update transaction.php
phpdave Sep 27, 2016
a8387c4
Update account.php
phpdave Sep 27, 2016
2d3ce69
Update adjustment.php
phpdave Sep 27, 2016
561e568
Update billing_info.php
phpdave Sep 27, 2016
e209126
Update plan.php
phpdave Sep 27, 2016
ac030aa
Update account.php
phpdave Sep 27, 2016
01c9435
Update adjustment.php
phpdave Sep 27, 2016
5d7ceda
Update transaction.php
phpdave Sep 27, 2016
09a9475
Update billing_info.php
phpdave Sep 27, 2016
aab63ae
Merge branch 'master' of https://github.com/phpdave/recurly-client-php
ddresslerlegalplans Sep 27, 2016
2405439
Update account.php
phpdave Sep 27, 2016
7c5b9b9
Update adjustment.php
phpdave Sep 27, 2016
77eb093
Update adjustment.php
phpdave Sep 27, 2016
b82fdd0
Update billing_info.php
phpdave Sep 27, 2016
d0f557f
Update plan.php
phpdave Sep 27, 2016
e2cddd6
Update transaction.php
phpdave Sep 27, 2016
361f734
Update account.php
phpdave Sep 27, 2016
00cdce6
Update CHANGELOG.md
phpdave Sep 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Recurly PHP Client Library CHANGELOG

## Unreleased

* Added property documentation to several classes (thanks to [phpdave](https://github.com/phpdave)) [#278](https://github.com/recurly/recurly-client-php/pull/278)

## Version 2.7.0 (September 15th, 2016)

* Upgraded to API V2.4: https://dev.recurly.com/v2.4/docs
Expand Down
27 changes: 26 additions & 1 deletion lib/recurly/account.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
<?php

/**
* Class Recurly_Account
* @property Recurly_Stub $adjustments The URL of adjustments for the specified account.
* @property Recurly_Stub $account_balance The URL of the account balance for the specified account.
* @property Recurly_Stub $billing_info The URL of billing info for the specified account.
* @property Recurly_Stub $invoices The URL of invoices for the specified account.
* @property Recurly_Stub $redemption The URL of the coupon redemption for the specified account.
* @property Recurly_Stub $subscriptions The URL of subscriptions for the specified account.
* @property Recurly_Stub $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 string[] $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 Recurly_Address $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.
*/
class Recurly_Account extends Recurly_Resource
{
function __construct($accountCode = null, $client = null) {
Expand Down
29 changes: 28 additions & 1 deletion lib/recurly/adjustment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
<?php

/**
* class Recurly_Adjustment
* @property string $type The type of adjustment to return: charge or credit.
* @property Recurly_Stub $account The URL of the account for the specified adjustment.
* @property Recurly_Stub $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 integer $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 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.
*/
class Recurly_Adjustment extends Recurly_Resource
{
public static function get($adjustment_uuid, $client = null) {
Expand Down
23 changes: 22 additions & 1 deletion lib/recurly/billing_info.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
<?php

/**
* class Recurly_BillingInfo
* @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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's definitely more properties on this object: https://dev.recurly.com/docs/create-an-accounts-billing-info-credit-card

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added the missing fields.

* @property string $first_name First name
* @property string $last_name Last name
* @property string $number Credit card number, spaces and dashes are accepted
* @property int $month Expiration month
* @property int $year Expiration year
* @property string $address1 Address line 1, recommended for address validation
* @property string $address2 Address line 2.
* @property string $city City
* @property string $state State
* @property string $country Country, 2-letter ISO code STRONGLY RECOMMENDED
* @property string $zip Zip or postal code, recommended for address validation
* @property string $phone Phone number
* @property string $vat_number Customer's VAT Number
* @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.
* @property string $verification_value Security code or CVV, 3-4 digits STRONGLY RECOMMENDED
* @property string $ip_address Customer's IP address when updating their Billing Information STRONGLY RECOMMENDED
*/
class Recurly_BillingInfo extends Recurly_Resource
{
public static function get($accountCode, $client = null) {
Expand Down
35 changes: 34 additions & 1 deletion lib/recurly/plan.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
<?php

/**
* class Recurly_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 Recurly_CurrencyList $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 Recurly_CurrencyList $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 string $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 string $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 Recurly_CurrencyList $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 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.
*/
class Recurly_Plan extends Recurly_Resource
{
function __construct() {
Expand Down
41 changes: 40 additions & 1 deletion lib/recurly/transaction.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
<?php

/**
* Class Recurly_Transaction
* @property string $uuid Transaction's unique identifier.
* @property Recurly_Stub $account The URL of the account associated with the transaction. Run get() to pull back a Recurly_Account
* @property Recurly_Stub $invoice The URL of the invoice associated with the transaction. Run get() to pull back a Recurly_Invoice
* @property Recurly_Stub $subscription The URL of the subscription associated with the transaction. Run get() to pull back a Recurly_Subscription
* @property string $original_transaction For refund transactions, the URL of the original transaction. Run get() to pull back a Recurly_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 mixed[] $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. Retrieve data by accessing the array details[0]->fieldname i.e. details[0]->email
* @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).
*/
class Recurly_Transaction extends Recurly_Resource
{
/**
* Get Tranasction by uuid
*
* @param string $uuid
* @param Recurly_Client $client optional
* @return Recurly_Transaction
*/
public static function get($uuid, $client = null) {
return Recurly_Base::_get(Recurly_Transaction::uriForTransaction($uuid), $client);
}
Expand Down