Exemplo n.º 1
0
 /**
  * Delete a card.
  *
  * @param   string|Customer $customer the customer id or the customer object
  * @param   string|Card $card the card id or the card object
  * @param   Payplug\Payplug $payplug  the client configuration
  *
  * @throws  Payplug\Exception\ConfigurationNotSetException
  */
 public static function deleteCard($customer, $card, Payplug\Payplug $payplug = null)
 {
     if ($payplug === null) {
         $payplug = Payplug\Payplug::getDefaultConfiguration();
     }
     if ($customer instanceof Customer) {
         $customer = $customer->id;
     }
     if ($card instanceof Card) {
         $card = $card->id;
     }
     $httpClient = new Payplug\Core\HttpClient($payplug);
     $httpClient->delete(Payplug\Core\APIRoutes::getRoute(Payplug\Core\APIRoutes::CARD_RESOURCE, $card, array('CUSTOMER_ID' => $customer)));
 }
Exemplo n.º 2
0
 /**
  * Delete a customer.
  *
  * @param   Payplug\Payplug $payplug the client configuration
  *
  * @throws  Payplug\Exception\ConfigurationNotSetException
  */
 public function delete(Payplug\Payplug $payplug = null)
 {
     if ($payplug === null) {
         $payplug = Payplug\Payplug::getDefaultConfiguration();
     }
     $httpClient = new Payplug\Core\HttpClient($payplug);
     $httpClient->delete(Payplug\Core\APIRoutes::getRoute(Payplug\Core\APIRoutes::CUSTOMER_RESOURCE, $this->id));
 }