rest - Getting HTTP response from balanced -
if using php code such
$card = balanced\card::get("/v1/marketplaces/test-mp4k6k0pwgyptxl4lz42sqsb/cards/cc5n3hhudrayvhnwqooud3ux"); $card->unstore(); or
$customer->addcard($card) how read http response balanced know if has worked or error is?
the balanced client libraries written throw exceptions if there non 2xx http response api.
the correct way tell if addcard operation failed example write code looks like
try { $customer->addcard($card) } catch (balanced\error $e) { echo 'caught exception: ', $e->getmessage(), "\n"; }
Comments
Post a Comment