@documents
@lambda_documents_payee
Feature: EUR Bank Details - Payoneer and Abacus Rejected

  @id_2e1a3148bf037faa99962ad2b74f25b87ccf1734e910cadbc475b25e8fb76f2f
  Scenario: Eur Bank Details declined for Business Account and Personal Bank Account type
    Given an orchard employee label_6971 for documents
    Then I update abacus state table and delete Payoneer account 793236
    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 UK account name ORCHARD-UK-TEST_ACCOUNT
    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 ORCHARD-UK-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
    Then I compliance check reject Banking Details
    And I can see that Payment details status is KYC check failed because of Rejected upon request
    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 UK account name ORCHARD-UK-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 to understand what additional documentation may be required to verify your payment information.
    Then I click to edit bank details
    And I edit company name

  @id_7f6fb87db728091d40ff1c1ea920692c9615c17762a22c76079de3d7a25c486b
  Scenario: Bank Details rejected based on KYC check
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus silently
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab ORCHARD-UK-TEST_ACCOUNT
    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 reject Banking Details
    And I can see that Payment details status is Rejected on
    And I can see that Payment details status is Note about rejection
    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 UK account name ORCHARD-UK-TEST_ACCOUNT
    And I can see that status is changed to Bank details rejected
    And I can see that status is changed to Please update your previously submitted bank details or email banking-info@theorchard.com with any questions.
    And I check notes expandable content
