For the purposes of making test refunds call, you'll be using the refunds simulator in your Testing Pays account.
To open the simulator interface, login to your Testing Pays account and click "OPEN" on the "refunds" bookmark on your dashboard. You'll see the following sections in your simulator:
The simplest option is using cURL. To create a Stripe refund, at minimum you need a charge id and amount. Using cURL, you need to submit these parameters as you would with a form POST.
You can add more parameters to your refunds: metadata, reason for refund or the application fee (for connected account). It's important to provide as much detail and metadata as possible for refunds.
Next, your code needs to send the assembled request to the refunds simulator. The URL to POST to can be found under the "Integration" tab of the simulator - make sure to copy&paste this URL from your simulator as it contains your unique API_KEY.
The example shown below shows how to make a refunds request using cURL.
curl -X POST -u API_KEY: \
-d amount=500 \
-d charge=ch_sa9sd9f8asdf98329as9df \
https://api.testingpays.com/API_KEY/stripe/v1/refunds
The simulator will send back a JSON object that contains information about the refund - echoing back your call details along with the defaults
{
"id": "re_yNVpaqaC1I8PAlTLMyfB3DEs",
"object": "refund",
"amount": 100,
"balance_transaction": "txn_CzhhmV0CSrx4J5GMs7UD2MYb",
"charge": "ch_19zmXfDPjEFprg5kXmfIlmfc",
"created": 1550495639,
"currency": "eur",
"metadata": { },
"reason": null,
"receipt_number": null,
"status": "succeeded"
}
Get a webhook callback within seconds and integrate the full payment, subscription and invoice flow in your