Module: AcceptOn::API::Planning

Includes:
Utils
Included in:
Client
Defined in:
lib/accepton/api/planning.rb

Instance Method Summary collapse

Instance Method Details

#create_plan(args = {}) ⇒ AcceptOn::Plan

Creates a plan on AcceptOn

Examples:

Create a plan named "Test plan"

create_plan(name: 'Test Plan',
            currency: 'usd',
            amount: 20_00,
            period_unit: 'year')

Parameters:

  • args (Hash) (defaults to: {})

Options Hash (args):

  • :name (String)

    The plan name.

  • :currency (String)

    The currency to be used, in ISO 4217 format.

  • :amount (Numeric)

    The plan amount.

  • :period_unit (String)

    The billing frequency unit, (in month or year only).

Returns:

Raises:



26
27
28
# File 'lib/accepton/api/planning.rb', line 26

def create_plan(args = {})
  perform_post_with_object('/v1/plans', args, AcceptOn::Plan)
end