Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a failed refund when insufficient funds are in order escrow #471

Closed
steveklabnik opened this issue Jan 8, 2014 · 0 comments
Closed

Comments

@steveklabnik
Copy link
Contributor

Since this was previously failing (#435) I'm not sure what's right.

Currently porting https://github.com/balanced/balanced-api/blob/revision1/scenarios/orders/create_refund.yml over to cucumber:

  Scenario: Create a failed refund when insufficient funds are in order escrow
    Given I have created an order
    And I have tokenized a card
    When I make a POST request to the link "cards.debits" with the body:
    """ 
      { 
        "order": "<%= @orders_id %>", 
        "amount": 1234
      }
    """

    And I have tokenized a bank account
    Then I make a POST request to the link "bank_accounts.credits" with the body:
    """
    {
        "order": "<%= @orders_id %>", 
        "amount": 1234
      }
    """

    When I make a POST request to the link "debits.refunds" of that debit
    Then I should get a 409 status code
    And the response is valid according to the "errors" schema
    And the fields on this error match:
    """
      {
         "category_code": "account-insufficient-funds"
       }     
    """  

Right now, the 409 is returning a 201 instead. Seems bad. :/

/cc @matthewfl

steveklabnik added a commit that referenced this issue Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant