Php script for updating contacts
For the name fields there have been some issues where people have names containing spaces (e.g.
First Name=Mary Jane) which will cause the import to fail.
Another important feature we use for testing is the -What If parameter.
I’ll give the necessary disclaimer here which is that !
Let’s just say that if you skip this step you will find yourself about 4GB deep in memory usage and crawling your way through the contact script.
But the ability to change the card a customer has on file is something you’ll likely want to enable for your users.
The good news is that updating the customer’s payment source in Stripe is pretty straightforward.
It’s not that I don’t know that the script works, but regardless of my confidence, it is an absolute must that you test any process in an alternate environment before you go live. We will step through the script together in sections to show what’s happening along the way. Management Object Not Found Exception] $contactfile = Import-CSV $rawfile In this section we’ve identified the location of the import file (assume X: SCRIPTS for the path and a filename of contacts.csv), as well as setting the alerts to continue on error.
# Set the file location $rawfile = “X: SCRIPTScontacts.csv” # Ignore Error Messages and continue on. Note that this is not alwasy 100% effective and may require some tweaking which I’ll update as I make more progress with the error handling.