Updating a Customer
To update a customer:
require 'chargeover_ruby'
# Initialize the client
client = ChargeOver::Client.new("https://your-chargeover-url.com", "your_api_key", "your_api_secret")
# Define the customer ID and the updated data
customer_id = "12345" # Replace with the actual customer ID
updated_data = {
'first_name' => "Jane",
'last_name' => "Doe",
'phone' => "987-654-3210"
}
# Update the customer
response = client.update(:customer, customer_id, updated_data)
# Check if successful
if response['status'] == 'success'
puts "Customer updated successfully: #{response['response']}"
else
puts "Error: #{response['error']}"
end