public function completeOffsitePurchase($input)
 {
     parent::completeOffsitePurchase(['token' => Request::query('pt')]);
 }
 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());
     }
 }
 protected function attemptVoidPayment($response, $payment, $amount)
 {
     if (!parent::attemptVoidPayment($response, $payment, $amount)) {
         return false;
     }
     $data = $response->getData();
     if ($data instanceof \Braintree\Result\Error) {
         $error = $data->errors->deepAll()[0];
         if ($error && $error->code == 91506) {
             return true;
         }
     }
     return false;
 }
 protected function attemptVoidPayment($response, $payment, $amount)
 {
     if (!parent::attemptVoidPayment($response, $payment, $amount)) {
         return false;
     }
     return $response->getCode() == 4004;
 }