App\Ninja\PaymentDrivers\BasePaymentDriver::removePaymentMethod PHP Method

removePaymentMethod() public method

public removePaymentMethod ( $paymentMethod )
    public function removePaymentMethod($paymentMethod)
    {
        $paymentMethod->delete();
    }

Usage Example

 public function removePaymentMethod($paymentMethod)
 {
     parent::removePaymentMethod($paymentMethod);
     if (!$paymentMethod->relationLoaded('account_gateway_token')) {
         $paymentMethod->load('account_gateway_token');
     }
     $response = $this->gateway()->deleteCard(['customerReference' => $paymentMethod->account_gateway_token->token, 'cardReference' => $paymentMethod->source_reference])->send();
     if ($response->isSuccessful()) {
         return true;
     } else {
         throw new Exception($response->getMessage());
     }
 }
All Usage Examples Of App\Ninja\PaymentDrivers\BasePaymentDriver::removePaymentMethod