Repository navigation
Feature/reserve invoice bank transfer - #2972
Open
OlegPhenomenon wants to merge 3 commits into
Open
OlegPhenomenon wants to merge 3 commits into
OlegPhenomenon wants to merge 3 commits into
Conversation
- Generate a reference number and due date for each reservation invoice - Render invoice PDF before payment with reference number, due date and amount due - Add JWT-protected PUT /eis_billing/business_registry_payment for billing to confirm bank payments - Share reservation completion between EveryPay callback and bank payment - Fix cancelling intersecting invoices after paid callback (record was bound instead of domain names) - Stop invoices_test from replacing EisBilling::BaseController for all tests
Reservation is first-come-first-served: unpaid invoice PDF says the invoice does not guarantee the reservation, and a bank payment for domains that are no longer available cancels the invoice so billing can refund it.
This was referenced Oct 19, 2026
Contributor
🚀 Deploy Complete!
(Environment ready for testing) |
2 similar comments
Contributor
🚀 Deploy Complete!
(Environment ready for testing) |
Contributor
🚀 Deploy Complete!
(Environment ready for testing) |
maricavor
approved these changes
Oct 21, 2026
mmeest
approved these changes
Oct 21, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Business Registry users could pay for a long-term domain reservation only by card (EveryPay), because the invoice PDF was available only after payment and had no reference number. This PR lets them pay by direct bank transfer to the EIS IBAN. The invoice is available before payment, and the bank payment is matched by reference number in EIS billing (LHV Connect).
Billing side: internetee/eis_billing_system#268
API docs: internetee/domain-reservation-api-docs#7
Invoice
ReserveDomainInvoicegets its own reference number (generated by billing with initiatorbusiness_registry, owner =user_unique_id) and a due date (Setting.days_to_keep_invoices_active, as for registrar invoices). Both are stored (migration) and sent to billing with the invoicePOST /api/v1/business_registry/long_reserve_domainsreturnsreference_noanddue_dateGET /api/v1/business_registry/reserved_domains_invoice_pdfreturns the PDF for pending invoices too; cancelled/failed invoices return 422Bank payment
PUT /eis_billing/business_registry_payment(JWT from billing, same as othereis_billingendpoints). Looks up the invoice byreference_number:Payment processed: domains reserved, invoice paid, pending invoices with intersecting domains cancelledInvoice already paid: nothing doneInvoice not found: unknown or missing reference numberInvoice is cancelled: invoice was cancelled before (e.g. someone else paid for the same domain first)Failed to reserve domains: some domain is no longer available, invoice is cancelledBilling cancels its invoice on 422 and asks admin to refund the payment
Fixes
cancel_intersecting_invoices, so the query becameARRAY[<id>]and intersecting invoices were never cancelledtest/integration/eis_billing/invoices_test.rbreplacedEisBilling::BaseControllerwith a stub, which disabled JWT checks for every billing controller loaded after it in the test runNot changed
Rollout
business_registry_payment_urlthereSetting.registry_iban(printed on the PDF) is the account LHV Connect reads in billing (registry_bank_account_iban_lhv), otherwise transfers will not be found