DummyPay

A Chris Smith project.

DummyPay is a tool that makes it easy to test your checkout system.

How does it work?

Send a pay request to the server, then query the card's balance:
$ curl -X POST https://dummypay.io/pay -H "Content-Type: application/json" --data '{
    "type": "card",
    "cardNumber": ,
    "cardCvv": 1234,
    "cardExpMonth": 11,
    "cardExpYear": 45,
    "amount": 10 }'
$ curl https://dummypay.io/card/
{"balance":10.00}

You can also do the same for banks:
$ curl -X POST https://dummypay.io/pay -H "Content-Type: application/json" --data '{
    "type": "bank",
    "bankRouting": ,
    "bankAccount": ,
    "amount": 10 }'
$ curl https://dummypay.io/bank//
{"balance":10.00}

Overriding details

Normally, you may pass any CVV or expiration date (provided the date is in the future) and the payment will go through. But if you'd like to test scenarios such as invalid CVV code, incorrect expiration date, or the card not existing at all, you'll have to override those details beforehand. You can also overwrite the balance as well:
$ curl -X PUT https://dummypay.io/card/ -H "Content-Type: application/json" --data '{
    "exists": "false",
    "cvv": 1234,
    "expMonth": 11,
    "expYear": 45,
    "balance": 60 }'
$ curl -X POST https://dummypay.io/pay -H "Content-Type: application/json" --data '{
    "type": "card",
    "cardNumber": ,
    "cardCvv": 1234,
    "cardExpMonth": 11,
    "cardExpYear": 45,
    "amount": 10 }'
{"status":402, "message":"invalidCard"}

Storing information (e.g. saved payment method)

$ curl -X POST https://dummypay.io/save -H "Content-Type: application/json" --data '{
    "type": "card",
    "cardNumber": ,
    "cardCvv": 1234,
    "cardExpMonth": 11,
    "cardExpYear": 45 }'
{"savedId":"{\"t\":\"card\",\"n\":,\"c\":1234,\"m\":11,\"y\":45}"}
$ curl -X POST https://dummypay.io/pay -H "Content-Type: application/json" --data '{
    "type": "saved",
    "savedId": "{\"t\":\"card\",\"n\":,\"c\":1234,\"m\":11,\"y\":45}",
    "amount": 10 }'
$ curl https://dummypay.io/card/
{"balance":10.00}

You will notice that the savedId actually contains the full credit card details. This is to allow you to store a reference to this payment method for as long as you like.

Namespacing

If you feel that the number of available card numbers isn't enough, or you'd like to test a certain card number in particular you fear might cause collisions with other users, you have two options. The first option is to run your own DummyPay server, the second option is to provide an Authorization header:
$ curl -X POST -u root: https://dummypay.io/pay -H "Content-Type: application/json" --data '{
    "type": "card",
    "cardNumber": ,
    "cardCvv": 1234,
    "cardExpMonth": 11,
    "cardExpYear": 45,
    "amount": 10 }'
$ curl -u root: https://dummypay.io/card/
{"balance":10.00}

Isn't this insecure?

Yes. Do not send real card numbers (or bank numbers) to this server. Everything on here is stored in plain text. Instead, generate a random credit card number on the fly.

Technicalities