From 38d437965b5537f48401952ebfbefbe91b7a6dbd Mon Sep 17 00:00:00 2001 From: Bill Horsman Date: Fri, 30 Aug 2024 11:37:22 +0100 Subject: [PATCH] Add refunding and cancelling a registration --- lib/doc_builder.rb | 16 ++++++++++++++++ .../includes/admin_api/3.1/_registrations.md.erb | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lib/doc_builder.rb b/lib/doc_builder.rb index 84255efac6c..9a52ba4d9ba 100644 --- a/lib/doc_builder.rb +++ b/lib/doc_builder.rb @@ -298,6 +298,22 @@ def list_attributes(attributes, skip: [], context: nil) concat "\n" end +def list_simple_attributes(attributes) + concat "" + nil +end + def list_attribute(name, hash, skip:, context:) concat "
  • " concat "#{name}" diff --git a/source/includes/admin_api/3.1/_registrations.md.erb b/source/includes/admin_api/3.1/_registrations.md.erb index 394677cfa9c..f388c9995c2 100644 --- a/source/includes/admin_api/3.1/_registrations.md.erb +++ b/source/includes/admin_api/3.1/_registrations.md.erb @@ -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.