Accesing optional fields in the Credit Card Object

30 Views Asked by At

I am using Balanced version 1.0 on PHP.

We have tried to add more details to the Credit Cards. The ones we are having problems with are, from the documentation these are listed as;

  • city optional string. City. Defaults to null.
  • state optional string. US state. This field has been deprecated.

When I examine the $card object, these properties do not exist, except as part of the customer sub-object. The other properties;

  • postal_code
  • street_address
  • country_code

operate as expected.

While state is termed "deprecated", this means that is may be superseded not removed. city is should default to null but is not there. I examined v1.1 and see that the fields are still there as part of the sub-object address.

Can you suggest why I cannot access these fields in v1.0?

1

There are 1 best solutions below

1
mjallday On

I looked at the documentation and it shows those fields come back on the response.

Can you expand on what you mean by them not existing? Are you attempting to set them and the values do not persist?

Request

curl https://api.balancedpayments.com/v1/marketplaces/TEST-MP2zmzeddBrHjK5zoThHGpzi/cards/CC3Mb8s5fGvC49F8mWteu8Mm \
     -u ak-test-2755A6Q56FwdnGMNXK72fHjCSXXlruJe6:

Response

{
    "_type": "card", 
    "_uris": {}, 
    "account": null, 
    "brand": "MasterCard", 
    "card_type": "mastercard", 
    "country_code": null, 
    "created_at": "2014-03-31T21:21:55.367725Z", 
    "customer": null, 
    "expiration_month": 12, 
    "expiration_year": 2020, 
    "hash": "fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788", 
    "id": "CC3Mb8s5fGvC49F8mWteu8Mm", 
    "is_valid": true, 
    "is_verified": true, 
    "last_four": "5100", 
    "meta": {}, 
    "name": null, 
    "postal_code": null, 
    "postal_code_check": "unknown", 
    "security_code_check": "passed", 
    "street_address": null, 
    "uri": "/v1/marketplaces/TEST-MP2zmzeddBrHjK5zoThHGpzi/cards/CC3Mb8s5fGvC49F8mWteu8Mm"
}

If you look at the response you can see that the fields postal_code, street_address, and country_code all exist in the payload.

If you think it's something related to the PHP client itself then the best bet is to generate a runnable example that we can use to debug the issue. You can either post it here or create an issue on the github repo for the Balanced PHP client.