balanced / balanced-api

Balanced API specification.
221 stars 72 forks source link

CVV is unsupported #486

Closed steveklabnik closed 10 years ago

steveklabnik commented 10 years ago

test:

    When I make a POST request to /cards with the body:                                                                                                            
      """                                                                                                                                                          
        {                                                                                                                                                          
          "number": "4111111111111111",                                                                                                                            
          "expiration_month": 12,                                                                                                                                  
          "expiration_year": 2016,                                                                                                                                 
          "cvv": "901"                                                                                                                                             
        }                                                                                                                                                          
      """                                                                                                                                                          

    Then I should get a 201 CREATED status code                                                                                                                    
    And the response is valid according to the "cards" schema                                                                                                      
    And the fields on this card match:                                                                                                                             
    """                                                                                                                                                            
        {                                                                                                                                                          
         "cvv_match": "unsupported"                                                                                                                                
        }                                                                                                                                                          
      """    

result:

<"unsupported"> expected but was                                                                                                                                   
<"yes">. (MiniTest::Assertion)    

Is this just wrong fixture data?

mjallday commented 10 years ago

https://github.com/balanced/balanced-api/blob/revision1/scenarios/cards/cvv_match.yml#L12

Sounds like it's not working as expected. Here's the logic that is supposed to control these fixtures:

{
    None: CSCCheck.NONE,
    '901': CSCCheck.UNKNOWN,
    '902': CSCCheck.FAILED,
}

and

{
    None: AVSPostalCheck.NONE,
    '90211': AVSPostalCheck.UNKNOWN,
    '90210': AVSPostalCheck.FAILED,
}

Everything else should return OK/YES.