mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Add tests for Payments::BankLink
This commit is contained in:
parent
663214ee49
commit
5dea92c0d8
12 changed files with 294 additions and 150 deletions
|
@ -1,7 +1,5 @@
|
|||
module Payments
|
||||
class EveryPay < Base
|
||||
|
||||
# TODO: Move to setting or environment
|
||||
USER = ENV['payments_every_pay_api_user'].freeze
|
||||
KEY = ENV['payments_every_pay_api_key'].freeze
|
||||
ACCOUNT_ID = ENV['payments_every_pay_seller_account'].freeze
|
||||
|
@ -21,7 +19,7 @@ module Payments
|
|||
base_json
|
||||
end
|
||||
|
||||
def valid_response?
|
||||
def valid_response_from_intermediary?
|
||||
return false unless response
|
||||
valid_hmac? && valid_amount? && valid_account?
|
||||
end
|
||||
|
@ -31,7 +29,7 @@ module Payments
|
|||
end
|
||||
|
||||
def complete_transaction
|
||||
return unless valid_response? && settled_payment?
|
||||
return unless valid_response_from_intermediary? && settled_payment?
|
||||
|
||||
transaction = BankTransaction.find_by(
|
||||
description: invoice.order,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue