@documents
@lambda_documents_payee
Feature: Bank Details - webhook approval, declined, notification,re-open (KYC)

  @id_b95034aebf1a5776536c93f8b631a883f5311d97c55cd35d7da90f104916953e
  Scenario: Payoneer bank details KYC approval, check documents widget
    Given an orchard employee label_6971 for documents
    Then I update abacus state table and delete Payoneer account 792960
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name TEST ORCHARD ES - EUR
    Then I can see empty Bank Details
    And I add company details for es_eur for Business Account account type
    Then I click next on Bank Details form
    And I add Personal bank account for es_eur
    Then I submit the bank details form
    And I can see that status is changed to Bank details in review
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab TEST ORCHARD ES - EUR
    Then I set bank details status as payoneer with webhook to approved
    And I can see that Payment details status is Received on
    And I can see that Payment details status is Bank details have passed KYC checks
    And I can see that Payment details status is Review Bank Details
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name TEST ORCHARD ES - EUR
    And I can see that status is changed to Bank details in review
    And I can see that status is changed to Our team is reviewing your bank information. You can still make certain changes if required.

  @id_e93071d1ef010950aa6805acca7e913d5d68da84fd04241fe02da07cc8e8c62e
  Scenario: Payoneer bank details declined, check documents widget
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab ORCHARD-DE-TEST_ACCOUNT
    Then I set bank details status as payoneer with webhook to declined
    And I can see that Payment details status is Request client new bank details
    And I can see that Compliance Checks status is KYC check failed because of Incorrect information provided at registration - customer provided
    And I can see that Payment details status is Bank details did not automatically pass Payoneer's KYC checks
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name ORCHARD-DE-TEST_ACCOUNT
    And I can see that status is changed to We were unable to verify your payment information. Please reach out to banking-info@theorchard.com

  @id_540674ea4b714aa262e393a0266c2490ab1247b15509c8291246887b20ca9238
  Scenario: Payoneer bank details notification, check documents widget
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab ORCHARD-DE-TEST_ACCOUNT
    Then I set bank details status as payoneer with webhook to notification
    And I can see that Payment details status is Received on
    And I can see that Payment details status is Bank details did not automatically pass Payoneer's KYC checks
    And I can see that Compliance Checks status is Please follow the link to confirm next steps and to upload any requested client documentation.
    And I can see that Payment details status is Upload documentation to Payoneer
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name ORCHARD-DE-TEST_ACCOUNT
    And I can see that status is changed to Bank details in review
    And I can see that status is changed to Our team is reviewing your bank information.

  @id_2b8eda7f3c6b5c708e047d8b61a9a1cbfb44744e1f0bc1c2f41fbf1f474c438d
  Scenario: Payoneer bank details re-open, check documents widget
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab ORCHARD-DE-TEST_ACCOUNT
    Then I set bank details status as payoneer with webhook to re-open
    And I can see that Payment details status is Received on
    And I can see that Payment details status is Payoneer's automated KYC checks are in progress.
    And I can see that Compliance Checks status is Once KYC process is completed you will be able to review banking details
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name ORCHARD-DE-TEST_ACCOUNT
    And I can see that status is changed to Bank details in review
    And I can see that status is changed to Our team is reviewing your bank information.
