balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

Card's Customer Shows as Null but API Says Card Associated with Customer #584

Closed cieplak closed 10 years ago

cieplak commented 10 years ago

I debited the card before attempting to associate it, which presumably associated with the marketplace customer. If that's the case then it should say so it the GET card response.

➜  ~  curl https://api.balancedpayments.com/cards/CC1AmIYgsxXFp7EoX2X3yrc5 \
     -H "Accept: application/vnd.api+json;revision=1.1" \
     -u ak-test-1PPfI4CmXSaOHFgIYzWdA5fpdkYe9mvLL: \

{
  "cards": [
    {
      "cvv_match": "yes",
      "links": {
        "customer": null
      },
      "name": null,
      "expiration_year": 2020,
      "avs_street_match": null,
      "is_verified": true,
      "created_at": "2014-04-29T20:59:50.045753Z",
      "cvv_result": "Match",
      "brand": "Discover",
      "number": "xxxxxxxxxxxx0002",
      "updated_at": "2014-04-29T20:59:50.045757Z",
      "id": "CC1AmIYgsxXFp7EoX2X3yrc5",
      "expiration_month": 12,
      "cvv": "xxx",
      "meta": {},
      "href": "/cards/CC1AmIYgsxXFp7EoX2X3yrc5",
      "address": {
        "city": null,
        "line2": null,
        "line1": null,
        "state": null,
        "postal_code": null,
        "country_code": null
      },
      "fingerprint": "7ebb507b0359c24ff3b5685160f307e9dabaf58df3b116d951eaf0147fc83f25",
      "avs_postal_match": null,
      "avs_result": null
    }
  ],
  "links": {
    "cards.card_holds": "/cards/{cards.id}/card_holds",
    "cards.customer": "/customers/{cards.customer}",
    "cards.disputes": "/cards/{cards.id}/disputes",
    "cards.debits": "/cards/{cards.id}/debits"
  }
}%                                                                                                                                                                                   

➜  ~  curl https://api.balancedpayments.com/cards/CC1AmIYgsxXFp7EoX2X3yrc5 \
     -H "Accept: application/vnd.api+json;revision=1.1" \
     -u ak-test-1PPfI4CmXSaOHFgIYzWdA5fpdkYe9mvLL: \
     -d 'customer=/customers/CU7Jr8hOM6l2TPI9pGDDUDMV' -X PUT
{
  "errors": [
    {
      "status": "Conflict",
      "category_code": "card-already-funding-src",
      "additional": null,
      "status_code": 409,
      "category_type": "logical",
      "extras": {},
      "request_id": "OHM63e38974cfe211e3b0f902b12035401b",
      "description": "Card has already been associated with an customer. Your request id is OHM63e38974cfe211e3b0f902b12035401b."
    }
  ]
}%     
mjallday commented 10 years ago

My guess would be that precog is throwing ALREADY_FUNDING_SRC and balanced is just passing that message along. Can you consistently reproduce this error?

matthewfl commented 10 years ago

looks like this was left out https://github.com/PoundPay/balanced/pull/470/files

mjallday commented 10 years ago

@matthewfl that good to go? i'll deploy if so

mjallday commented 10 years ago

@cieplak we've deployed a fix to the integration environment, can you please retry your request and see if the issue persists?

mjallday commented 10 years ago

confirmed fixed, pushing to live environment.