Skip to content

Commit

Permalink
Braintree - PHP Fatal Error, ref #533
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Aug 13, 2016
1 parent 21fe176 commit dc9c51f
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions classes/wc-gateway-braintree-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function angelleye_do_payment($order) {
'firstName' => $order->billing_first_name,
'lastName' => $order->billing_last_name,
'company' => $order->billing_company,
'phone' => $this->str_truncate(preg_replace('/[^\d-().]/', '', $order->billing_phone), 14, ''),
'phone' => $order->billing_phone,
'email' => $order->billing_email,
);
$request_data['amount'] = number_format($order->get_total(), 2, '.', '');
Expand Down Expand Up @@ -451,23 +451,6 @@ public function angelleye_do_payment($order) {
}
}

public function str_truncate($string, $length, $omission = '...') {
if (self::multibyte_loaded()) {
if (mb_strlen($string) <= $length) {
return $string;
}
$length -= mb_strlen($omission);
return mb_substr($string, 0, $length) . $omission;
} else {
$string = self::str_to_ascii($string);
if (strlen($string) <= $length) {
return $string;
}
$length -= strlen($omission);
return substr($string, 0, $length) . $omission;
}
}

public function get_braintree_options() {
return array('submitForSettlement' => true, 'storeInVaultOnSuccess' => '');
}
Expand Down Expand Up @@ -735,18 +718,6 @@ public function payment_scripts() {
if (!is_checkout() || !$this->is_available()) {
return;
}
// $this->angelleye_braintree_lib();
// $this->add_log('Begin Braintree_ClientToken::generate Request');
// $clientToken = Braintree_ClientToken::generate();
// if (isset($clientToken) && !empty($clientToken)) {
// $this->add_log('Braintree_ClientToken::generate Response: ' . '**************************************************************');
// }
// $suffix = ''; //defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script('braintree-gateway', 'https://js.braintreegateway.com/v2/braintree.js', array(), WC_VERSION, false);
// wp_enqueue_script('wc-braintree-gateway', plugins_url('assets/js/braintree-gateway' . $suffix . '.js', __DIR__), array('jquery', 'braintree-gateway'), WC_VERSION, false);
// wp_localize_script('wc-braintree-gateway', 'Braintree_commerce_params', array(
// 'key' => $clientToken
// ));
}

}

0 comments on commit dc9c51f

Please sign in to comment.