Welcome Guest, Not a member yet? Register   Sign In
how do i do this in CI
#1

[eluser]nigelb[/eluser]
have been sent a 3rd party API to integrate and it has the following as a code same.

Code:
customer = new Customer(customerName, customerPrimaryEmailAddress);

I had thought I could do it as an array, like this:
Code:
$customer    = array($customer_name,$email);

but I am getting an error message
Code:
"java.lang.NumberFormatException: For input string: "Array"
"
any body got an idea?
#2

[eluser]pistolPete[/eluser]
[quote author="Pink Digital" date="1251384921"]any body got an idea?[/quote]

Yes, you are mixing Java and PHP.
What API do you want to integrate exactly? Post some code...
#3

[eluser]nigelb[/eluser]
The SOAP API asks for this...

Code:
Customer customer = new Customer("Bob Smith","[email protected]");
Address[] addresses = new Address[]{ new Address("Billing Address Line 1","Billing Address Line 2","City","County","Country","Post Code","Telephone"),new Address("Delivery Address Line 1","Delivery Address Line 2","City","County","Country","Post Code","Telephone") };
Product[] products = new Product[]{ new Product("AA009638","",1,210), new Product("AA010040","",3,660) };
Order order = webService.submitCompletedOrder(840,50, customer, addresses, products);

At the moment I have this:

Code:
foreach ($query->result() as $row) {
array_push($products, array($row->code,'',$row->qty, $row->price));
}

$customer    = array($customer_name,$email);
$addresses    =    array(array($customer_name, $address2, $city, $county, $country, $postcode, $telephone), array($del_address1, $del_address2, $del_city, $del_county, $del_country, $del_postcode, $del_telephone));
$order    =    array($total, $shipping, $customer, $addresses, $products);

$result = $client->call('submitCompletedOrder', $order);
#4

[eluser]nigelb[/eluser]
Anybody got any ideas about this?




Theme © iAndrew 2016 - Forum software by © MyBB