Why isn't the money added to the customer's account on my site after payment?

Hello, I have a problem
The client adds money to my site and buys services
There is a problem that I hope to find a solution to

After successful payment, the money is not credited to the customer in his account

This code

           $amount = (double)$amount;

    $insert = $conn->prepare("INSERT INTO payments SET client_id=:c_id, payment_amount=:amount, payment_privatecode=:code, payment_method=:method, payment_mode=:mode, payment_create_date=:date, payment_ip=:ip, payment_extra=:extra");
          $insert->execute(array("c_id" => $user['client_id'], "amount" => $amount, "code" => $paymentCode, "method" => $method_id, "mode" => "", "date" => date("Y.m.d H:i:s"), "ip" => GetIP(), "extra" => $paymentCode));
          $success = 1;
          $successText = "Your payment was initiated successfully, you are being redirected..";
        $data = [
             "redirect_url"=> "https://webhook.site/8c16529b-dab9-4a62-af0e-ea759d1f7abf",
            "business_name" => "Dknar", 
            "customer_email" => $user['email'], 
            "customer_name" => $user['client_id'].','.$paymentCode.','.$method_id.','.$paymentCode, 
            "local_price" => [
                  "amount" => $amount, 
                  "currency" => "USD" 
            "memo" => "Balance recharge - ".  $user['email'] 
         $fields_string = json_encode($data);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.commerce.coinbase.com/invoices');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);

$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'X-Cc-Api-Key: '.$extra['api_key'];
$headers[] = 'X-Cc-Version: 2018-03-22';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);

//echo $result;

Sorry, but I don’t understand programming very well

Hi @mmsshaks! Welcome to the Coinbase Cloud Developer Forum, we appreciate you taking interest in using the Coinbase Cloud APIs. We’re happy to help, but first we’ll need you to provide us with the following information so that we can further assist you with the issue:

  • Can you share with us the process flow on how your platform/site works as well as the process of how your customers can add money to your site to buy goods and services?
  • If possible, can you also specify which Coinbase Commerce endpoints are being utilized for the processes involved for such types of transactions? This will be essential for us so we could have a better understanding of your scenario.
  • Can you share if there has been a similar scenario in the past where your customer has successfully added money to his account on your site? It would also be very helpful if you can provide screenshots and code snippets of successful transactions.

Once you send us the information requested above, we’ll work to quickly address this issue. We appreciate your patience and understanding. Looking forward to your response!