Example #1
0
 protected function runCreateUserProfile()
 {
     $client = new SoapClient($this->cim_test_url);
     $params = $this->returnSoapAuth();
     $params['profile'] = array("merchantCustomerId" => $this->transaction['foreign_key'], "descriptions" => "", "email" => !empty($this->customer['email']) ? $this->customer['email'] : "", "paymentProfiles" => array("CustomerPaymentProfileType" => array("customerType" => "individual", "payment" => array("creditCard" => array("cardNumber" => $this->card_data['number'], "expirationDate" => "20" . $this->card_data['exp_year'] . "-" . $this->card_data['exp_month'], "cardCode" => $this->card_data['code']), "billTo" => array("firstName" => $this->customer['first_name'], "lastName" => $this->customer['last_name'], "address" => $this->customer['address'], "city" => $this->customer['city'], "state" => $this->customer['state'], "country" => $this->customer['country'], "zip" => $this->customer['postal'], "phone" => $this->customer['phone'])))));
     $result = $client->CreateCustomerProfile($params);
     if ($result->CreateCustomerProfileResult->resultCode == "Ok") {
         $this->set(array("UserBillingProfile" => array("acc_op1" => $result->CreateCustomerProfileResult->customerProfileId, "acc_op2" => $result->CreateCustomerProfileResult->customerPaymentProfileIdList->long)));
         $this->transaction_result['acc_op1'] = $result->CreateCustomerProfileResult->customerProfileId;
         $this->transaction_result['acc_op2'] = $result->CreateCustomerProfileResult->customerPaymentProfileIdList->long;
     }
 }