• Resolved modanmc

    (@modanmc)


    Hello,

    I have a website using this plugin “WooCommerce PayPal Powered by Braintree Payment Gateway” and I wanted to know if there are any hooks that would allow me to pass names from billing info on the checkout page to braintree as Customer. Something like this:

    result = Braintree::Transaction.sale(
      :amount => "100.00",
      :order_id => "order id",
      :merchant_account_id => "a_merchant_account_id",
      :payment_method_nonce => nonce_from_the_client,
      :customer => {
        :first_name => "Drew",
        :last_name => "Smith",
        :company => "Braintree",
        :phone => "312-555-1234",
        :fax => "312-555-1235",
        :website => "https://www.example.com",
        :email => "[email protected]"
      },
      :billing => {
        :first_name => "Drew",
        :last_name => "Smith",
        :company => "Braintree",
        :street_address => "1 E Main St",
        :extended_address => "Suite 403",
        :locality => "Chicago",
        :region => "IL",
        :postal_code => "60622",
        :country_code_alpha2 => "US"
      },
      :shipping => {
        :first_name => "Drew",
        :last_name => "Smith",
        :company => "Braintree",
        :street_address => "1 E 1st St",
        :extended_address => "Suite 403",
        :locality => "Bartlett",
        :region => "IL",
        :postal_code => "60103",
        :country_code_alpha2 => "US"
      },
      :options => {
        :submit_for_settlement => true
      },
    )

    , because whenever I go to braintree advanced search Customer column is missing information from whom the money were received. Please let me know. Thanks

    https://www.ads-software.com/plugins/woocommerce-gateway-paypal-powered-by-braintree/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey modanmc,

    If you look at woocommerce-gateway-paypal-powered-by-braintree/classes/class-wc-gateway-paypal-braintree.php under process_payment() you can see that the billing data and shipping data include first name and last name.

    // Billing data, assemble
    $billing = array(
    	'firstName'         => $order->billing_first_name,
    	'lastName'          => $order->billing_last_name,
    	'company'           => $order->billing_company,
    	'streetAddress'     => $order->billing_address_1,
    	'extendedAddress'   => $order->billing_address_2,
    	'locality'          => $order->billing_city,
    	'region'            => $order->billing_state,
    	'postalCode'        => $order->billing_postcode,
    	'countryCodeAlpha2' => $order->billing_country
    );
    Thread Starter modanmc

    (@modanmc)

    Hey Patrick,

    Thanks for this find. I’m just wondering if there’s any hook so I can make the change without altering the plugin files so I can update it in the future?..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sending Customer name to Braintree’ is closed to new replies.