Commit Graph

270 Commits

Author SHA1 Message Date
Toporkov Igor
1b113aa752 Revert "HG-555: update ComputeShopTerms clients (#497)" (#503)
This reverts commit 9a8ad47008752b8af573ce8bcaa784377650e082.
2020-11-05 12:09:36 +03:00
Toporkov Igor
147e1e1694 Rollback to an old image (#502) 2020-11-05 11:30:07 +03:00
Sergey Yelin
786548945f Update service erlang image (#501) 2020-11-03 10:09:21 +03:00
Toporkov Igor
0ba6ce3736 HG-555: update ComputeShopTerms clients (#497)
* Hadle varset that might be sent in future

* Leave a comment about the migration process

* Update damsel & party_client

* Use party_client to call PM, add Varset to ComputeShopTerms args

* Add Varset to pm_client and tests
2020-10-30 14:54:58 +03:00
Toporkov Igor
8469a2995d HG-555: Handle Varset in ComputeShopTerms (#496)
* Hadle varset that might be sent in future

* Leave a comment about the migration process
2020-10-30 11:58:59 +03:00
Sergey Yelin
57ca9a8bd5 Add prometeus (#494) 2020-10-24 09:01:20 +03:00
ndiezel0
5af3baedd1 HG-452: Add PartyManagement usage to hellgate (#485)
* HG-452: Add PartyManagement usage to hellgate

* HG-452: Review fix

* HG-452: Save some lines

* HG-452: Review fix

* HG-452: Get rid of extra fields in Varset

* HG-452: Fix lint

* HG-452: Review fix

* HG-452: Fix

* HG-452: Review fix

* HG-452: Review fix

* HG-452: Format

* HG-557: Fix merge

* HG-557: Add comment

* HG-452: Update build_utils

* HG-452: Rollback hg_routing Varset changes

* HG-452: Fix spec
2020-10-20 18:16:05 +03:00
ndiezel0
9849c12150 HG-557: Add logging of cache hit/miss (#489) 2020-10-19 16:11:16 +03:00
ndiezel0
e9893dcc43 HG-452: Add caching for Checkout Party (#487)
* HG-452: Add caching for Checkout Party

* HG-452: Fix dialyzer

* HG-452: Format

* HG-452: Make cache work

* HG-452: Review fix

* HG-452: Fix specs

* HG-452: Review fix

* HG-452: Fix

* HG-452: Review fix

* HG-452: Format
2020-10-16 13:41:47 +03:00
Toporkov Igor
5eed85e519 HG-547: Validate cash register claims (#484)
* Assert cash registry-assosiated shop exists in party or could claimed to be created

* Filter out cash register shopIDs

* Test new validation

* Fix typo in test case name, fix missing space

* Always check cash register claims

* Fix cash register spelling

* Format code using erlfmt

* Use sets instead of lists

* Move cash_register claims validation to pm_claim_committer
2020-10-13 14:31:57 +03:00
ndiezel0
351b790873 HG-452: Fixed party_management (#483)
* HG-452: Fixed party_management

* HG-452: Add pm_varset and encode_decode test

* HG-452: Fix merge

* HG-452: Formatter
2020-09-28 12:37:41 +03:00
Andrey Fadeev
8093d04623 Try erlfmt (#479)
Co-authored-by: Sergey Yelin <elinsn@gmail.com>
2020-09-25 18:14:03 +03:00
Sergey Yelin
52967bd114 Update woody (#482)
* Revert "Update woody and fix backward clock error (#478)"

This reverts commit 7ee4679b1ec5954962a00b4eb84108d2274dd0ba.

* Update woody and fix backward clock error (#478)

* Fully embrace new woody args-are-tuples convention (#480)

* Remove HG-542 revert artefact

Co-authored-by: ndiezel0 <ndiezel0@gmail.com>
Co-authored-by: Andrew Mayorov <a.mayorov@rbkmoney.com>
2020-09-18 19:18:59 +03:00
Sergey Yelin
6588cefb0f Revert HG-452 (#481)
* Revert "Fully embrace new woody args-are-tuples convention (#480)"

This reverts commit d95579a0d7817e2bbb93797ee6567a80063978e1.

* Revert "HG-452: Fix pm_ruleset (#477)"

This reverts commit 6f4433bdc789b2e65590621ed8af69f331b1fd95.

* Revert "Update woody and fix backward clock error (#478)"

This reverts commit 7ee4679b1ec5954962a00b4eb84108d2274dd0ba.

* Revert "HG-452: Add pm methods usage (#443)"

This reverts commit 3a9142df3ba8b43433e099655a6b5a3ec4c9fd82.
2020-09-18 16:57:01 +03:00
Andrew Mayorov
8d55ad9bda Fully embrace new woody args-are-tuples convention (#480) 2020-09-17 11:45:53 +03:00
Sergey Yelin
dcfbbaee96 Add missing claim (#476)
* Add missing claim

* Fix name

* Filter out unsupported event

* Remove dead code

* Simplify filter

* Do not generate events to claim with empty changeset

* Filter out claim_modification

* Leave cash_register_modification_unit for further desisions

* Cleanup
2020-09-14 18:49:59 +03:00
ndiezel0
76b759568b HG-452: Fix pm_ruleset (#477)
* HG-452: Fix pm_ruleset

* HG-452: Revert ComputeGlobals

* HG-452: Slim down PR

* HG-452: Remove compute_globals

* HG-452: Remove unneeded reduce_payment_routing_decisions/3 clause
2020-09-11 13:11:35 +03:00
ndiezel0
02b39461c4 Update woody and fix backward clock error (#478) 2020-09-10 17:58:12 +03:00
ndiezel0
470a39a76d HG-452: Add pm methods usage (#443)
* HG-452: Add compute payment institution to hellgate

* HG-452: Fix marshalling

* HG-452: Add ComputePaymentInstitution implementation

* HG-452: Fix payment_institution tests

* HG-452: Fix lint

* HG-452: Fix marshalling error

* HG-452: Fix tests

* HG-452: Add compute_contract_terms use

* HG-452: Add compute_contract_terms more use

* HG-452: Fix dialyzer

* HG-452: Update Provider

* HG-452: Remove compute p2p and withdrawal provider methods

* HG-452: Update party client

* HG-452: Add eunit test to selector

* HG-452: Fix tests

* HG-452: Review fix

* HG-452: Review fix

* Update apps/hellgate/src/hg_invoice_payment.erl

Co-authored-by: Andrey Fadeev <me@ciiol.net>

* HG-452: Review fix

* HG-452: Remove CreatedAt

Co-authored-by: Andrey Fadeev <me@ciiol.net>
2020-09-07 16:16:34 +03:00
Roman Pushkov
13979efa94 HG-545: register status change timestamps (#473)
* add occurred in invoice handlers

* store latest change in payment

* remove unused function

* update merge_change

* minor fixes

* one more fix

* store ts in payment opts

* update opts handling

* cleanup

* minor cleanup

* timestamps for invoice adjustments

* update damsel

* unify adjustment timestamps

* fix exports
2020-09-04 14:32:38 +03:00
ndiezel0
118ff48698 HG-452: Implement ComputeGlobals and ComputePaymentRoutingRuleset (#466)
* HG-452: Update Varset

* HG-452: Add ComputeGlobals and ComputePaymentRoutingRuleset implementation

* HG-452: Fix tests

* HG-452: Fix test

* HG-452: Fix dominant config in party test

* HG-452: Fix lint

* HG-452: Fix xref and tests

* Update apps/party_management/src/pm_party_handler.erl

Co-authored-by: Andrey Fadeev <me@ciiol.net>

* HG-452: Review fix

* HG-452: Update damsel

* Update apps/party_management/test/pm_party_tests_SUITE.erl

Co-authored-by: Andrey Fadeev <me@ciiol.net>

* HG-452: Add WRONG_DMT_OBJ_ID macro to pm tests

* HG-452: Add tests

* HG-452: Fix order

Co-authored-by: Andrey Fadeev <me@ciiol.net>
2020-08-07 16:02:02 +03:00
Andrew Mayorov
642a9b47fb Bump to rbkmoney/woody_erlang@33b69913 (#470)
* benoitc/hackney#638
2020-08-04 15:48:17 +03:00
Toporkov Igor
a5d17b2b12 DC-127: Payment methods refactoring (#445)
* Use corresponding epic damsel branch

* Bump dominant

* Migrate to new bank_card payment method representation

* Simplify guard clause

Co-authored-by: Andrew Mayorov <a.mayorov@rbkmoney.com>

* Delete invalid clauses in hg_payment_tool:get_method/1

* Remove marshaling that we don't use anymore

* Correctly unmarshal tokenization_method

* Revert "Correctly unmarshal tokenization_method"

This reverts commit 6f14eefd003e3f80d087db97ca63c4ccc85152d8.

* Do not unmarshal tokenization_method because it will never be there

* Use old (_deprecated) payment methods

* Replace has_cvv with is_cvv_empty

* Upgrade damsel

* Delete outdated comentaries

* Return ordset of payment methods

* Upgrade dominant

* Upgrade damsel

* Add tokenization_method to bank_card_deprecated

* Rename function in hg_payment_tool, create function to test if payment method is supported

* Simpilfy and rename payment methods matching

* Export hg_payment_tool:get_possible_methods/1

* Upgrade damsel

* Fix mising old bank card reference

* Bump dominant

* Fix construct_payment_method

* Upgrade deps

* Suffix with _derprecated payment methods

* Bulk update deps

* Mark deprecated pms introduced by merge

Co-authored-by: Andrew Mayorov <a.mayorov@rbkmoney.com>
2020-07-29 15:02:00 +03:00
Andrey Fadeev
b85e9d3eb0 Update woody to rbkmoney/woody_erlang@b563bbb (#467) 2020-07-28 08:14:10 +03:00
Roman Pushkov
7a11f33fa0 HG-541: invoice adjustments (#458)
* some initial changes

* update hg_client

* change adjustment to payment adjustment in tests

* update damsel

* types in client

* Revert "change adjustment to payment adjustment in tests"

This reverts commit ff1633c41660b6f144f75ae067ea63eb33906981.

* rename payment adjustment functions

* fix hg_client adjustment calls

* update invoice events header

* add invoice adjustment tests

* working invoice adjustments

* uncomment other invoice tests

* minor cleanup

* fix some types

* fix more types

* temporarily comment out non-operational tests

* fix actions

* add more tests

* add exceptions

* run ci with disabled invoice adjustment tests

* Switch ti sequential

* uncomment tests

* minor cleanup

* uncomment pm tests

* add extra asserts

* add logging

* remove tests from invoice suite

* add invoice adjustment test suite

* minor cleanup

* fix test crashes

* minor cleanup

* more cleaning

* update invalid status exception handling

* increase party client timeout

* increase get timeout

* add pending payment test

* add pending adjustment test

* update tests

* update damsel

* update handling

* add expiration tests

* refactor tests

* update expiration handling

* tests cleanup

* do not expire while pending

* update timeouts

Co-authored-by: Sergey Yelin <elinsn@gmail.com>
2020-07-21 17:43:14 +03:00
Toporkov Igor
e91f750852 DC-122: Remove risk_coverage from Terminal (#459)
* Hard remove all risk_coverage-related code

* Upgrade dominant

* Remove risk_coverage from test terminals, rework routing tests so they pass

* Fix merge artifact

* Kek

* Remove outdated comment

* Improve test readability

* Delete trailing whitespaces
2020-07-14 16:40:04 +03:00
ndiezel0
f37f198ae9 HG-452: Update party_managements methods and tests (#460) 2020-07-10 16:54:31 +03:00
Sergey Yelin
d015c3d32a Switch to pipline (#457)
* Switch to pipeline

* Update build_utils

* Add options

* typo

* Update build_utils

* Add missing path

* Update build_utils
2020-07-07 14:47:23 +03:00
Andrey Fadeev
d119f39248 MSPF-561 Add new provider terms usage (#454) 2020-07-06 10:58:37 +03:00
Roman Pushkov
8a131b08c4 HG-542: chargebacks move_to_stage option (#456)
* add move_to_stage option handling

* add test placeholder

* finalise test

* uncomment move_to_stage option handling

* only allow skipping forward

* update damsel

* fix test

* update handling

* rework stage selection semantics

* fix stage handling

* fix dialyzer
2020-07-03 17:23:24 +03:00
Andrey Fadeev
200a93fcba MSPF-561 Update damsel (#455)
* Update damsel
* Reduce tests flapping
* Make eventsink test suite a bit more stable
2020-06-30 17:51:13 +03:00
Andrew Mayorov
90d28c6b12 DC-120: Implement criteria in predicates (#453)
See rbkmoney/damsel#582
2020-06-23 17:00:46 +03:00
Sergey Yelin
e4ee77b3fb P2C-8: Add attempt_limit (#452)
* P2C-8: Add attempt_limit

* Add missing merge

* Fix order
2020-06-22 18:21:22 +03:00
Toporkov Igor
d1d957e047 DC-126: Add tokenization_method field (#449)
* Support tokenization_method field and condition

* Split very long line

* Threat none same as undefined when comparing tokenization methods

* Allow whatever payment method if condition is undefined

* Handle undefined tokenization method with defined tokenization method condition
2020-06-17 09:59:23 +03:00
Boris
1e57bd4674 MSPF-562: Add bank card category, condition category_is (#448) 2020-06-11 17:17:05 +03:00
Roman Pushkov
bddf397e8b HG-529: add disable failover routing option (#447)
* Temporarily revert second part of HG-538

This reverts commit 7f23d74bf7246df59ee11eb368ac82a8e5cd0865.

* add enabled option to fd

* disable fd in tests by default

* update fd gathering test

* add enabled status handling to fd

* cleanup

* cleanup ct print

* update tests

* cleanup

* update existing fd config in tests

* update hg test config for fd
2020-06-09 14:03:10 +03:00
Alexey
b5c0e69ec6 FF-183: Upgrade damsel (#441) 2020-05-29 11:01:33 +03:00
ndiezel0
91e4401f11 HG-452: Further remove party management from hellgate (#433)
* HG-452: Further remove party management from hellgate

* HG-452: Add ComputeP2PProvider, ComputeWithdrawalProvider, ComputePaymentProvider implementation

* HG-452: Add ComputePaymentProviderTerminalTerms implementation

* HG-452: Add ComputeP2PProvider test

* HG-452: Fix test

* HG-452: Fix p2p provider test

* HG-452: Add the rest of the tests

* HG-452: Fix lint

* HG-452: Debug tests

* HG-452: Remove debug

* HG-452: Review fix
2020-05-25 13:50:45 +03:00
Roman Pushkov
4755f1c82d HG-540: cash flow data in chargebacks (#440)
* update damsel

* add get_cash_flow to chargebacks

* update get_chargebacks/1

* okay, that looks weird

* typo fix

* oh come on

* typo fix

* update damsel

* handle get_chargebacks
2020-05-25 11:32:21 +03:00
Sergey Yelin
744496c5bf Update build_utils (#439) 2020-05-22 11:03:32 +03:00
Sergey Yelin
cdf7a7b0bd DC-119: Update damsel (#437) 2020-05-09 10:29:05 +03:00
Артем
f660e3b373 DC-123: P2P templates (#435)
* updated damsel

* added support for template terms

* added test for p2p template terms

* fixed merge

* minor
2020-05-08 13:29:43 +03:00
Sergey Yelin
28fac524cc MSPF-532: Upgrade Erlang to 22.3.1 (fix rfc3339 error) (#430)
* MSPF-532: Upgrade Erlang to 22.3.1 (fix rfc3339 error)

* Fix dialyzer cache name
2020-04-20 17:34:14 +03:00
Alexey
76d1f63c0b HG-535: Assert invoice payable (#428) 2020-04-06 12:28:00 +03:00
Roman Pushkov
583174c653 HG-495: chargebacks (#346)
* wip chargeback handler

* add chargeback test draft

* update deps

* update deps

* create chargeback draft

* add create chargeback to client

* create chargeback test draft

* update dmsl

* update test

* cashflow wip

* update payment events

* update deps

* attempt fix deps

* update dmsl

* update test

* add get payment chargeback to client

* add get payment chargeback handler

* cashflow wip

* fix linter errors

* wip create chargeback

* damsel update

* fix dmsl

* update dominant

* merge cb terms

* update id generation

* add test placeheolders

* update hg client

* add update chargeback

* update client

* update tests

* update events

* add implementation wip

* update cancel

* update tests

* update damsel

* add more chargeback tests

* update implementation

* update dominant

* update damsel

* some fixes

* add reopen tests with hold funds

* update reopen logic

* udpate damsel

* add cancel after reopen test

* add cancel after reopen implementation

* add more tests

* add balance checks to tests

* cashflow fix

* add more balance checks in tests

* fix cashflow bug

* add tests for reopening chargebacks after failures

* add reopen after failures handling

* finalise test to be sure

* fix test

* do not change payment status on accept with partial cash

* remove failures from tests

* update damsel

* test updates and fixes

* update implementation

* update damsel

* type cleanup, some refactoring

* cleanup, remove ct:print, refactor

* minor cleanup

* update tests

* add inconsistent currency check

* udpate damsel

* update tests

* udpate damsel

* move chargebacks to separate module

* move chargebacks to a separate module

* fix types

* some refactoring

* types, some refactoring

* update damsel

* update dominant + minor

* update tests

* update implementation

* update damsel

* fix merge

* fix lost types

* add cash to pending, remove from cb changed

* update damsel

* update damsel

* update dominant

* minor

* update events

* add params to reject

* update damsel

* update tests WIP

* update invoice payment

* update chargebacks WIP

* update tests

* update damsel

* update events

* update invoice payment

* update chargeback implementation

* minor cleanup

* increase god module cap a bit

* cleanup

* update events

* update damsel

* update tests wip

* update implementation wip

* update events in tests

* update damsel

* update chargeback events

* clean prints, restore cash flow handling on first reopen, reset target status

* fix dialyzer

* update tests

* update cash flow handling and reject logic

* fix indentation

* refactoring, moved activities to chargebacks module

* move process result to chargeback

* fix config formatting

* move no pending chargebacks check to invoice

* move getters to chargebacks module

* idempotent creation

* merge party cb terms

* syntax fixes

* fail routing with no chargeback terms

* move choose_provider_account to payment institution

* fix export

* remove unnecessary validations

* revert accessibility validation

* fix deletion

* minor refactoring

* remove pending chargebacks check from invoice

* Fix postgresql link (#421)

* refactor chargeback activity, fix idempotency

* update tests

* update dmsl

* add cb to varset

* fix

* removed get_opts, set_opts

* clean up chargebacks

* update deps

* move choose_external_account

* fix types

* add todo for cash flow rework

* remove redundant aliases

* unified define_params_cash function

* remove contract validation

* remove contract validation

* cash flow handling rework, docs update

* remove redundant validation

* fix merge

* add partial capture chargeback test

* add separate plans for stages

* wrap events externally

* add partial payment chargeback test with exceeding body

* fix type errors

* rework event handling

* elvis update

* cleanup

* move pending chargebacks check

* move validations

* move more validations

* separate body and levy in cash flow

* minor

* update cb options

* minor rename

* disable cancel during initialisation

* update activity naming

* set operation_amount to 0 on reject

* update merge_change validations

* update test chargeback test fixture

* use remaining amount if body is undefined

* add double chargeback test

* fix wrong types

* move some validations

* move create validations, update opts

* longer hold period for capture

* update damsel

* add chargeback service terms validation

* add chargeback not allowed test

* minor cleanup

* tests cleanup, add chargeback fees placeholder

* add test placeholders for provider levy

* split service and provision cf contexts

* fix typo

* update dominant

* export hg_cashflow:compute_volume/2

* update test fixture

* implement provider levy

* formatting

* update tests

* fix types

* fix types

* prolong test timeout

* merge update

* reduce allow predicate

* cb provider levy cash flow update

* cleanup

* add chargebacks to reduce

* add eligibility validation

* fix chargeback terms reduction

* throw misconfiguration if allow can not be reduced

* use add_previous_stage function

* fix type errors

* update cancel handling, store last cash flow, use cb creation timestamp, cleanup

* update hg client

* update damsel

* update tests

* add occurred_at to invoice event

* update params macros

* implement occurred_at

* export cancel params

* disable flappy tests

* fix typo

* simplify occurred_at extraction

* restore explicit clause matching in finalise

* clean ct:prints

* fix whitespace

* attempt at unflapping tests

Co-authored-by: Sergey Yelin <elinsn@gmail.com>
2020-03-27 12:58:41 +03:00
Артем
4212833ef9 FF-163: Fix - P2P tool condition test (#427) 2020-03-13 12:55:24 +03:00
Sergei Shuvatov
a9a6ec896d HG-525: add payment status adjustment (#414) 2020-03-12 13:17:13 +03:00
Andrey Fadeev
a7bd902182 FF-164 Update damsel (#426)
Add rbkmoney/damsel#546 changes support
2020-03-11 14:12:02 +03:00
ndiezel0
f5a8ccfc6f HG-452: Move party and claim management to its own app (#407)
* HG-452: Move party and claim management to it's own app

* HG-452: Remove unused exports

* HG-452: Fix tests, remove old eventsink on party

* HG-452: Revert pm_event_provider

* HG-452: Remove `hg_contract`

* HG-452: Add pm_client and pm_proto

* HG-452: Fix lint

* HG-452: Move party and claim management tests to `party_management`

* HG-452: Fix dialyzer

* HG-452: Fix tests

* HG-452: Fix tests

* HG-452: Remove some includes in hg, bring back `hg_party`

* HG-452: Remove party client from party management

* HG-452: Remove `hg_payout_tool` and rename `pm_invoice_utils` => `pm_currency`

* HG-452: Add party_management config

* HG-452: Remove unused function from common test helpers

* HG-452: Remove unused function from pm_ct_helper

* HG-452: hg_selector => pm_selector

* HG-452: Fix lint

* HG-452: Strip down party_management config and bring back party_events.hrl to hellgate

* HG-452: Fix order of app loads in tests

* HG-452: Bring back `hg_client_party`

* HG-452: Fix tests

* HG-452: Use pm_party in hg, where it is appropriate

* HG-452: Remove unused `hg_client_party` code

* HG-452: Remove unused macros in `hellgate/include/party_events.hrl`

* HG-452: Remove party_management from list of services in config

* HG-452: Remove hg_client and pm_client need to get service_spec

* HG-452: Clean up `party_management/include/domain.hrl` from unused macros

* HG-452: Format `xref_checks` like `erl_opts`

* HG-452: Bring back old event_sink for party events

* HG-452: Simplify include in test

* Merge branch 'master' into HG-452/ft/party_management_new

# Conflicts:
#	apps/hellgate/src/hg_party.erl

* HG-452: Review fix
2020-02-28 15:02:25 +03:00
Sergei Shuvatov
39e41dff4d MSPF-532: get rid of rfc3339 library (#424) 2020-02-26 20:53:09 +03:00