Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback when saved credit cards have been refreshed #540

Open
pawelchmara opened this issue Aug 14, 2019 · 7 comments
Open

Callback when saved credit cards have been refreshed #540

pawelchmara opened this issue Aug 14, 2019 · 7 comments
Labels

Comments

@pawelchmara
Copy link

General information

  • SDK/Library version: 1.19.0
  • Environment: Sandbox
  • Browser and OS; Chrome,Firefox etc.

Issue description

When Drop-in is in management mode (vaultManager: true) and new card has been added or removed, there is no callback information that list of credit cards have been refreshed. Also function clearSelectedPaymentMethod() has no callback parameter.

@gesa
Copy link
Contributor

gesa commented Aug 21, 2019

Hey @pawelchmara, thanks for opening this issue and sorry for the delayed response. I plan to take a look at this today and I'll get back to you.

@pawelchmara
Copy link
Author

Hey @gesa, maybe have you already looked at this problem?

@gesa
Copy link
Contributor

gesa commented Aug 30, 2019

I'm so sorry @pawelchmara, I totally flaked on you. Not cool of me.

So the paymentMethodRequestable and noPaymentMethodRequestable events fire any time a credit card is added (and, as a result, selected), removed (and, as a result, deselected), or programmatically deselected by calling clearSelectedPaymentMethod().

For your first concern, regarding changes made to the credit card list, I'm not entirely certain I understand what method's callback you'd expect to be firing in that scenario. Is there a reason the event handlers don't fulfill your needs?

On a similar note, what's the situation where clearSelectedPaymentMethod() would need to fire an asynchronous callback (or return a promise)?

I fired up a local server and played around with these behaviors to see if I was missing some obvious piece of functionality that wouldn't occur to me when looking at it from the braintree side but I got nothin.

@pawelchmara
Copy link
Author

Maybe I will try explain what I need. Please look at the screen below:

Dropin

I use Drop In like a vault manager and would like to add possibility to customer to select default credit card. So I need clear information that new card has been added or removed to refresh select options.

When you remove credit card, paymentMethodRequestable event is fired. But also when you choose credit card, this event is also fired. So you don't know exactly, if credit card has been removed or existing card is selected. What's more, if you fill in the payment method form with the correct data, the same event will fire again. Ultimately, you can't recognize what really happened.

I need this information to refresh select options. Of course, I can refresh select options every time when paymentMethodRequestable event is fired, but this is not a good solution.

As for the clearSelectedPaymentMethod method, you are right, I do not need callback.

@gesa
Copy link
Contributor

gesa commented Sep 6, 2019

You bring up good points @pawelchmara! We're discussing the best way improve on this and will follow up on this issue.

@pawelchmara
Copy link
Author

How about adding a new button "Set as default" in edit mode:

temp

I think it is very easy to do for you and this functionality will be useful for users.

@crookedneighbor
Copy link
Contributor

@pawelchmara It's easy to add it to Drop-in, but we'd also need to update the API to allow authorizing that change from the client. In addition, there would need to be some design exploration to figure out the best UI for how it is presented.

Not impossible to do, and in my opinion, the right solution for what you describe that you need out of Drop-in, just want to note that it's not as simple as it looks at first glance.

@gesa gesa added the v2 label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants