Title: Braintree Checkout Errors
Last modified: August 30, 2016

---

# Braintree Checkout Errors

 *  [xzistance3](https://wordpress.org/support/users/xzistance3/)
 * (@xzistance3)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/braintree-checkout-errors/)
 * I have the latest WP and PMPro, which comes with Braintree built-in. However,
   I’m trying to do standard credit card payments using Braintree, and it keeps 
   throwing an error saying it is not able to create a Customer in Braintree. I’ve
   done some digging and I think the PMPro Braintree code is out-dated, as it is
   trying to use deprecated options for the Braintree API.
 * See here: [https://developers.braintreepayments.com/reference/request/customer/create/php#credit_card.cvv](https://developers.braintreepayments.com/reference/request/customer/create/php#credit_card.cvv)
 * This matches up with the error I keep getting from Braintree:
    `Failed to create
   customer. CVV must be 4 digits for American Express and 3 digits for other card
   types. Expiration date is invalid. Credit card number must be 12-19 digits.`
 * This lines up with the code in /paid-memberships-pro/classes/gateways/class.pmprogateway_braintree.
   php starting on line 596:
 *     ```
       try
       {
           $result = Braintree_Customer::create(array(
               'firstName' => $order->FirstName,
               'lastName' => $order->LastName,
               'email' => $order->Email,
               'phone' => $order->billing->phone,
               'creditCard' => array(
                   'number' => $order->braintree->number,
                   'expirationDate' => $order->braintree->expiration_date,
                   'cvv' => $order->braintree->cvv,
                   'cardholderName' =>  trim($order->FirstName . " " . $order->LastName),
                   'billingAddress' => array(
                       'firstName' => $order->FirstName,
                       'lastName' => $order->LastName,
                       'streetAddress' => $order->Address1,
                       'extendedAddress' => $order->Address2,
                       'locality' => $order->billing->city,
                       'region' => $order->billing->state,
                       'postalCode' => $order->billing->zip,
                       'countryCodeAlpha2' => $order->billing->country
                   )
               )
           ));
   
           if($result->success)
           {
               $this->customer = $result->customer;
           }
           else
           {
               $order->error = __("Failed to create customer.", "pmpro") . " " . $result->message;
               $order->shorterror = $order->error;
               return false;
           }
       }
       ```
   
 * This is the main payment gateway I need for a site I’m trying to launch ASAP,
   so I will try and hack the plugin to fix it for the time being.
 * [https://wordpress.org/plugins/paid-memberships-pro/](https://wordpress.org/plugins/paid-memberships-pro/)

Viewing 1 replies (of 1 total)

 *  [Vagelis](https://wordpress.org/support/users/eboxnet/)
 * (@eboxnet)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/braintree-checkout-errors/#post-6704623)
 * Hello,
    i am having the same error msg. It does look like the class is deprecated,
   any plan to update this ? Thanks

Viewing 1 replies (of 1 total)

The topic ‘Braintree Checkout Errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [braintree](https://wordpress.org/support/topic-tag/braintree/)
 * [pmpro](https://wordpress.org/support/topic-tag/pmpro/)

 * 1 reply
 * 2 participants
 * Last reply from: [Vagelis](https://wordpress.org/support/users/eboxnet/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/braintree-checkout-errors/#post-6704623)
 * Status: not resolved