Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

migrate cards from Balanced to Braintree #3391

Closed
chadwhitacre opened this issue May 8, 2015 · 40 comments
Closed

migrate cards from Balanced to Braintree #3391

chadwhitacre opened this issue May 8, 2015 · 40 comments

Comments

@chadwhitacre
Copy link
Contributor

To: Balanced, Braintree

Greetings, teams. What's our process for migrating Gratipay's card vault from Balanced to Braintree?

From: Braintree

The process is pretty simple. Just reach out to [email protected] and let them know you’d like to export to us. We’ll receive a file from them and run the import on our side. The process takes about a week from beginning to end. We cannot process ACH transactions so unfortunately those customers will not be imported. Let me know if there are any questions.

@chadwhitacre chadwhitacre added this to the Balanced shutdown milestone May 8, 2015
@chadwhitacre
Copy link
Contributor Author

From: Balanced:

Send this encrypted blob to your guys at Braintree.

-----BEGIN PGP MESSAGE-----
[...]
-----END PGP MESSAGE-----

It contains the data they need to import all your credit cards and bank accounts into Braintree. It's encrypted with their public key.

Please note that the URL within expires in 24 hours so if they don't get to this today they'll likely need to reach out for a new URL. They can email the support team directly and we'll assist them.

Forwarded to Braintree!

@chadwhitacre
Copy link
Contributor Author

Okay, we've initiated the migration, though we may need to reinitiate it (though Braintree might take that initiative themselves per Marshall's email?).

That means that anyone who updates their card between now and when we start vaulting on Braintree will not have their new info saved on Braintree, unless we make another export. However, anyone who changes their card on Braintree before the second export lands could potentially have their change clobbered.

One option would be to simply disable the credit card form until cards are migrated.

@chadwhitacre
Copy link
Contributor Author

From: Braintree
To: Balanced
CC: me

Hi Balanced Support,

Unfortunately I missed the window for this export. May I request it get run again? Thank you.

@chadwhitacre
Copy link
Contributor Author

From: Balanced
To: Braintree
CC: Me

No worries, []. Here's a new link.

@chadwhitacre
Copy link
Contributor Author

From: Braintree
To: Balanced
Cc: Me

Thanks for resending Marshall, we were able to pull down the file successfully. Chad, I have scheduled Gratispay for the first available opening on our import calendar, which is this Thursday (5/14). Let me know if you have any questions!

To: Balanced
Cc (I think?): Braintree

Awesome, thank you! :D

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

Thanks for your patience. We are on track for Thursday. We’ll let you know if there are any last-minute issues.

https://gratipay.freshdesk.com/helpdesk/tickets/2129

Please see attached for the logs. The import log and the error log should be clear but you had around 300 tokens with a customer ID of none. We imported those as well and had our gateway generate the tokens for them. Please take a look and let us know if there are any questions.

https://gratipay.freshdesk.com/helpdesk/tickets/2145

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

Picking up from #3470 (comment) ...

@chadwhitacre
Copy link
Contributor Author

you had around 300 tokens with a customer ID of none.

Hrm ... old records on Balanced, from before they introduced the customer type? Hunch it relates to the problems we've had in the past with Balanced URLs (#2085).

@chadwhitacre
Copy link
Contributor Author

So the work here is to write a script to populate the Participant ID custom field for all of the new records from Balanced.

@chadwhitacre
Copy link
Contributor Author

Vault search in the web UI doesn't support custom fields. :-/

screen shot 2015-05-21 at 1 10 58 pm

@chadwhitacre
Copy link
Contributor Author

Looking at the logs, I count 26 names of customers in the bad import log that aren't present in the successful import log.

@chadwhitacre
Copy link
Contributor Author

Do we just let those people go? What's our option? Contact Balanced and ask for a re-export?

@chadwhitacre
Copy link
Contributor Author

I count 328 customers in the none_customer log and 4,567 in the good log, so that's about 7% of records affected.

@chadwhitacre
Copy link
Contributor Author

To: Balanced

Braintree reports that 328 out of 4,895 customer records (7%) in the import file they received have no customer id. Any idea what that's about?

@chadwhitacre
Copy link
Contributor Author

I count 3,061 unique names in the good import (not counting Nil and None). 26 out of 3,061 ain't bad.

@chadwhitacre
Copy link
Contributor Author

How does the set of customer ids that Braintree now has compare with what we have for balanced_customer_href?

@chadwhitacre
Copy link
Contributor Author

And how does the set of customer ids in the CSV logs compare with what's actually in Braintree?

@chadwhitacre
Copy link
Contributor Author

We have 5,309 participants with a balanced_customer_id.

@chadwhitacre
Copy link
Contributor Author

Alright, I exported customers from Braintree, and confirmed that the set of Balanced ids in the import log is identical to the set in Braintree.

@chadwhitacre
Copy link
Contributor Author

From: Balanced

Please pass along a list of the customers in question and I'll have engineering take a look at this for you!

To: Balanced

In working on an answer to your question, I've discovered that the Card ID may suffice to make the connection between our user and the customer record at Balanced/Braintree. I'll proceed with that and let you know if I get stuck again. Thanks! :-)

@chadwhitacre
Copy link
Contributor Author

Balanced Customer IDs

Source IDs Not in Balanced Not in Gratipay Not in Braintree
Balanced 5,310 - 13 743
Gratipay 5,309 12 - 749
Braintree 4,567 0 7 -

@chadwhitacre
Copy link
Contributor Author

Balanced Card IDs

Source IDs Not in Balanced Not in Gratipay Not in Braintree
Balanced 4,227 - 329 5
Gratipay 4,012 114 - 5
Braintree 5,865 1,643 1,858 -

@chadwhitacre
Copy link
Contributor Author

I can't say that I'm entirely surprised that the numbers don't seem to quite line up. :-/

@chadwhitacre
Copy link
Contributor Author

The task is to link up Gratipay participants with Braintree customers, by setting braintree_customer_id in the Gratipay database, and participant_id in Braintree. A false match means that we end up charging one person for another's subscriptions: bad!

@chadwhitacre
Copy link
Contributor Author

I'm surprised that there are so many card IDs in Braintree that aren't in Balanced or Gratipay. I only looked at card IDs matching the CC... format that Balanced used.

@chadwhitacre
Copy link
Contributor Author

There are only 15 "payment method tokens" in this Braintree export that don't match the CC... pattern.

@chadwhitacre
Copy link
Contributor Author

Maybe Balanced included invalidated cards in the export to Braintree, but not in the export to us?

@chadwhitacre
Copy link
Contributor Author

We should also create new exchange_routes for the Braintree cards.

@rohitpaulk
Copy link
Contributor

Note: We only want to update braintree_customer_id for people who don't have a route with the braintree-cc network already (the new cards that are vaulted with braintree).

@chadwhitacre
Copy link
Contributor Author

Alright, I'm going to write this script based on the import log. I'm going to depend on the customer ID and card ID in there. I'll double-check to make sure that the mapping lines up with what we have for exchange routes in the db, and then add new exchange routes for braintree along with setting braintree_customer_id.

@chadwhitacre
Copy link
Contributor Author

I'm not going to worry about the records with no customer id for today.

@rohitpaulk
Copy link
Contributor

!m @whit537

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

At this point it sure feels like we'd better cut our losses. Better to have some credit card attrition than fail to get off Balanced in time.

We have cards waiting for us to use in Braintree. Maybe it's not the cleanest set of data but it's what we've got: it's too late to migrate more/better data from Balanced to Braintree.

Let's use the cards we have waiting for us at Braintree! :)

@chadwhitacre
Copy link
Contributor Author

The exchange route is what really matters. We do pass braintree_customer_id during create_card_hold, though from the docs it's not clear to me that that's strictly necessary.

@rohitpaulk
Copy link
Contributor

We do pass braintree_customer_id during create_card_hold, though from the docs it's not clear to me that that's strictly necessary.

There was a reason for that... If I recall correctly, it had something to do with custom fields. I'll dig in deeper later.

@chadwhitacre
Copy link
Contributor Author

The five at #3391 (comment) are probably explained by the import error log.

@chadwhitacre
Copy link
Contributor Author

Done and done!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants