Skip to content

Commit

Permalink
Changes from gocardless/gocardless-pro-ruby-template@a4d2ecc39320baac…
Browse files Browse the repository at this point in the history
…ae12ad79c032d237fc6ed0a5
  • Loading branch information
gocardless-robot committed Dec 2, 2024
1 parent da83a84 commit 17b1b00
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 69 deletions.
36 changes: 28 additions & 8 deletions lib/gocardless_pro/resources/billing_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ module GoCardlessPro
module Resources
# Represents an instance of a billing_request resource returned from the API

# Billing Requests help create resources that require input or action from a
# customer. An example of required input might be additional customer
# billing
# details, while an action would be asking a customer to authorise a payment
# using their mobile banking app.
# Billing Requests help create resources that require input or action from
# a customer. An example of required input might be additional customer
# billing details, while an action would be asking a customer to authorise a
# payment using their mobile banking app.
#
# See [Billing Requests:
# Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
# for how-to's, explanations and tutorials.
# for how-to's, explanations and tutorials. <p
# class="notice"><strong>Important</strong>: All properties associated with
# `subscription_request` and `instalment_schedule_request` are only
# supported for ACH and PAD schemes.</p>
class BillingRequest
attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :mandate_request, :metadata,
:payment_request, :purpose_code, :resources, :status
attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :instalment_schedule_request,
:mandate_request, :metadata, :payment_request, :purpose_code, :resources, :status, :subscription_request

# Initialize a billing_request resource instance
# @param object [Hash] an object returned from the API
Expand All @@ -33,13 +35,15 @@ def initialize(object, response = nil)
@fallback_enabled = object['fallback_enabled']
@fallback_occurred = object['fallback_occurred']
@id = object['id']
@instalment_schedule_request = object['instalment_schedule_request']
@links = object['links']
@mandate_request = object['mandate_request']
@metadata = object['metadata']
@payment_request = object['payment_request']
@purpose_code = object['purpose_code']
@resources = object['resources']
@status = object['status']
@subscription_request = object['subscription_request']
@response = response
end

Expand Down Expand Up @@ -82,6 +86,14 @@ def customer_billing_detail
@links['customer_billing_detail']
end

def instalment_schedule_request
@links['instalment_schedule_request']
end

def instalment_schedule_request_instalment_schedule
@links['instalment_schedule_request_instalment_schedule']
end

def mandate_request
@links['mandate_request']
end
Expand All @@ -105,6 +117,14 @@ def payment_request
def payment_request_payment
@links['payment_request_payment']
end

def subscription_request
@links['subscription_request']
end

def subscription_request_subscription
@links['subscription_request_subscription']
end
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion lib/gocardless_pro/services/billing_requests_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ module GoCardlessPro
module Services
# Service for making requests to the BillingRequest endpoints
class BillingRequestsService < BaseService
#
# <p class="notice"><strong>Important</strong>: All properties associated with
# `subscription_request` and `instalment_schedule_request` are only supported
# for ACH and PAD schemes.</p>
# Example URL: /billing_requests
# @param options [Hash] parameters as a hash, under a params key.
def create(options = {})
Expand Down
Loading

0 comments on commit 17b1b00

Please sign in to comment.