当前位置: 首页>>代码示例>>PHP>>正文


PHP Braintree_Customer::delete方法代码示例

本文整理汇总了PHP中Braintree_Customer::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Customer::delete方法的具体用法?PHP Braintree_Customer::delete怎么用?PHP Braintree_Customer::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Braintree_Customer的用法示例。


在下文中一共展示了Braintree_Customer::delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteCustomer

 public function deleteCustomer($id)
 {
     $result = Braintree_Customer::delete($id);
     /* 
     echo "<pre>";
     print_r($result);
     echo "</pre>";
     */
     if ($result->success) {
         return $result;
         /*
         	     return(array('success'=>1,
                'customer_id'=>$result->customer->id
         ));
         */
     } else {
         return array('success' => 0, 'validation_errors' => $result->errors->deepAll());
     }
 }
开发者ID:tejrajs,项目名称:yiibraintree,代码行数:19,代码来源:YiiBraintree.php

示例2: deleteCustomer

 /**
  * Delete a customer within Braintree
  *
  * @param $customerId
  *
  * @return \Braintree_Result_Successful
  */
 public function deleteCustomer($customerId)
 {
     try {
         return Braintree_Customer::delete($customerId);
     } catch (Exception $e) {
         Gene_Braintree_Model_Debug::log($e);
     }
     return false;
 }
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:16,代码来源:Braintree.php

示例3: testDelete_deletesTheCustomer

 function testDelete_deletesTheCustomer()
 {
     $result = Braintree_Customer::create(array());
     $this->assertEquals(true, $result->success);
     Braintree_Customer::find($result->customer->id);
     Braintree_Customer::delete($result->customer->id);
     $this->setExpectedException('Braintree_Exception_NotFound');
     Braintree_Customer::find($result->customer->id);
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:9,代码来源:CustomerTest.php

示例4: deleteCustomer

 /**
  * Deletes customer
  * 
  * @param int $customerID
  */
 public function deleteCustomer($customerID)
 {
     try {
         Braintree_Customer::delete($customerID);
     } catch (Braintree_Exception $e) {
         Mage::logException($e);
     }
 }
开发者ID:portchris,项目名称:NaturalRemedyCompany,代码行数:13,代码来源:Creditcard.php

示例5: print_r

     $updateResult->success;
     print_r($updateResult);
 } else {
     if ($_POST['_act'] == 'findCustomer') {
         //echo $_POST['customer_id'];
         //$_POST['customer_id'] = '57306224';
         $findResult = Braintree_Customer::find((string) $_POST['customer_id']);
         print_r($findResult);
     } else {
         if ($_POST['_act'] == 'deleteCustomer') {
             $search = (string) $_POST['customer_id'];
             $file = './data/customerID.txt';
             $contents = file_get_contents($file);
             echo $contents = str_replace($_POST['customer_id'], trim((string) $_POST['customer_id'] . "_DELETED\r\n"), $contents);
             file_put_contents($file, $contents);
             $deleteResult = Braintree_Customer::delete((string) $_POST['customer_id']);
             print_r($deleteResult);
         } else {
             if ($_POST['_act'] == 'createPaymentMethod') {
                 $para_Arr = array();
                 if (isset($_POST['data'])) {
                     $postData = explode("&", urldecode($_POST['data']));
                     //[SETTING UP POST DATA TO SUPPORT AJAX]
                     foreach ($postData as $key => $value) {
                         $postValue = explode("=", $value);
                         $_POST[$postValue[0]] = $postValue[1];
                     }
                     unset($_POST['data']);
                 }
                 if ($_POST['verify'] == "true") {
                     echo "With Verify </br>";
开发者ID:KLBombaStick,项目名称:BrainTree,代码行数:31,代码来源:createTrans.php

示例6: delete

 /**
  * @param string $customerId
  * @return \Braintree_Result_Successful
  */
 public function delete($customerId)
 {
     return \Braintree_Customer::delete($customerId);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:8,代码来源:BraintreeCustomer.php

示例7: delete

 /**
  * Deletes a record via the API
  *
  * @param   object  $model
  * @param   mixed   $conditions
  * @return  bool
  */
 public function delete(Model $model, $conditions = null)
 {
     $ids = $this->_getIdsToBeDeleted($model, $conditions);
     if ($ids === false) {
         return false;
     }
     $entity = $this->_getModelEntity($model);
     if (!empty($ids)) {
         foreach ($ids as $id) {
             try {
                 switch ($entity) {
                     case 'Customer':
                         Braintree_Customer::delete($id);
                         break;
                     case 'Transaction':
                         $this->showError(__('Transactions cannot be deleted', true));
                         return false;
                         break;
                     case 'CreditCard':
                         Braintree_CreditCard::delete($id);
                         break;
                     case 'Address':
                         $exploded = explode('|', $id);
                         if (count($exploded) != 2) {
                             return false;
                         }
                         list($customer_id, $address_id) = $exploded;
                         Braintree_Address::delete($customer_id, $address_id);
                         break;
                     default:
                         return false;
                         break;
                 }
             } catch (Exception $e) {
                 $this->showError(print_r($e, true));
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:sime,项目名称:cakephp-braintree-plugin,代码行数:48,代码来源:BraintreeSource.php

示例8: failed

         if ($stmt = $mysqli->prepare("UPDATE members SET " . "password='" . $password . "', " . "salt='" . $random_salt . "'" . " WHERE id = ?")) {
             // Bind "$user_id" to parameter.
             $stmt->bind_param('i', $user_id);
             $stmt->execute();
             echo 'Password updated!<br><br><input type="button" value="Close" onClick="closePopup();">';
             exit;
         } else {
             echo 'Update failed (Error: DB)<br><br><input type="button" value="Submit" onClick="doChangePass();">';
             exit;
         }
         $stmt->close();
     } elseif (@isset($_POST["del"]) && $_POST["del"] == '1') {
         $user_id = sanitize($_SESSION['user_id']);
         $username = sanitize($_SESSION['username']) . "_FITNESS";
         // Delete the user from Braintree
         $result = Braintree_Customer::delete($username);
         // Delete the user from the database
         if ($stmt = $mysqli->prepare("DELETE FROM members WHERE id = ? LIMIT 1")) {
             // Bind "$user_id" to parameter.
             $stmt->bind_param('i', $user_id);
             $stmt->execute();
             echo 'Account deleted :(<br><br><input type="button" value="Close" onClick="closePopup();">';
             exit;
         } else {
             echo 'Account deletion failed (Error: DB) -';
             exit;
         }
         $stmt->close();
     }
 } else {
     echo "You literally can't even.";
开发者ID:beevo,项目名称:disruptivestrong,代码行数:31,代码来源:account-features.php

示例9: deleteCustomerInBT

 public function deleteCustomerInBT()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $id_user = isset($_POST['id_user']) ? addslashes($_POST['id_user']) : "";
     if (!$id_user) {
         Generic::errorMsg("ID User not found!");
     }
     if (!User::checkUserID($id_user)) {
         Generic::errorMsg("ID User not found!");
     }
     $json = array();
     $json['status_code'] = 1;
     try {
         $customer = Braintree_Customer::find($id_user);
     } catch (Braintree_Exception_NotFound $e) {
         Generic::errorMsg($e->getMessage());
     }
     $result = Braintree_Customer::delete($id_user);
     if (!$result->success) {
         Generic::errorMsg("Failed");
     }
     $objUser = new UserModel();
     $objUser->getByID($id_user);
     $objUser->braintree_id = "";
     $objUser->load = 1;
     $objUser->save();
     $json['results'] = "Success";
     echo json_encode($json);
     die;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:32,代码来源:Payment.php


注:本文中的Braintree_Customer::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。