Closed kriskd closed 9 years ago
Hi Kris,
I think you're referring to this line, the response->code
is the HTTP status code returned from HttpSocket, then as long as we get a HTTP 200 we decode the JSON from PayPal (in response->body
) and check the state
key.
I managed to find the docs for the credit_card object and they read as follows;
string State of the credit card funding instrument: `expired` or `ok`. Value assigned by PayPal
...so I think we're good to just check for a 200 response, then ensure the state is ok
, we can then assume the card is stored.
Good spot on the dead link! I'll update this.
Thank you! :+1:
The
responseArray
for thestoreCreditCard
method looks for acode
key, which doesn't appear to exist according to the API documentation: https://developer.paypal.com/docs/integration/direct/rest-vault-overview/#store-a-credit-card. Rather should the check be for anid
or perhaps a value forstate
although I'm unsure what the other values besides "ok" might be. Also, the URL reference to the Paypal API is incorrect.Let me know if you agree and I can submit a PR.