-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add callback URLs for business registry domain reservation
Add success and failure callback URLs for business registry domain reservation process: - Add success_business_registry_customer_url and failed_business_registry_customer_url fields to reserve_domain_invoices table - Update ReserveDomainInvoice model to handle new callback URLs - Add URL validation in LongReserveDomainsController - Replace linkpay with oneoff_payment_link for consistency - Update tests to cover new functionality - Add wkhtmltopdf and xvfb setup in Dockerfile This change allows the business registry to specify URLs where users should be redirected after successful or failed domain reservation payments.
- Loading branch information
1 parent
5a9aa97
commit 02fec75
Showing
10 changed files
with
354 additions
and
110 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module EisBilling | ||
class OneoffService < EisBilling::Base | ||
|
||
attr_reader :invoice_number, :customer_url, :amount | ||
|
||
def initialize(invoice_number:, customer_url:, amount: nil) | ||
@invoice_number = invoice_number | ||
@customer_url = customer_url | ||
@amount = amount | ||
end | ||
|
||
def self.call(invoice_number:, customer_url:, amount: nil) | ||
new(invoice_number: invoice_number, customer_url: customer_url, amount: amount).call | ||
end | ||
|
||
def call | ||
send_request | ||
end | ||
|
||
private | ||
|
||
def send_request | ||
http = EisBilling::Base.base_request | ||
http.post(invoice_oneoff_url, params.to_json, EisBilling::Base.headers) | ||
end | ||
|
||
def params | ||
{ | ||
invoice_number: invoice_number, | ||
customer_url: customer_url, | ||
amount: amount | ||
} | ||
end | ||
|
||
def invoice_oneoff_url | ||
'/api/v1/invoice_generator/oneoff' | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20241104104620_add_callback_urls_to_reserve_domain_invoices.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddCallbackUrlsToReserveDomainInvoices < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :reserve_domain_invoices, :success_business_registry_customer_url, :string | ||
add_column :reserve_domain_invoices, :failed_business_registry_customer_url, :string | ||
end | ||
end |
This file contains 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
This file contains 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
Oops, something went wrong.