Class: Recurly::Client
- Inherits:
-
Object
- Object
- Recurly::Client
- Defined in:
- lib/recurly/client.rb,
lib/recurly/client/operations.rb
Constant Summary collapse
- BASE_HOST =
"v3.recurly.com"
- BASE_PORT =
443
- CA_FILE =
File.join(File.dirname(__FILE__), "../data/ca-certificates.crt")
- BINARY_TYPES =
[ "application/pdf", ].freeze
- JSON_CONTENT_TYPE =
"application/json"
- MAX_RETRIES =
3
- LOG_LEVELS =
%i(debug info warn error fatal).freeze
- BASE36_ALPHABET =
(("0".."9").to_a + ("a".."z").to_a).freeze
- REQUEST_OPTIONS =
[:headers].freeze
Class Attribute Summary collapse
Instance Method Summary collapse
- #api_version ⇒ Object
-
#cancel_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Cancel a subscription.
-
#collect_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Collect a pending or past due, automatic invoice.
-
#convert_trial(subscription_id:, **options) ⇒ Resources::Subscription
Convert trial subscription.
-
#create_account(body:, **options) ⇒ Resources::Account
Create an account.
-
#create_billing_info(account_id:, body:, **options) ⇒ Resources::BillingInfo
Set an account's billing information when the wallet feature is enabled.
-
#create_coupon(body:, **options) ⇒ Resources::Coupon
Create a new coupon.
-
#create_coupon_redemption(account_id:, body:, **options) ⇒ Resources::CouponRedemption
Generate an active coupon redemption on an account or subscription.
-
#create_invoice(account_id:, body:, **options) ⇒ Resources::InvoiceCollection
Create an invoice for pending line items.
-
#create_item(body:, **options) ⇒ Resources::Item
Create a new item.
-
#create_line_item(account_id:, body:, **options) ⇒ Resources::LineItem
Create a new line item for the account.
-
#create_measured_unit(body:, **options) ⇒ Resources::MeasuredUnit
Create a new measured unit.
-
#create_plan(body:, **options) ⇒ Resources::Plan
Create a plan.
-
#create_plan_add_on(plan_id:, body:, **options) ⇒ Resources::AddOn
Create an add-on.
-
#create_purchase(body:, **options) ⇒ Resources::InvoiceCollection
Create a new purchase.
-
#create_shipping_address(account_id:, body:, **options) ⇒ Resources::ShippingAddress
Create a new shipping address for the account.
-
#create_shipping_method(body:, **options) ⇒ Resources::ShippingMethod
Create a new shipping method.
-
#create_subscription(body:, **options) ⇒ Resources::Subscription
Create a new subscription.
-
#create_subscription_change(subscription_id:, body:, **options) ⇒ Resources::SubscriptionChange
Create a new subscription change.
-
#create_usage(subscription_id:, add_on_id:, body:, **options) ⇒ Resources::Usage
Log a usage record on this subscription add-on.
-
#deactivate_account(account_id:, **options) ⇒ Resources::Account
Deactivate an account.
-
#deactivate_coupon(coupon_id:, **options) ⇒ Resources::Coupon
Expire a coupon.
-
#deactivate_item(item_id:, **options) ⇒ Resources::Item
Deactivate an item.
-
#deactivate_shipping_method(shipping_method_id:, **options) ⇒ Resources::ShippingMethod
Deactivate a shipping method.
-
#deactivate_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Deactivate a unique coupon code.
-
#fail_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Mark an open invoice as failed.
-
#get_a_billing_info(account_id:, billing_info_id:, **options) ⇒ Resources::BillingInfo
Fetch a billing info.
-
#get_account(account_id:, **options) ⇒ Resources::Account
Fetch an account.
-
#get_account_acquisition(account_id:, **options) ⇒ Resources::AccountAcquisition
Fetch an account's acquisition data.
-
#get_account_balance(account_id:, **options) ⇒ Resources::AccountBalance
Fetch an account's balance and past due status.
-
#get_account_note(account_id:, account_note_id:, **options) ⇒ Resources::AccountNote
Fetch an account note.
-
#get_active_coupon_redemption(account_id:, **options) ⇒ Resources::CouponRedemption
Show the coupon redemption that is active on an account.
-
#get_add_on(add_on_id:, **options) ⇒ Resources::AddOn
Fetch an add-on.
-
#get_billing_info(account_id:, **options) ⇒ Resources::BillingInfo
Fetch an account's billing information.
-
#get_coupon(coupon_id:, **options) ⇒ Resources::Coupon
Fetch a coupon.
-
#get_credit_payment(credit_payment_id:, **options) ⇒ Resources::CreditPayment
Fetch a credit payment.
-
#get_custom_field_definition(custom_field_definition_id:, **options) ⇒ Resources::CustomFieldDefinition
Fetch an custom field definition.
-
#get_export_dates(**options) ⇒ Resources::ExportDates
List the dates that have an available export to download.
-
#get_export_files(export_date:, **options) ⇒ Resources::ExportFiles
List of the export files that are available to download.
-
#get_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Fetch an invoice.
-
#get_invoice_pdf(invoice_id:, **options) ⇒ Resources::BinaryFile
Fetch an invoice as a PDF.
-
#get_item(item_id:, **options) ⇒ Resources::Item
Fetch an item.
-
#get_line_item(line_item_id:, **options) ⇒ Resources::LineItem
Fetch a line item.
-
#get_measured_unit(measured_unit_id:, **options) ⇒ Resources::MeasuredUnit
Fetch a measured unit.
-
#get_plan(plan_id:, **options) ⇒ Resources::Plan
Fetch a plan.
-
#get_plan_add_on(plan_id:, add_on_id:, **options) ⇒ Resources::AddOn
Fetch a plan's add-on.
-
#get_shipping_address(account_id:, shipping_address_id:, **options) ⇒ Resources::ShippingAddress
Fetch an account's shipping address.
-
#get_shipping_method(id:, **options) ⇒ Resources::ShippingMethod
Fetch a shipping method.
-
#get_site(site_id:) ⇒ Resources::Site
Fetch a site.
-
#get_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Fetch a subscription.
-
#get_subscription_change(subscription_id:, **options) ⇒ Resources::SubscriptionChange
Fetch a subscription's pending change.
-
#get_transaction(transaction_id:, **options) ⇒ Resources::Transaction
Fetch a transaction.
-
#get_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Fetch a unique coupon code.
-
#get_usage(usage_id:, **options) ⇒ Resources::Usage
Get a usage record.
-
#initialize(api_key:, site_id: nil, subdomain: nil, logger: nil) {|_self| ... } ⇒ Client
constructor
Initialize a client.
-
#list_account_acquisition(**options) ⇒ Pager<Resources::AccountAcquisition>
List a site's account acquisition data.
-
#list_account_coupon_redemptions(account_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions for an account.
-
#list_account_credit_payments(account_id:, **options) ⇒ Pager<Resources::CreditPayment>
List an account's credit payments.
-
#list_account_invoices(account_id:, **options) ⇒ Pager<Resources::Invoice>
List an account's invoices.
-
#list_account_line_items(account_id:, **options) ⇒ Pager<Resources::LineItem>
List an account's line items.
-
#list_account_notes(account_id:, **options) ⇒ Pager<Resources::AccountNote>
Fetch a list of an account's notes.
-
#list_account_subscriptions(account_id:, **options) ⇒ Pager<Resources::Subscription>
List an account's subscriptions.
-
#list_account_transactions(account_id:, **options) ⇒ Pager<Resources::Transaction>
List an account's transactions.
-
#list_accounts(**options) ⇒ Pager<Resources::Account>
List a site's accounts.
-
#list_add_ons(**options) ⇒ Pager<Resources::AddOn>
List a site's add-ons.
-
#list_billing_infos(account_id:, **options) ⇒ Pager<Resources::BillingInfo>
Get the list of billing information associated with an account.
-
#list_child_accounts(account_id:, **options) ⇒ Pager<Resources::Account>
List an account's child accounts.
-
#list_coupons(**options) ⇒ Pager<Resources::Coupon>
List a site's coupons.
-
#list_credit_payments(**options) ⇒ Pager<Resources::CreditPayment>
List a site's credit payments.
-
#list_custom_field_definitions(**options) ⇒ Pager<Resources::CustomFieldDefinition>
List a site's custom field definitions.
-
#list_invoice_coupon_redemptions(invoice_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions applied to an invoice.
-
#list_invoice_line_items(invoice_id:, **options) ⇒ Pager<Resources::LineItem>
List an invoice's line items.
-
#list_invoices(**options) ⇒ Pager<Resources::Invoice>
List a site's invoices.
-
#list_items(**options) ⇒ Pager<Resources::Item>
List a site's items.
-
#list_line_items(**options) ⇒ Pager<Resources::LineItem>
List a site's line items.
-
#list_measured_unit(**options) ⇒ Pager<Resources::MeasuredUnit>
List a site's measured units.
-
#list_plan_add_ons(plan_id:, **options) ⇒ Pager<Resources::AddOn>
List a plan's add-ons.
-
#list_plans(**options) ⇒ Pager<Resources::Plan>
List a site's plans.
-
#list_related_invoices(invoice_id:, **options) ⇒ Pager<Resources::Invoice>
List an invoice's related credit or charge invoices.
-
#list_shipping_addresses(account_id:, **options) ⇒ Pager<Resources::ShippingAddress>
Fetch a list of an account's shipping addresses.
-
#list_shipping_methods(**options) ⇒ Pager<Resources::ShippingMethod>
List a site's shipping methods.
-
#list_sites(**options) ⇒ Pager<Resources::Site>
List sites.
-
#list_subscription_coupon_redemptions(subscription_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions for a subscription.
-
#list_subscription_invoices(subscription_id:, **options) ⇒ Pager<Resources::Invoice>
List a subscription's invoices.
-
#list_subscription_line_items(subscription_id:, **options) ⇒ Pager<Resources::LineItem>
List a subscription's line items.
-
#list_subscriptions(**options) ⇒ Pager<Resources::Subscription>
List a site's subscriptions.
-
#list_transactions(**options) ⇒ Pager<Resources::Transaction>
List a site's transactions.
-
#list_unique_coupon_codes(coupon_id:, **options) ⇒ Pager<Resources::UniqueCouponCode>
List unique coupon codes associated with a bulk coupon.
-
#list_usage(subscription_id:, add_on_id:, **options) ⇒ Pager<Resources::Usage>
List a subscription add-on's usage records.
-
#mark_invoice_successful(invoice_id:, **options) ⇒ Resources::Invoice
Mark an open invoice as successful.
-
#modify_subscription(subscription_id:, body:, **options) ⇒ Resources::Subscription
Modify a subscription.
-
#pause_subscription(subscription_id:, body:, **options) ⇒ Resources::Subscription
Pause subscription.
-
#preview_invoice(account_id:, body:, **options) ⇒ Resources::InvoiceCollection
Preview new invoice for pending line items.
-
#preview_purchase(body:, **options) ⇒ Resources::InvoiceCollection
Preview a new purchase.
-
#preview_subscription_change(subscription_id:, body:, **options) ⇒ Resources::SubscriptionChangePreview
Preview a new subscription change.
-
#put_invoice(invoice_id:, body:, **options) ⇒ Resources::Invoice
Update an invoice.
-
#reactivate_account(account_id:, **options) ⇒ Resources::Account
Reactivate an inactive account.
-
#reactivate_item(item_id:, **options) ⇒ Resources::Item
Reactivate an inactive item.
-
#reactivate_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Reactivate a canceled subscription.
-
#reactivate_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Restore a unique coupon code.
-
#record_external_transaction(invoice_id:, body:, **options) ⇒ Resources::Transaction
Record an external payment for a manual invoices.
-
#refund_invoice(invoice_id:, body:, **options) ⇒ Resources::Invoice
Refund an invoice.
-
#remove_a_billing_info(account_id:, billing_info_id:, **options) ⇒ Resources::Empty
Remove an account's billing information.
-
#remove_account_acquisition(account_id:, **options) ⇒ Resources::Empty
Remove an account's acquisition data.
-
#remove_billing_info(account_id:, **options) ⇒ Resources::Empty
Remove an account's billing information.
-
#remove_coupon_redemption(account_id:, **options) ⇒ Resources::CouponRedemption
Delete the active coupon redemption from an account.
-
#remove_line_item(line_item_id:, **options) ⇒ Resources::Empty
Delete an uninvoiced line item.
-
#remove_measured_unit(measured_unit_id:, **options) ⇒ Resources::MeasuredUnit
Remove a measured unit.
-
#remove_plan(plan_id:, **options) ⇒ Resources::Plan
Remove a plan.
-
#remove_plan_add_on(plan_id:, add_on_id:, **options) ⇒ Resources::AddOn
Remove an add-on.
-
#remove_shipping_address(account_id:, shipping_address_id:, **options) ⇒ Resources::Empty
Remove an account's shipping address.
-
#remove_subscription_change(subscription_id:, **options) ⇒ Resources::Empty
Delete the pending subscription change.
-
#remove_usage(usage_id:, **options) ⇒ Resources::Empty
Delete a usage record.
-
#reopen_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Reopen a closed, manual invoice.
-
#restore_coupon(coupon_id:, body:, **options) ⇒ Resources::Coupon
Restore an inactive coupon.
-
#resume_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Resume subscription.
-
#terminate_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Terminate a subscription.
-
#update_a_billing_info(account_id:, billing_info_id:, body:, **options) ⇒ Resources::BillingInfo
Update an account's billing information.
-
#update_account(account_id:, body:, **options) ⇒ Resources::Account
Modify an account.
-
#update_account_acquisition(account_id:, body:, **options) ⇒ Resources::AccountAcquisition
Update an account's acquisition data.
-
#update_billing_info(account_id:, body:, **options) ⇒ Resources::BillingInfo
Set an account's billing information.
-
#update_coupon(coupon_id:, body:, **options) ⇒ Resources::Coupon
Update an active coupon.
-
#update_item(item_id:, body:, **options) ⇒ Resources::Item
Update an active item.
-
#update_measured_unit(measured_unit_id:, body:, **options) ⇒ Resources::MeasuredUnit
Update a measured unit.
-
#update_plan(plan_id:, body:, **options) ⇒ Resources::Plan
Update a plan.
-
#update_plan_add_on(plan_id:, add_on_id:, body:, **options) ⇒ Resources::AddOn
Update an add-on.
-
#update_shipping_address(account_id:, shipping_address_id:, body:, **options) ⇒ Resources::ShippingAddress
Update an account's shipping address.
-
#update_shipping_method(shipping_method_id:, body:, **options) ⇒ Resources::ShippingMethod
Update an active Shipping Method.
-
#update_usage(usage_id:, body:, **options) ⇒ Resources::Usage
Update a usage record.
-
#void_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Void a credit invoice.
Constructor Details
#initialize(api_key:, site_id: nil, subdomain: nil, logger: nil) {|_self| ... } ⇒ Client
Initialize a client. It requires an API key.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/recurly/client.rb', line 50 def initialize(api_key:, site_id: nil, subdomain: nil, logger: nil) set_site_id(site_id, subdomain) set_api_key(api_key) if logger.nil? @logger = Logger.new(STDOUT).tap do |l| l.level = Logger::WARN end else unless LOG_LEVELS.all? { |lev| logger.respond_to?(lev) } raise ArgumentError, "You must pass in a logger implementation that responds to the following messages: #{LOG_LEVELS}" end @logger = logger end if @logger.level < Logger::INFO msg = <<-MSG The Recurly logger should not be initialized beyond the level INFO. It is currently configured to emit headers and request / response bodies. This has the potential to leak PII and other sensitive information and should never be used in production. MSG log_warn("SECURITY_WARNING", message: msg) end # execute block with this client if given yield(self) if block_given? end |
Class Attribute Details
.connection_pool ⇒ Recurly::ConnectionPool
142 143 144 |
# File 'lib/recurly/client.rb', line 142 def connection_pool @connection_pool end |
Instance Method Details
#api_version ⇒ Object
7 8 9 |
# File 'lib/recurly/client/operations.rb', line 7 def api_version "v2019-10-10" end |
#cancel_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Cancel a subscription
3098 3099 3100 3101 |
# File 'lib/recurly/client/operations.rb', line 3098 def cancel_subscription(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/cancel", subscription_id: subscription_id) put(path, [:body], Requests::SubscriptionCancel, **) end |
#collect_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Collect a pending or past due, automatic invoice
2058 2059 2060 2061 |
# File 'lib/recurly/client/operations.rb', line 2058 def collect_invoice(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/collect", invoice_id: invoice_id) put(path, [:body], Requests::InvoiceCollect, **) end |
#convert_trial(subscription_id:, **options) ⇒ Resources::Subscription
Convert trial subscription
3192 3193 3194 3195 |
# File 'lib/recurly/client/operations.rb', line 3192 def convert_trial(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/convert_trial", subscription_id: subscription_id) put(path, **) end |
#create_account(body:, **options) ⇒ Resources::Account
Create an account
160 161 162 163 |
# File 'lib/recurly/client/operations.rb', line 160 def create_account(body:, **) path = interpolate_path("/accounts") post(path, body, Requests::AccountCreate, **) end |
#create_billing_info(account_id:, body:, **options) ⇒ Resources::BillingInfo
Set an account's billing information when the wallet feature is enabled
493 494 495 496 |
# File 'lib/recurly/client/operations.rb', line 493 def create_billing_info(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id) post(path, body, Requests::BillingInfoCreate, **) end |
#create_coupon(body:, **options) ⇒ Resources::Coupon
Create a new coupon
1387 1388 1389 1390 |
# File 'lib/recurly/client/operations.rb', line 1387 def create_coupon(body:, **) path = interpolate_path("/coupons") post(path, body, Requests::CouponCreate, **) end |
#create_coupon_redemption(account_id:, body:, **options) ⇒ Resources::CouponRedemption
Generate an active coupon redemption on an account or subscription
638 639 640 641 |
# File 'lib/recurly/client/operations.rb', line 638 def create_coupon_redemption(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id) post(path, body, Requests::CouponRedemptionCreate, **) end |
#create_invoice(account_id:, body:, **options) ⇒ Resources::InvoiceCollection
Create an invoice for pending line items
778 779 780 781 |
# File 'lib/recurly/client/operations.rb', line 778 def create_invoice(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/invoices", account_id: account_id) post(path, body, Requests::InvoiceCreate, **) end |
#create_item(body:, **options) ⇒ Resources::Item
Create a new item
1714 1715 1716 1717 |
# File 'lib/recurly/client/operations.rb', line 1714 def create_item(body:, **) path = interpolate_path("/items") post(path, body, Requests::ItemCreate, **) end |
#create_line_item(account_id:, body:, **options) ⇒ Resources::LineItem
Create a new line item for the account
890 891 892 893 |
# File 'lib/recurly/client/operations.rb', line 890 def create_line_item(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/line_items", account_id: account_id) post(path, body, Requests::LineItemCreate, **) end |
#create_measured_unit(body:, **options) ⇒ Resources::MeasuredUnit
Create a new measured unit
1866 1867 1868 1869 |
# File 'lib/recurly/client/operations.rb', line 1866 def create_measured_unit(body:, **) path = interpolate_path("/measured_units") post(path, body, Requests::MeasuredUnitCreate, **) end |
#create_plan(body:, **options) ⇒ Resources::Plan
Create a plan
2489 2490 2491 2492 |
# File 'lib/recurly/client/operations.rb', line 2489 def create_plan(body:, **) path = interpolate_path("/plans") post(path, body, Requests::PlanCreate, **) end |
#create_plan_add_on(plan_id:, body:, **options) ⇒ Resources::AddOn
Create an add-on
2644 2645 2646 2647 |
# File 'lib/recurly/client/operations.rb', line 2644 def create_plan_add_on(plan_id:, body:, **) path = interpolate_path("/plans/{plan_id}/add_ons", plan_id: plan_id) post(path, body, Requests::AddOnCreate, **) end |
#create_purchase(body:, **options) ⇒ Resources::InvoiceCollection
Create a new purchase
3681 3682 3683 3684 |
# File 'lib/recurly/client/operations.rb', line 3681 def create_purchase(body:, **) path = interpolate_path("/purchases") post(path, body, Requests::PurchaseCreate, **) end |
#create_shipping_address(account_id:, body:, **options) ⇒ Resources::ShippingAddress
Create a new shipping address for the account
1028 1029 1030 1031 |
# File 'lib/recurly/client/operations.rb', line 1028 def create_shipping_address(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/shipping_addresses", account_id: account_id) post(path, body, Requests::ShippingAddressCreate, **) end |
#create_shipping_method(body:, **options) ⇒ Resources::ShippingMethod
Create a new shipping method
2855 2856 2857 2858 |
# File 'lib/recurly/client/operations.rb', line 2855 def create_shipping_method(body:, **) path = interpolate_path("/shipping_methods") post(path, body, Requests::ShippingMethodCreate, **) end |
#create_subscription(body:, **options) ⇒ Resources::Subscription
Create a new subscription
2980 2981 2982 2983 |
# File 'lib/recurly/client/operations.rb', line 2980 def create_subscription(body:, **) path = interpolate_path("/subscriptions") post(path, body, Requests::SubscriptionCreate, **) end |
#create_subscription_change(subscription_id:, body:, **options) ⇒ Resources::SubscriptionChange
Create a new subscription change
3248 3249 3250 3251 |
# File 'lib/recurly/client/operations.rb', line 3248 def create_subscription_change(subscription_id:, body:, **) path = interpolate_path("/subscriptions/{subscription_id}/change", subscription_id: subscription_id) post(path, body, Requests::SubscriptionChangeCreate, **) end |
#create_usage(subscription_id:, add_on_id:, body:, **options) ⇒ Resources::Usage
Log a usage record on this subscription add-on
3489 3490 3491 3492 |
# File 'lib/recurly/client/operations.rb', line 3489 def create_usage(subscription_id:, add_on_id:, body:, **) path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id) post(path, body, Requests::UsageCreate, **) end |
#deactivate_account(account_id:, **options) ⇒ Resources::Account
Deactivate an account
237 238 239 240 |
# File 'lib/recurly/client/operations.rb', line 237 def deactivate_account(account_id:, **) path = interpolate_path("/accounts/{account_id}", account_id: account_id) delete(path, **) end |
#deactivate_coupon(coupon_id:, **options) ⇒ Resources::Coupon
Expire a coupon
1460 1461 1462 1463 |
# File 'lib/recurly/client/operations.rb', line 1460 def deactivate_coupon(coupon_id:, **) path = interpolate_path("/coupons/{coupon_id}", coupon_id: coupon_id) delete(path, **) end |
#deactivate_item(item_id:, **options) ⇒ Resources::Item
Deactivate an item
1791 1792 1793 1794 |
# File 'lib/recurly/client/operations.rb', line 1791 def deactivate_item(item_id:, **) path = interpolate_path("/items/{item_id}", item_id: item_id) delete(path, **) end |
#deactivate_shipping_method(shipping_method_id:, **options) ⇒ Resources::ShippingMethod
Deactivate a shipping method
2898 2899 2900 2901 |
# File 'lib/recurly/client/operations.rb', line 2898 def deactivate_shipping_method(shipping_method_id:, **) path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id) delete(path, **) end |
#deactivate_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Deactivate a unique coupon code
3627 3628 3629 3630 |
# File 'lib/recurly/client/operations.rb', line 3627 def deactivate_unique_coupon_code(unique_coupon_code_id:, **) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id) delete(path, **) end |
#fail_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Mark an open invoice as failed
2081 2082 2083 2084 |
# File 'lib/recurly/client/operations.rb', line 2081 def fail_invoice(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/mark_failed", invoice_id: invoice_id) put(path, **) end |
#get_a_billing_info(account_id:, billing_info_id:, **options) ⇒ Resources::BillingInfo
Fetch a billing info
508 509 510 511 |
# File 'lib/recurly/client/operations.rb', line 508 def get_a_billing_info(account_id:, billing_info_id:, **) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) get(path, **) end |
#get_account(account_id:, **options) ⇒ Resources::Account
Fetch an account
183 184 185 186 |
# File 'lib/recurly/client/operations.rb', line 183 def get_account(account_id:, **) path = interpolate_path("/accounts/{account_id}", account_id: account_id) get(path, **) end |
#get_account_acquisition(account_id:, **options) ⇒ Resources::AccountAcquisition
Fetch an account's acquisition data
260 261 262 263 |
# File 'lib/recurly/client/operations.rb', line 260 def get_account_acquisition(account_id:, **) path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id) get(path, **) end |
#get_account_balance(account_id:, **options) ⇒ Resources::AccountBalance
Fetch an account's balance and past due status
365 366 367 368 |
# File 'lib/recurly/client/operations.rb', line 365 def get_account_balance(account_id:, **) path = interpolate_path("/accounts/{account_id}/balance", account_id: account_id) get(path, **) end |
#get_account_note(account_id:, account_note_id:, **options) ⇒ Resources::AccountNote
Fetch an account note
948 949 950 951 |
# File 'lib/recurly/client/operations.rb', line 948 def get_account_note(account_id:, account_note_id:, **) path = interpolate_path("/accounts/{account_id}/notes/{account_note_id}", account_id: account_id, account_note_id: account_note_id) get(path, **) end |
#get_active_coupon_redemption(account_id:, **options) ⇒ Resources::CouponRedemption
Show the coupon redemption that is active on an account
607 608 609 610 |
# File 'lib/recurly/client/operations.rb', line 607 def get_active_coupon_redemption(account_id:, **) path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id) get(path, **) end |
#get_add_on(add_on_id:, **options) ⇒ Resources::AddOn
Fetch an add-on
2797 2798 2799 2800 |
# File 'lib/recurly/client/operations.rb', line 2797 def get_add_on(add_on_id:, **) path = interpolate_path("/add_ons/{add_on_id}", add_on_id: add_on_id) get(path, **) end |
#get_billing_info(account_id:, **options) ⇒ Resources::BillingInfo
Fetch an account's billing information
388 389 390 391 |
# File 'lib/recurly/client/operations.rb', line 388 def get_billing_info(account_id:, **) path = interpolate_path("/accounts/{account_id}/billing_info", account_id: account_id) get(path, **) end |
#get_coupon(coupon_id:, **options) ⇒ Resources::Coupon
Fetch a coupon
1410 1411 1412 1413 |
# File 'lib/recurly/client/operations.rb', line 1410 def get_coupon(coupon_id:, **) path = interpolate_path("/coupons/{coupon_id}", coupon_id: coupon_id) get(path, **) end |
#get_credit_payment(credit_payment_id:, **options) ⇒ Resources::CreditPayment
Fetch a credit payment
1568 1569 1570 1571 |
# File 'lib/recurly/client/operations.rb', line 1568 def get_credit_payment(credit_payment_id:, **) path = interpolate_path("/credit_payments/{credit_payment_id}", credit_payment_id: credit_payment_id) get(path, **) end |
#get_custom_field_definition(custom_field_definition_id:, **options) ⇒ Resources::CustomFieldDefinition
Fetch an custom field definition
1636 1637 1638 1639 |
# File 'lib/recurly/client/operations.rb', line 1636 def get_custom_field_definition(custom_field_definition_id:, **) path = interpolate_path("/custom_field_definitions/{custom_field_definition_id}", custom_field_definition_id: custom_field_definition_id) get(path, **) end |
#get_export_dates(**options) ⇒ Resources::ExportDates
List the dates that have an available export to download.
3745 3746 3747 3748 |
# File 'lib/recurly/client/operations.rb', line 3745 def get_export_dates(**) path = interpolate_path("/export_dates") get(path, **) end |
#get_export_files(export_date:, **options) ⇒ Resources::ExportFiles
List of the export files that are available to download.
3770 3771 3772 3773 |
# File 'lib/recurly/client/operations.rb', line 3770 def get_export_files(export_date:, **) path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date) get(path, **) end |
#get_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Fetch an invoice
1980 1981 1982 1983 |
# File 'lib/recurly/client/operations.rb', line 1980 def get_invoice(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id) get(path, **) end |
#get_invoice_pdf(invoice_id:, **options) ⇒ Resources::BinaryFile
Fetch an invoice as a PDF
2034 2035 2036 2037 |
# File 'lib/recurly/client/operations.rb', line 2034 def get_invoice_pdf(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}.pdf", invoice_id: invoice_id) get(path, **) end |
#get_item(item_id:, **options) ⇒ Resources::Item
Fetch an item
1737 1738 1739 1740 |
# File 'lib/recurly/client/operations.rb', line 1737 def get_item(item_id:, **) path = interpolate_path("/items/{item_id}", item_id: item_id) get(path, **) end |
#get_line_item(line_item_id:, **options) ⇒ Resources::LineItem
Fetch a line item
2381 2382 2383 2384 |
# File 'lib/recurly/client/operations.rb', line 2381 def get_line_item(line_item_id:, **) path = interpolate_path("/line_items/{line_item_id}", line_item_id: line_item_id) get(path, **) end |
#get_measured_unit(measured_unit_id:, **options) ⇒ Resources::MeasuredUnit
Fetch a measured unit
1880 1881 1882 1883 |
# File 'lib/recurly/client/operations.rb', line 1880 def get_measured_unit(measured_unit_id:, **) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) get(path, **) end |
#get_plan(plan_id:, **options) ⇒ Resources::Plan
Fetch a plan
2512 2513 2514 2515 |
# File 'lib/recurly/client/operations.rb', line 2512 def get_plan(plan_id:, **) path = interpolate_path("/plans/{plan_id}", plan_id: plan_id) get(path, **) end |
#get_plan_add_on(plan_id:, add_on_id:, **options) ⇒ Resources::AddOn
Fetch a plan's add-on
2670 2671 2672 2673 |
# File 'lib/recurly/client/operations.rb', line 2670 def get_plan_add_on(plan_id:, add_on_id:, **) path = interpolate_path("/plans/{plan_id}/add_ons/{add_on_id}", plan_id: plan_id, add_on_id: add_on_id) get(path, **) end |
#get_shipping_address(account_id:, shipping_address_id:, **options) ⇒ Resources::ShippingAddress
Fetch an account's shipping address
1055 1056 1057 1058 |
# File 'lib/recurly/client/operations.rb', line 1055 def get_shipping_address(account_id:, shipping_address_id:, **) path = interpolate_path("/accounts/{account_id}/shipping_addresses/{shipping_address_id}", account_id: account_id, shipping_address_id: shipping_address_id) get(path, **) end |
#get_shipping_method(id:, **options) ⇒ Resources::ShippingMethod
Fetch a shipping method
2869 2870 2871 2872 |
# File 'lib/recurly/client/operations.rb', line 2869 def get_shipping_method(id:, **) path = interpolate_path("/shipping_methods/{id}", id: id) get(path, **) end |
#get_site(site_id:) ⇒ Resources::Site
Fetch a site
64 65 66 67 |
# File 'lib/recurly/client/operations.rb', line 64 def get_site(site_id:) path = interpolate_path("/sites/{site_id}", site_id: site_id) get(path) end |
#get_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Fetch a subscription
3005 3006 3007 3008 |
# File 'lib/recurly/client/operations.rb', line 3005 def get_subscription(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id) get(path, **) end |
#get_subscription_change(subscription_id:, **options) ⇒ Resources::SubscriptionChange
Fetch a subscription's pending change
3217 3218 3219 3220 |
# File 'lib/recurly/client/operations.rb', line 3217 def get_subscription_change(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/change", subscription_id: subscription_id) get(path, **) end |
#get_transaction(transaction_id:, **options) ⇒ Resources::Transaction
Fetch a transaction
3599 3600 3601 3602 |
# File 'lib/recurly/client/operations.rb', line 3599 def get_transaction(transaction_id:, **) path = interpolate_path("/transactions/{transaction_id}", transaction_id: transaction_id) get(path, **) end |
#get_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Fetch a unique coupon code
3613 3614 3615 3616 |
# File 'lib/recurly/client/operations.rb', line 3613 def get_unique_coupon_code(unique_coupon_code_id:, **) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id) get(path, **) end |
#get_usage(usage_id:, **options) ⇒ Resources::Usage
Get a usage record
3503 3504 3505 3506 |
# File 'lib/recurly/client/operations.rb', line 3503 def get_usage(usage_id:, **) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) get(path, **) end |
#list_account_acquisition(**options) ⇒ Pager<Resources::AccountAcquisition>
List a site's account acquisition data
1309 1310 1311 1312 |
# File 'lib/recurly/client/operations.rb', line 1309 def list_account_acquisition(**) path = interpolate_path("/acquisitions") pager(path, **) end |
#list_account_coupon_redemptions(account_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions for an account
584 585 586 587 |
# File 'lib/recurly/client/operations.rb', line 584 def list_account_coupon_redemptions(account_id:, **) path = interpolate_path("/accounts/{account_id}/coupon_redemptions", account_id: account_id) pager(path, **) end |
#list_account_credit_payments(account_id:, **options) ⇒ Pager<Resources::CreditPayment>
List an account's credit payments
695 696 697 698 |
# File 'lib/recurly/client/operations.rb', line 695 def list_account_credit_payments(account_id:, **) path = interpolate_path("/accounts/{account_id}/credit_payments", account_id: account_id) pager(path, **) end |
#list_account_invoices(account_id:, **options) ⇒ Pager<Resources::Invoice>
List an account's invoices
747 748 749 750 |
# File 'lib/recurly/client/operations.rb', line 747 def list_account_invoices(account_id:, **) path = interpolate_path("/accounts/{account_id}/invoices", account_id: account_id) pager(path, **) end |
#list_account_line_items(account_id:, **options) ⇒ Pager<Resources::LineItem>
List an account's line items
858 859 860 861 |
# File 'lib/recurly/client/operations.rb', line 858 def list_account_line_items(account_id:, **) path = interpolate_path("/accounts/{account_id}/line_items", account_id: account_id) pager(path, **) end |
#list_account_notes(account_id:, **options) ⇒ Pager<Resources::AccountNote>
Fetch a list of an account's notes
921 922 923 924 |
# File 'lib/recurly/client/operations.rb', line 921 def list_account_notes(account_id:, **) path = interpolate_path("/accounts/{account_id}/notes", account_id: account_id) pager(path, **) end |
#list_account_subscriptions(account_id:, **options) ⇒ Pager<Resources::Subscription>
List an account's subscriptions
1168 1169 1170 1171 |
# File 'lib/recurly/client/operations.rb', line 1168 def list_account_subscriptions(account_id:, **) path = interpolate_path("/accounts/{account_id}/subscriptions", account_id: account_id) pager(path, **) end |
#list_account_transactions(account_id:, **options) ⇒ Pager<Resources::Transaction>
List an account's transactions
1216 1217 1218 1219 |
# File 'lib/recurly/client/operations.rb', line 1216 def list_account_transactions(account_id:, **) path = interpolate_path("/accounts/{account_id}/transactions", account_id: account_id) pager(path, **) end |
#list_accounts(**options) ⇒ Pager<Resources::Account>
List a site's accounts
111 112 113 114 |
# File 'lib/recurly/client/operations.rb', line 111 def list_accounts(**) path = interpolate_path("/accounts") pager(path, **) end |
#list_add_ons(**options) ⇒ Pager<Resources::AddOn>
List a site's add-ons
2774 2775 2776 2777 |
# File 'lib/recurly/client/operations.rb', line 2774 def list_add_ons(**) path = interpolate_path("/add_ons") pager(path, **) end |
#list_billing_infos(account_id:, **options) ⇒ Pager<Resources::BillingInfo>
Get the list of billing information associated with an account
478 479 480 481 |
# File 'lib/recurly/client/operations.rb', line 478 def list_billing_infos(account_id:, **) path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id) pager(path, **) end |
#list_child_accounts(account_id:, **options) ⇒ Pager<Resources::Account>
List an account's child accounts
1267 1268 1269 1270 |
# File 'lib/recurly/client/operations.rb', line 1267 def list_child_accounts(account_id:, **) path = interpolate_path("/accounts/{account_id}/accounts", account_id: account_id) pager(path, **) end |
#list_coupons(**options) ⇒ Pager<Resources::Coupon>
List a site's coupons
1351 1352 1353 1354 |
# File 'lib/recurly/client/operations.rb', line 1351 def list_coupons(**) path = interpolate_path("/coupons") pager(path, **) end |
#list_credit_payments(**options) ⇒ Pager<Resources::CreditPayment>
List a site's credit payments
1554 1555 1556 1557 |
# File 'lib/recurly/client/operations.rb', line 1554 def list_credit_payments(**) path = interpolate_path("/credit_payments") pager(path, **) end |
#list_custom_field_definitions(**options) ⇒ Pager<Resources::CustomFieldDefinition>
List a site's custom field definitions
1611 1612 1613 1614 |
# File 'lib/recurly/client/operations.rb', line 1611 def list_custom_field_definitions(**) path = interpolate_path("/custom_field_definitions") pager(path, **) end |
#list_invoice_coupon_redemptions(invoice_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions applied to an invoice
2258 2259 2260 2261 |
# File 'lib/recurly/client/operations.rb', line 2258 def list_invoice_coupon_redemptions(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/coupon_redemptions", invoice_id: invoice_id) pager(path, **) end |
#list_invoice_line_items(invoice_id:, **options) ⇒ Pager<Resources::LineItem>
List an invoice's line items
2214 2215 2216 2217 |
# File 'lib/recurly/client/operations.rb', line 2214 def list_invoice_line_items(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/line_items", invoice_id: invoice_id) pager(path, **) end |
#list_invoices(**options) ⇒ Pager<Resources::Invoice>
List a site's invoices
1957 1958 1959 1960 |
# File 'lib/recurly/client/operations.rb', line 1957 def list_invoices(**) path = interpolate_path("/invoices") pager(path, **) end |
#list_items(**options) ⇒ Pager<Resources::Item>
List a site's items
1679 1680 1681 1682 |
# File 'lib/recurly/client/operations.rb', line 1679 def list_items(**) path = interpolate_path("/items") pager(path, **) end |
#list_line_items(**options) ⇒ Pager<Resources::LineItem>
List a site's line items
2358 2359 2360 2361 |
# File 'lib/recurly/client/operations.rb', line 2358 def list_line_items(**) path = interpolate_path("/line_items") pager(path, **) end |
#list_measured_unit(**options) ⇒ Pager<Resources::MeasuredUnit>
List a site's measured units
1852 1853 1854 1855 |
# File 'lib/recurly/client/operations.rb', line 1852 def list_measured_unit(**) path = interpolate_path("/measured_units") pager(path, **) end |
#list_plan_add_ons(plan_id:, **options) ⇒ Pager<Resources::AddOn>
List a plan's add-ons
2609 2610 2611 2612 |
# File 'lib/recurly/client/operations.rb', line 2609 def list_plan_add_ons(plan_id:, **) path = interpolate_path("/plans/{plan_id}/add_ons", plan_id: plan_id) pager(path, **) end |
#list_plans(**options) ⇒ Pager<Resources::Plan>
List a site's plans
2449 2450 2451 2452 |
# File 'lib/recurly/client/operations.rb', line 2449 def list_plans(**) path = interpolate_path("/plans") pager(path, **) end |
#list_related_invoices(invoice_id:, **options) ⇒ Pager<Resources::Invoice>
List an invoice's related credit or charge invoices
2280 2281 2282 2283 |
# File 'lib/recurly/client/operations.rb', line 2280 def (invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/related_invoices", invoice_id: invoice_id) pager(path, **) end |
#list_shipping_addresses(account_id:, **options) ⇒ Pager<Resources::ShippingAddress>
Fetch a list of an account's shipping addresses
994 995 996 997 |
# File 'lib/recurly/client/operations.rb', line 994 def list_shipping_addresses(account_id:, **) path = interpolate_path("/accounts/{account_id}/shipping_addresses", account_id: account_id) pager(path, **) end |
#list_shipping_methods(**options) ⇒ Pager<Resources::ShippingMethod>
List a site's shipping methods
2841 2842 2843 2844 |
# File 'lib/recurly/client/operations.rb', line 2841 def list_shipping_methods(**) path = interpolate_path("/shipping_methods") pager(path, **) end |
#list_sites(**options) ⇒ Pager<Resources::Site>
List sites
42 43 44 45 |
# File 'lib/recurly/client/operations.rb', line 42 def list_sites(**) path = "/sites" pager(path, **) end |
#list_subscription_coupon_redemptions(subscription_id:, **options) ⇒ Pager<Resources::CouponRedemption>
Show the coupon redemptions for a subscription
3433 3434 3435 3436 |
# File 'lib/recurly/client/operations.rb', line 3433 def list_subscription_coupon_redemptions(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/coupon_redemptions", subscription_id: subscription_id) pager(path, **) end |
#list_subscription_invoices(subscription_id:, **options) ⇒ Pager<Resources::Invoice>
List a subscription's invoices
3340 3341 3342 3343 |
# File 'lib/recurly/client/operations.rb', line 3340 def list_subscription_invoices(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/invoices", subscription_id: subscription_id) pager(path, **) end |
#list_subscription_line_items(subscription_id:, **options) ⇒ Pager<Resources::LineItem>
List a subscription's line items
3389 3390 3391 3392 |
# File 'lib/recurly/client/operations.rb', line 3389 def list_subscription_line_items(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/line_items", subscription_id: subscription_id) pager(path, **) end |
#list_subscriptions(**options) ⇒ Pager<Resources::Subscription>
List a site's subscriptions
2946 2947 2948 2949 |
# File 'lib/recurly/client/operations.rb', line 2946 def list_subscriptions(**) path = interpolate_path("/subscriptions") pager(path, **) end |
#list_transactions(**options) ⇒ Pager<Resources::Transaction>
List a site's transactions
3576 3577 3578 3579 |
# File 'lib/recurly/client/operations.rb', line 3576 def list_transactions(**) path = interpolate_path("/transactions") pager(path, **) end |
#list_unique_coupon_codes(coupon_id:, **options) ⇒ Pager<Resources::UniqueCouponCode>
List unique coupon codes associated with a bulk coupon
1524 1525 1526 1527 |
# File 'lib/recurly/client/operations.rb', line 1524 def list_unique_coupon_codes(coupon_id:, **) path = interpolate_path("/coupons/{coupon_id}/unique_coupon_codes", coupon_id: coupon_id) pager(path, **) end |
#list_usage(subscription_id:, add_on_id:, **options) ⇒ Pager<Resources::Usage>
List a subscription add-on's usage records
3473 3474 3475 3476 |
# File 'lib/recurly/client/operations.rb', line 3473 def list_usage(subscription_id:, add_on_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id) pager(path, **) end |
#mark_invoice_successful(invoice_id:, **options) ⇒ Resources::Invoice
Mark an open invoice as successful
2104 2105 2106 2107 |
# File 'lib/recurly/client/operations.rb', line 2104 def mark_invoice_successful(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/mark_successful", invoice_id: invoice_id) put(path, **) end |
#modify_subscription(subscription_id:, body:, **options) ⇒ Resources::Subscription
Modify a subscription
3036 3037 3038 3039 |
# File 'lib/recurly/client/operations.rb', line 3036 def modify_subscription(subscription_id:, body:, **) path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id) put(path, body, Requests::SubscriptionUpdate, **) end |
#pause_subscription(subscription_id:, body:, **options) ⇒ Resources::Subscription
Pause subscription
3153 3154 3155 3156 |
# File 'lib/recurly/client/operations.rb', line 3153 def pause_subscription(subscription_id:, body:, **) path = interpolate_path("/subscriptions/{subscription_id}/pause", subscription_id: subscription_id) put(path, body, Requests::SubscriptionPause, **) end |
#preview_invoice(account_id:, body:, **options) ⇒ Resources::InvoiceCollection
Preview new invoice for pending line items
809 810 811 812 |
# File 'lib/recurly/client/operations.rb', line 809 def preview_invoice(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/invoices/preview", account_id: account_id) post(path, body, Requests::InvoiceCreate, **) end |
#preview_purchase(body:, **options) ⇒ Resources::InvoiceCollection
Preview a new purchase
3721 3722 3723 3724 |
# File 'lib/recurly/client/operations.rb', line 3721 def preview_purchase(body:, **) path = interpolate_path("/purchases/preview") post(path, body, Requests::PurchaseCreate, **) end |
#preview_subscription_change(subscription_id:, body:, **options) ⇒ Resources::SubscriptionChangePreview
Preview a new subscription change
3288 3289 3290 3291 |
# File 'lib/recurly/client/operations.rb', line 3288 def preview_subscription_change(subscription_id:, body:, **) path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id) post(path, body, Requests::SubscriptionChangeCreate, **) end |
#put_invoice(invoice_id:, body:, **options) ⇒ Resources::Invoice
Update an invoice
2008 2009 2010 2011 |
# File 'lib/recurly/client/operations.rb', line 2008 def put_invoice(invoice_id:, body:, **) path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id) put(path, body, Requests::InvoiceUpdatable, **) end |
#reactivate_account(account_id:, **options) ⇒ Resources::Account
Reactivate an inactive account
342 343 344 345 |
# File 'lib/recurly/client/operations.rb', line 342 def reactivate_account(account_id:, **) path = interpolate_path("/accounts/{account_id}/reactivate", account_id: account_id) put(path, **) end |
#reactivate_item(item_id:, **options) ⇒ Resources::Item
Reactivate an inactive item
1814 1815 1816 1817 |
# File 'lib/recurly/client/operations.rb', line 1814 def reactivate_item(item_id:, **) path = interpolate_path("/items/{item_id}/reactivate", item_id: item_id) put(path, **) end |
#reactivate_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Reactivate a canceled subscription
3123 3124 3125 3126 |
# File 'lib/recurly/client/operations.rb', line 3123 def reactivate_subscription(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/reactivate", subscription_id: subscription_id) put(path, **) end |
#reactivate_unique_coupon_code(unique_coupon_code_id:, **options) ⇒ Resources::UniqueCouponCode
Restore a unique coupon code
3641 3642 3643 3644 |
# File 'lib/recurly/client/operations.rb', line 3641 def reactivate_unique_coupon_code(unique_coupon_code_id:, **) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}/restore", unique_coupon_code_id: unique_coupon_code_id) put(path, **) end |
#record_external_transaction(invoice_id:, body:, **options) ⇒ Resources::Transaction
Record an external payment for a manual invoices.
2165 2166 2167 2168 |
# File 'lib/recurly/client/operations.rb', line 2165 def record_external_transaction(invoice_id:, body:, **) path = interpolate_path("/invoices/{invoice_id}/transactions", invoice_id: invoice_id) post(path, body, Requests::ExternalTransaction, **) end |
#refund_invoice(invoice_id:, body:, **options) ⇒ Resources::Invoice
Refund an invoice
2311 2312 2313 2314 |
# File 'lib/recurly/client/operations.rb', line 2311 def refund_invoice(invoice_id:, body:, **) path = interpolate_path("/invoices/{invoice_id}/refund", invoice_id: invoice_id) post(path, body, Requests::InvoiceRefund, **) end |
#remove_a_billing_info(account_id:, billing_info_id:, **options) ⇒ Resources::Empty
Remove an account's billing information
539 540 541 542 |
# File 'lib/recurly/client/operations.rb', line 539 def remove_a_billing_info(account_id:, billing_info_id:, **) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) delete(path, **) end |
#remove_account_acquisition(account_id:, **options) ⇒ Resources::Empty
Remove an account's acquisition data
319 320 321 322 |
# File 'lib/recurly/client/operations.rb', line 319 def remove_account_acquisition(account_id:, **) path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id) delete(path, **) end |
#remove_billing_info(account_id:, **options) ⇒ Resources::Empty
Remove an account's billing information
442 443 444 445 |
# File 'lib/recurly/client/operations.rb', line 442 def remove_billing_info(account_id:, **) path = interpolate_path("/accounts/{account_id}/billing_info", account_id: account_id) delete(path, **) end |
#remove_coupon_redemption(account_id:, **options) ⇒ Resources::CouponRedemption
Delete the active coupon redemption from an account
661 662 663 664 |
# File 'lib/recurly/client/operations.rb', line 661 def remove_coupon_redemption(account_id:, **) path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id) delete(path, **) end |
#remove_line_item(line_item_id:, **options) ⇒ Resources::Empty
Delete an uninvoiced line item
2406 2407 2408 2409 |
# File 'lib/recurly/client/operations.rb', line 2406 def remove_line_item(line_item_id:, **) path = interpolate_path("/line_items/{line_item_id}", line_item_id: line_item_id) delete(path, **) end |
#remove_measured_unit(measured_unit_id:, **options) ⇒ Resources::MeasuredUnit
Remove a measured unit
1909 1910 1911 1912 |
# File 'lib/recurly/client/operations.rb', line 1909 def remove_measured_unit(measured_unit_id:, **) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) delete(path, **) end |
#remove_plan(plan_id:, **options) ⇒ Resources::Plan
Remove a plan
2562 2563 2564 2565 |
# File 'lib/recurly/client/operations.rb', line 2562 def remove_plan(plan_id:, **) path = interpolate_path("/plans/{plan_id}", plan_id: plan_id) delete(path, **) end |
#remove_plan_add_on(plan_id:, add_on_id:, **options) ⇒ Resources::AddOn
Remove an add-on
2729 2730 2731 2732 |
# File 'lib/recurly/client/operations.rb', line 2729 def remove_plan_add_on(plan_id:, add_on_id:, **) path = interpolate_path("/plans/{plan_id}/add_ons/{add_on_id}", plan_id: plan_id, add_on_id: add_on_id) delete(path, **) end |
#remove_shipping_address(account_id:, shipping_address_id:, **options) ⇒ Resources::Empty
Remove an account's shipping address
1116 1117 1118 1119 |
# File 'lib/recurly/client/operations.rb', line 1116 def remove_shipping_address(account_id:, shipping_address_id:, **) path = interpolate_path("/accounts/{account_id}/shipping_addresses/{shipping_address_id}", account_id: account_id, shipping_address_id: shipping_address_id) delete(path, **) end |
#remove_subscription_change(subscription_id:, **options) ⇒ Resources::Empty
Delete the pending subscription change
3273 3274 3275 3276 |
# File 'lib/recurly/client/operations.rb', line 3273 def remove_subscription_change(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/change", subscription_id: subscription_id) delete(path, **) end |
#remove_usage(usage_id:, **options) ⇒ Resources::Empty
Delete a usage record.
3532 3533 3534 3535 |
# File 'lib/recurly/client/operations.rb', line 3532 def remove_usage(usage_id:, **) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) delete(path, **) end |
#reopen_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Reopen a closed, manual invoice
2127 2128 2129 2130 |
# File 'lib/recurly/client/operations.rb', line 2127 def reopen_invoice(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/reopen", invoice_id: invoice_id) put(path, **) end |
#restore_coupon(coupon_id:, body:, **options) ⇒ Resources::Coupon
Restore an inactive coupon
1486 1487 1488 1489 |
# File 'lib/recurly/client/operations.rb', line 1486 def restore_coupon(coupon_id:, body:, **) path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id) put(path, body, Requests::CouponUpdate, **) end |
#resume_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Resume subscription
3178 3179 3180 3181 |
# File 'lib/recurly/client/operations.rb', line 3178 def resume_subscription(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}/resume", subscription_id: subscription_id) put(path, **) end |
#terminate_subscription(subscription_id:, **options) ⇒ Resources::Subscription
Terminate a subscription
3072 3073 3074 3075 |
# File 'lib/recurly/client/operations.rb', line 3072 def terminate_subscription(subscription_id:, **) path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id) delete(path, **) end |
#update_a_billing_info(account_id:, billing_info_id:, body:, **options) ⇒ Resources::BillingInfo
Update an account's billing information
524 525 526 527 |
# File 'lib/recurly/client/operations.rb', line 524 def update_a_billing_info(account_id:, billing_info_id:, body:, **) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) put(path, body, Requests::BillingInfoCreate, **) end |
#update_account(account_id:, body:, **options) ⇒ Resources::Account
Modify an account
214 215 216 217 |
# File 'lib/recurly/client/operations.rb', line 214 def update_account(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}", account_id: account_id) put(path, body, Requests::AccountUpdate, **) end |
#update_account_acquisition(account_id:, body:, **options) ⇒ Resources::AccountAcquisition
Update an account's acquisition data
296 297 298 299 |
# File 'lib/recurly/client/operations.rb', line 296 def update_account_acquisition(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id) put(path, body, Requests::AccountAcquisitionUpdatable, **) end |
#update_billing_info(account_id:, body:, **options) ⇒ Resources::BillingInfo
Set an account's billing information
419 420 421 422 |
# File 'lib/recurly/client/operations.rb', line 419 def update_billing_info(account_id:, body:, **) path = interpolate_path("/accounts/{account_id}/billing_info", account_id: account_id) put(path, body, Requests::BillingInfoCreate, **) end |
#update_coupon(coupon_id:, body:, **options) ⇒ Resources::Coupon
Update an active coupon
1437 1438 1439 1440 |
# File 'lib/recurly/client/operations.rb', line 1437 def update_coupon(coupon_id:, body:, **) path = interpolate_path("/coupons/{coupon_id}", coupon_id: coupon_id) put(path, body, Requests::CouponUpdate, **) end |
#update_item(item_id:, body:, **options) ⇒ Resources::Item
Update an active item
1768 1769 1770 1771 |
# File 'lib/recurly/client/operations.rb', line 1768 def update_item(item_id:, body:, **) path = interpolate_path("/items/{item_id}", item_id: item_id) put(path, body, Requests::ItemUpdate, **) end |
#update_measured_unit(measured_unit_id:, body:, **options) ⇒ Resources::MeasuredUnit
Update a measured unit
1895 1896 1897 1898 |
# File 'lib/recurly/client/operations.rb', line 1895 def update_measured_unit(measured_unit_id:, body:, **) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) put(path, body, Requests::MeasuredUnitUpdate, **) end |
#update_plan(plan_id:, body:, **options) ⇒ Resources::Plan
Update a plan
2539 2540 2541 2542 |
# File 'lib/recurly/client/operations.rb', line 2539 def update_plan(plan_id:, body:, **) path = interpolate_path("/plans/{plan_id}", plan_id: plan_id) put(path, body, Requests::PlanUpdate, **) end |
#update_plan_add_on(plan_id:, add_on_id:, body:, **options) ⇒ Resources::AddOn
Update an add-on
2702 2703 2704 2705 |
# File 'lib/recurly/client/operations.rb', line 2702 def update_plan_add_on(plan_id:, add_on_id:, body:, **) path = interpolate_path("/plans/{plan_id}/add_ons/{add_on_id}", plan_id: plan_id, add_on_id: add_on_id) put(path, body, Requests::AddOnUpdate, **) end |
#update_shipping_address(account_id:, shipping_address_id:, body:, **options) ⇒ Resources::ShippingAddress
Update an account's shipping address
1089 1090 1091 1092 |
# File 'lib/recurly/client/operations.rb', line 1089 def update_shipping_address(account_id:, shipping_address_id:, body:, **) path = interpolate_path("/accounts/{account_id}/shipping_addresses/{shipping_address_id}", account_id: account_id, shipping_address_id: shipping_address_id) put(path, body, Requests::ShippingAddressUpdate, **) end |
#update_shipping_method(shipping_method_id:, body:, **options) ⇒ Resources::ShippingMethod
Update an active Shipping Method
2884 2885 2886 2887 |
# File 'lib/recurly/client/operations.rb', line 2884 def update_shipping_method(shipping_method_id:, body:, **) path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id) put(path, body, Requests::ShippingMethodUpdate, **) end |
#update_usage(usage_id:, body:, **options) ⇒ Resources::Usage
Update a usage record
3518 3519 3520 3521 |
# File 'lib/recurly/client/operations.rb', line 3518 def update_usage(usage_id:, body:, **) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) put(path, body, Requests::UsageCreate, **) end |
#void_invoice(invoice_id:, **options) ⇒ Resources::Invoice
Void a credit invoice.
2150 2151 2152 2153 |
# File 'lib/recurly/client/operations.rb', line 2150 def void_invoice(invoice_id:, **) path = interpolate_path("/invoices/{invoice_id}/void", invoice_id: invoice_id) put(path, **) end |