Class: Airwallex::BillingPrice

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::Retrieve
Includes:
APIOperations::Update
Defined in:
lib/airwallex/resources/billing_price.rb

Overview

Represents a Billing price — the amount/currency/cadence attached to a BillingProduct that a BillingSubscription is created against.

Examples:

Create a simple per-unit recurring price

# Flat payload, no wrapper key. pricing_model is required (PER_UNIT /
# FLAT / GRADUATED / VOLUME — GRADUATED uses tiers: instead of
# unit_amount:). recurring: is what makes a price usable for a
# subscription.
price = Airwallex::BillingPrice.create(
  product_id: product.id,
  currency: "AUD",
  pricing_model: "PER_UNIT",
  unit_amount: 250.00,
  recurring: { period: 1, period_unit: "MONTH" }
)

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

Methods included from APIOperations::Update

included, #save, #update

Methods inherited from APIResource

#changed_attributes, #dirty?, #initialize, #inspect, #method_missing, #refresh, #refresh_from, resource_name, #respond_to_missing?, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from Airwallex::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Airwallex::APIResource

Class Method Details

.resource_pathString

Returns API resource path for billing prices.

Returns:

  • (String)

    API resource path for billing prices



26
27
28
# File 'lib/airwallex/resources/billing_price.rb', line 26

def self.resource_path
  "/api/v1/billing/prices"
end