Server adventures 5

Continuing my work in NodeJS & Paypal. Payout to customers is pretty straightforward — the documentation’s example was more than enough to get me started and I tested without issues.

paypal-logo

As for credit card payments, I hit a roadblock for a short while because I had to test with fake credit card numbers in the sandbox environment. I copy-pasted the sample code for credit card payment from the examples, but somehow the response JSON gave a “state:created” rather than the expected “state:approved” value. Without the “approved” state, my test merchant account wasn’t getting any money from the test credit card.

A quick google search turns up this link, and it seems like an outdated/deprecated list of test cards. Stack Overflow doesn’t say much either, but after reading through the documentation more thoroughly, I came across this text in this page (under “Test Credit Card payments” section):

  • Note: For sandbox calls, you can use the credit card numbers provided in your sandbox test accounts.

True enough, when you create sandbox accounts, you will find that these accounts will also have credit cards associated with them. Use those instead when testing, and it works — My test merchant account now gets money from the test credit card. Yay!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">