From 599dac2f0af43c30fc3372b6ba8375c51404bc7a Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Fri, 15 Mar 2024 10:38:49 +0200 Subject: [PATCH] added everypay params --- .../domain_creation_process/create_contacts_job.rb | 3 ++- app/models/contact.rb | 4 ++-- app/services/domain_services/create_domain_service.rb | 2 +- config/application.yml.example | 7 ++++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/jobs/estonian_tld/domain_creation_process/create_contacts_job.rb b/app/jobs/estonian_tld/domain_creation_process/create_contacts_job.rb index 3440dc8..6cb723b 100644 --- a/app/jobs/estonian_tld/domain_creation_process/create_contacts_job.rb +++ b/app/jobs/estonian_tld/domain_creation_process/create_contacts_job.rb @@ -26,6 +26,7 @@ def perform(pending_action) next if v['contact']['_destroy'] == 'true' contact = Contact.find_by(ident: v['contact']['ident']) + if contact.nil? contacts_what_not_exists << v elsif contact.code.blank? @@ -81,7 +82,7 @@ def create_contact(contact) end after_perform do |job| - EstonianTld::DomainCreationProcess::CreateDomainJob.perform_later(@pending_action) + EstonianTld::DomainCreationProcess::CreateDomainJob.perform_now(@pending_action) end end end diff --git a/app/models/contact.rb b/app/models/contact.rb index 3ec1b8e..e644bc9 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -34,11 +34,11 @@ class Contact < ApplicationRecord validates :name, presence: true validates :role, inclusion: { in: Contact.roles } - def self.create_contact_from_registrant_perform_later(registrant_user:) + def self.create_contact_from_registrant_perform_now(registrant_user:) c = Contact.find_by(ident: registrant_user.ident) return c if c && c.code.present? - CreateContactJob.perform_later(registrant_user) + CreateContactJob.perform_now(registrant_user) end def self.search(query) diff --git a/app/services/domain_services/create_domain_service.rb b/app/services/domain_services/create_domain_service.rb index 6c9fa7a..1975f7d 100644 --- a/app/services/domain_services/create_domain_service.rb +++ b/app/services/domain_services/create_domain_service.rb @@ -7,7 +7,7 @@ def initialize(pending_action) end def call - EstonianTld::DomainCreationProcess::CreateContactsJob.perform_later(pending_action) + EstonianTld::DomainCreationProcess::CreateContactsJob.perform_now(pending_action) # EstonianTld::DomainCreationProcess::CreateDomainJob.perform_later(pending_action) end end diff --git a/config/application.yml.example b/config/application.yml.example index 0ca4fb8..a3fb229 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -36,4 +36,9 @@ tara_jwks_uri: '/.well-known/jwks.json' tara_token_endpoint: '/oauth2/token' tara_auth_endpoint: '/oauth2/auth' tara_base_redirect_url: 'https://st-eedirekt.infra.tld.ee' -tara_redirect_path: '/tara/callback' \ No newline at end of file +tara_redirect_path: '/tara/callback' + +everypay_key: "" +api_username: '' +everypay_base: https://igw-demo.every-pay.com/api/v4 +account_name: 'EUR3D1'