$appointment->StartDateTime = $time;
            $item->ID = $service->ID;
            $cartItem->Appointments = array($appointment);
            $cartItem->Quantity = 1;
            $cartItem->Item = toComplexType($item, 'Service');
            $payment->CreditCardNumber = 81524245458;
            $payment->Amount = 2;
            $payment->BillingAddress = '123 Happy Ln';
            $payment->BillingCity = 'San Luis Obispo';
            $payment->BillingState = 'CA';
            $payment->BillingPostalCode = '93405';
            $payment->ExpYear = 2014;
            $payment->ExpMonth = 7;
            $payment->BillingName = 'Mike Tyson';
            $paymentItem = toComplexType($payment, 'CreditCardInfo');
            $result = $saleService->CheckoutShoppingCart(null, $client->ID, true, array($cartItem), array($paymentItem));
            if ($result->CheckoutShoppingCartResult->Status == 'Success') {
                ?>
<h2>Done</h2><?php 
            }
        }
    } else {
        // try to sign them up for the appointment
        $appointment->Location->ID = $times[0]->Location->ID;
        $appointment->Staff->ID = $times[0]->Staff->ID;
        $appointment->SessionType->ID = $times[0]->SessionType->ID;
        $appointment->Client->ID = $client->ID;
        $appointment->StartDateTime = $time;
        $result = $appointmentService->AddOrUpdateAppointments(array($appointment));
        $appointmentHtml = '<table><tr><td>Action</td><td>Message</td><td>GUID</td></tr>';
        if (count($result->AddOrUpdateAppointmentsResult->Appointments) > 0) {