coinbase-commerce-php
coinbase-commerce-php copied to clipboard
Can only resolve an UNRESOLVED charge
I am trying to sniff out OVERPAID charges and auto-resolve them.
I do a Charge::retrieve()
and then find the last item of the timeline $timeline = (array) $charge->timeline;
This works and I get this last item:
=> [
"status" => "UNRESOLVED",
"context" => "OVERPAID",
"time" => "2020-05-31T20:43:00Z",
"payment" => [
"network" => "ethereum",
"transaction_id" => "REMOVED",
"value" => [
"amount" => "0.047840500",
"currency" => "ETH",
],
],
]
So the status is UNRESOLVED and the context is OVERPAID. Great. So I run:
if ($last['status'] == 'UNRESOLVED' && $last['context'] == 'OVERPAID') {
$charge->resolve();
}
Which throws this error:
CoinbaseCommerce/Exceptions/InvalidRequestException with message 'can only resolve an UNRESOLVED charge'
This IMHO doesn't make any sense as the charge is UNRESOLVED. And in the CB dashboard I can actually resolve the charge by clicking a button.
By the way: IMHO there should just be an easy webhook event for underpaid or overpaid charges which also straight up shows by how much it was under/overpaid.
hello wondering if you can help, I have accidently sent USDT to an old coinbase commerce charge address, the original charge was created over a month ago and was paid at the time created. Can you tell me what happens to the charge addresses over time do they expire and become invalid address ie. i have lost the USDT? or the wallets created by coinbase commerce charges are permanent and still received the payment & can be seen/accessed on the merchants dashboard as they are claiming they havent received it.