Closed hippolyte42 closed 2 years ago
wrote this small function that does the trick, let me know
import fetch from "node-fetch";
const cancelCharge = async (chargeCode: string, apiKey: string): Promise<void> => {
try {
await fetch(
`https://api.commerce.coinbase.com/charges/${chargeCode}/cancel`,
{
method: "POST",
headers: {
"X-CC-Api-Key": apiKey,
"X-CC-Version": "2018-03-22",
},
}
);
} catch (error) {
console.log("cancelCharge error:", error);
}
};
closed because duplicate
Is their a way to cancel a charge currently implemented with this package or plans to integrate such a feature in the near future? thank you