Dummy Credit Card
We are in the process of deprecating plugins in favor of apps. If you plan on building a new integration with Saleor, we recommend using apps instead.
Key concepts
Dummy Credit Card is a Saleor testing gateway. If you want to configure it, you can do it
through the dashboard (go to settings/plugins
page and choose dummy from the plugins list).
Testing for different responses
Below is the list of test card numbers that can be used for checking different responses. To check response with Saleor Storefront's use, enter one of the given card numbers, valid expiration date, and random CVV value.
Any other card numbers with valid expiration dates and random CVV values create a successful payment.
Card number | Response |
---|---|
0069 | Causes Card expired error. |
9995 | Causes Insufficient funds error. |
0127 | Causes Incorrect CVV error. |
0002 | Causes Card declined error. |
1111 | The Card is pre-authorized and causes Card declined during capture. |
1112 | The Card is pre-authorized and successfully capture. |
Testing different responses with API
In the case of testing dummy payment responses with API, you need to have a checkout with shipping and billing address set. See the checkout page
to know how to create a checkout object.
Then create checkout payment with use of checkoutPaymentCreate
mutation,
set card number as a token
value and mirumee.payments.dummy
as a gateway
.
To check gateway response use CheckoutComplete
mutation.
Let's see an example for a token that causes Card Expired error.
mutation {
checkoutPaymentCreate(
input: {
amount: "15.00"
gateway: "mirumee.payments.dummy"
token: "4000000000000069"
}
token: "91e831f2-92c6-4977-aeca-3cc4c5292ead"
) {
payment {
id
gateway
token
}
errors {
field
message
}
}
}
We get newly created payment object:
{
"data": {
"checkoutPaymentCreate": {
"payment": {
"id": "UGF5bWVudDoyMg==",
"gateway": "mirumee.payments.dummy",
"token": "4000000000000069",
"creditCard": null,
"__typename": "Payment"
},
"errors": [],
"__typename": "CheckoutPaymentCreate"
}
}
}
Completing checkout and testing gateway response:
mutation {
checkoutComplete(token: "91e831f2-92c6-4977-aeca-3cc4c5292ead") {
errors {
field
message
code
__typename
}
order {
id
token
__typename
}
__typename
}
}
As a response, we get an error corresponding to the given card number:
{
"data": {
"checkoutComplete": {
"checkoutErrors": [
{
"field": null,
"message": "Card expired",
"code": "PAYMENT_ERROR",
"__typename": "CheckoutError"
}
],
"order": null,
"__typename": "CheckoutComplete"
}
}
}