#niti -php

1 messages · Page 1 of 1 (latest)

real cosmos
#

@sharp belfry could you share the exact code you're using and the exact stack trace of the error?

sharp belfry
#

Okay

#

Delete stripe api file code below

#

namespace Stripe\ApiOperations;

/**

  • Trait for deletable resources. Adds a delete() method to the class.
  • This trait should only be applied to classes that derive from StripeObject.
    /
    trait Delete
    {
    /
    *
    • @param null|array $params

    • @param null|array|string $opts

    • @throws \Stripe\Exception\ApiErrorException if the request fails

    • @return static the deleted resource
      */
      public function delete($params = null, $opts = null)
      {
      self::_validateParams($params);

      $url = instanceUrl();
      list($response, $opts) = $this->_request('delete', $url, $params, $opts);
      $this->refreshFrom($response, $opts);

      return $this;
      }
      }

real cosmos
#

@sharp belfry this means you're probably using an old version of our library from before it added static methods. Try retrieving it first then deleting it

#
$endpoint = \Stripe\WebhookEndpoint::retrieve($id);
$endpoint->delete();
sharp belfry
#

okay

#

Still getting the same error

real cosmos
#

can you share the exact code you wrote?

#

not a picture of your screen please.

sharp belfry
#

ok sorry I placed the code twice now it working fine

#

thanks a lot

real cosmos
#

cool!

sharp belfry
#

One more thing how we can access using api the signing-secret key of any webhook

real cosmos
#

you don't

#

the secret is returned only once, when you create an endpoint and you need to copy and store it securely at that point