mirror of
https://github.com/valitydev/fistful-server.git
synced 2024-11-06 10:45:21 +00:00
FF-82 Add exists session error handling (#80)
This commit is contained in:
parent
433f9dcde6
commit
907cfced48
@ -428,7 +428,7 @@ create_session(Withdrawal) ->
|
||||
destination => destination_id(Withdrawal),
|
||||
provider_id => ProviderID
|
||||
},
|
||||
ok = unwrap(ff_withdrawal_session_machine:create(ID, TransferData, SessionParams)),
|
||||
ok = create_session(ID, TransferData, SessionParams),
|
||||
{continue, [{session_started, ID}]}
|
||||
end).
|
||||
|
||||
@ -439,6 +439,14 @@ construct_session_id(ID) ->
|
||||
construct_p_transfer_id(ID) ->
|
||||
<<"ff/withdrawal/", ID/binary>>.
|
||||
|
||||
create_session(ID, TransferData, SessionParams) ->
|
||||
case ff_withdrawal_session_machine:create(ID, TransferData, SessionParams) of
|
||||
ok ->
|
||||
ok;
|
||||
{error, exists} ->
|
||||
ok
|
||||
end.
|
||||
|
||||
poll_session_completion(Withdrawal) ->
|
||||
SessionID = ff_transfer:session_id(Withdrawal),
|
||||
{ok, SessionMachine} = ff_withdrawal_session_machine:get(SessionID),
|
||||
|
Loading…
Reference in New Issue
Block a user