本文整理汇总了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());
}
}
示例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;
}
示例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);
}
示例4: deleteCustomer
/**
* Deletes customer
*
* @param int $customerID
*/
public function deleteCustomer($customerID)
{
try {
Braintree_Customer::delete($customerID);
} catch (Braintree_Exception $e) {
Mage::logException($e);
}
}
示例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>";
示例6: delete
/**
* @param string $customerId
* @return \Braintree_Result_Successful
*/
public function delete($customerId)
{
return \Braintree_Customer::delete($customerId);
}
示例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;
}
示例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.";
示例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;
}