Esempio n. 1
0
 /**
  * Deletes a payment method.
  *
  * @param int $customer_id Customer ID.
  * @param int $id          Payment method ID.
  *
  * @return void
  */
 public function delete_index($customer_id = null, $id = null)
 {
     $customer = $this->get_customer($customer_id);
     $payment_method = $this->get_paymentmethod($id, $customer);
     $deleted = \Service_Customer_Paymentmethod::delete($payment_method);
     if (!$deleted) {
         throw new HttpServerErrorException();
     }
 }
Esempio n. 2
0
 /**
  * Delete action.
  *
  * @param int $customer_id Customer ID.
  * @param int $id          Payment method ID.
  *
  * @return void
  */
 public function action_delete($customer_id = null, $id = null)
 {
     if (!Service_Customer_Paymentmethod::delete($this->get_paymentmethod($id))) {
         Session::set_alert('error', 'There was an error removing the customer payment method.');
     } else {
         Session::set_alert('success', 'The customer payment method has been removed.');
     }
     Response::redirect($this->get_customer($customer_id)->link('paymentmethods'));
 }