Skip to content

Commit

Permalink
Add refunding and cancelling a registration (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
billhorsman authored Aug 30, 2024
1 parent a471d84 commit aad798e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/doc_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,22 @@ def list_attributes(attributes, skip: [], context: nil)
concat "</ul>\n"
end

def list_simple_attributes(attributes)
concat "<ul class=\"attribute-list\">"
attributes.each do |name, hash|
concat "<li>"
concat "<div>"
concat "<code class=\"name\">#{name}</code>"
concat "<span class=\"type\">#{hash[:type]}</span>" if hash[:type].present?
concat "<span class=\"required\">required</span>" if hash[:required]
concat "</div>"
concat "<div class=\"attribute-description\">#{hash[:description].gsub(/`([^`]+)`/, '<code>\1</code>')}</div>" if hash[:description].present?
concat "</li>"
end
concat "</ul>"
nil
end

def list_attribute(name, hash, skip:, context:)
concat "<li><div>"
concat "<code class=\"name\">#{name}</code>"
Expand Down
16 changes: 16 additions & 0 deletions source/includes/admin_api/3.1/_registrations.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,19 @@ Changes the `receipt_paid` attribute to true.
Show that a `Registration` has NOT been paid. Useful if you are allowing your customers to pay by invoice. You wouldn't normally need to do this but might do if you [marked it as paid](/docs/api/admin/#registrations-mark-a-registration-as-paid) by mistake.

Changes the `receipt_paid` attribute to false.

## Refund a Registration

<%= show_url "registrations/:registration_slug/refunds", method: :post, params: { refund: { manual: false } }%>
<%= show_url_key "POST registrations/:registration_slug/refunds" %>

### Parameters

<%= list_simple_attributes "refund[manual]": { type: :boolean, description: "Set to true if you don't want to refund via the payment provider or false if you do.", required: true } %>

## Cancel a Registration

<%= show_url "registrations/:registration_slug/cancellation", method: :post %>
<%= show_url_key "POST registrations/:registration_slug/cancellation" %>

This will cancel a registration and void any associated tickets.

0 comments on commit aad798e

Please sign in to comment.