Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRO-633 Add documentation for refunding and cancelling a #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading