2
votes

Now what I want to do is show all the payment methods a customer used before and let him to choose for the next transaction.

I have successfully fetch all the payment methods, however I find if a customer used use a PayPal account before, I can not set a credit card as the default one by use

$updateResult = Braintree_PaymentMethod::update(
 ‘credit_card_token',
  [
   'options' => [
   'makeDefault' => true
   ]
  ]
 );

or

 $updateResult = Braintree_Customer::update(
    $customerId,
    array(
    'creditCard' => array(
      'paymentMethodNonce' => $nonceFromTheClient,
      'options' => array(
          'makeDefault' => true
        )
      )
    )
  );

The drop-in UI will still show the PayPal account first. Although I can see the this credit card is shift to the default on by query

$paymentMethod = Braintree_PaymentMethod::find('token’);
$paymentMethod -> default

So my question is can I set directly show credit card as the default payment method in drop-in UI even the user use PayPal before?

1

1 Answers

0
votes

I work as a developer at Braintree. The Drop-in UI is configured to display the most recently used payment method that was successful, not the PayPal account or the default payment method. Currently, you cannot override this behavior in the Drop-in UI, but the team is working on a way to offer this functionality.

I recommend reading through this related GitHub issue to see if any of the proposed alternatives might work for you. You can also subscribe to the issue if you would like to be notified of any updates.