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

removePaymentMethod() public method

public removePaymentMethod ( $paymentMethod )
    public function removePaymentMethod($paymentMethod)
    {
        parent::removePaymentMethod($paymentMethod);
        $wepay = Utils::setupWePay($this->accountGateway);
        $response = $wepay->request('/credit_card/delete', ['client_id' => WEPAY_CLIENT_ID, 'client_secret' => WEPAY_CLIENT_SECRET, 'credit_card_id' => intval($paymentMethod->source_reference)]);
        if ($response->state == 'deleted') {
            return true;
        } else {
            throw new Exception(trans('texts.failed_remove_payment_method'));
        }
    }