public function testAll()
 {
     // Create new customer profile
     $request = new Request();
     $customerProfile = new Customer();
     $customerProfile->description = "Description of customer";
     $customerProfile->merchantCustomerId = time() . rand(1, 10);
     $customerProfile->email = "*****@*****.**";
     $response = $request->createCustomerProfile($customerProfile);
     $this->assertTrue($response->isOk());
     $customerProfileId = $response->getCustomerProfileId();
     // Update customer profile
     $customerProfile->description = "New description";
     $customerProfile->email = "*****@*****.**";
     $response = $request->updateCustomerProfile($customerProfileId, $customerProfile);
     $this->assertTrue($response->isOk());
     // Add payment profile.
     $paymentProfile = new PaymentProfile();
     $paymentProfile->customerType = "individual";
     $paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
     $paymentProfile->payment->creditCard->expirationDate = "2015-10";
     $response = $request->createCustomerPaymentProfile($customerProfileId, $paymentProfile);
     $this->assertTrue($response->isOk());
     $paymentProfileId = $response->getPaymentProfileId();
     // Update payment profile.
     $paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
     $paymentProfile->payment->creditCard->expirationDate = "2017-11";
     $response = $request->updateCustomerPaymentProfile($customerProfileId, $paymentProfileId, $paymentProfile);
     $this->assertTrue($response->isOk());
     // Add shipping address.
     $address = new Address();
     $address->firstName = "john";
     $address->lastName = "Doe";
     $address->company = "John Doe Company";
     $address->address = "1 Main Street";
     $address->city = "Boston";
     $address->state = "MA";
     $address->zip = "02412";
     $address->country = "USA";
     $address->phoneNumber = "555-555-5555";
     $address->faxNumber = "555-555-5556";
     $response = $request->createCustomerShippingAddress($customerProfileId, $address);
     $this->assertTrue($response->isOk());
     $customerAddressId = $response->getCustomerAddressId();
     // Update shipping address.
     $address->address = "2 First Street";
     $response = $request->updateCustomerShippingAddress($customerProfileId, $customerAddressId, $address);
     $this->assertTrue($response->isOk());
     // Create Auth & Capture Transaction
     $transaction = new Transaction();
     $transaction->amount = "9.79";
     $transaction->customerProfileId = $customerProfileId;
     $transaction->customerPaymentProfileId = $paymentProfileId;
     $transaction->customerShippingAddressId = $customerAddressId;
     $lineItem = new LineItem();
     $lineItem->itemId = "4";
     $lineItem->name = "Cookies";
     $lineItem->description = "Chocolate Chip";
     $lineItem->quantity = "4";
     $lineItem->unitPrice = "1.00";
     $lineItem->taxable = "true";
     $lineItem2 = new LineItem();
     $lineItem2->itemId = "4";
     $lineItem2->name = "Cookies";
     $lineItem2->description = "Peanut Butter";
     $lineItem2->quantity = "4";
     $lineItem2->unitPrice = "1.00";
     $lineItem2->taxable = "true";
     $transaction->lineItems[] = $lineItem;
     $transaction->lineItems[] = $lineItem2;
     $response = $request->createCustomerProfileTransaction("AuthCapture", $transaction);
     $this->assertTrue($response->isOk());
     $transactionResponse = $response->getTransactionResponse();
     $this->assertTrue($transactionResponse->approved);
     $transactionId = $transactionResponse->transaction_id;
     // Void the transaction
     $transaction = new Transaction();
     $transaction->transId = $transactionId;
     $response = $request->createCustomerProfileTransaction("Void", $transaction);
     $this->assertTrue($response->isOk());
     $transactionResponse = $response->getTransactionResponse();
     $this->assertTrue($transactionResponse->approved);
     // Delete Shipping Address
     $response = $request->deleteCustomerShippingAddress($customerProfileId, $customerAddressId);
     $this->assertTrue($response->isOk());
     // Delete payment profile.
     $response = $request->deleteCustomerPaymentProfile($customerProfileId, $paymentProfileId);
     $this->assertTrue($response->isOk());
     // Delete the profile id for future testing.
     $response = $request->deleteCustomerProfile($customerProfileId);
     $this->assertTrue($response->isOk());
 }