Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only resolve an UNRESOLVED charge #28

Open
ghost opened this issue May 31, 2020 · 2 comments
Open

Can only resolve an UNRESOLVED charge #28

ghost opened this issue May 31, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented May 31, 2020

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.

@ghost
Copy link
Author

ghost commented May 31, 2020

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.

@Pgeo7
Copy link

Pgeo7 commented Mar 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant