PHP API
I've created 2 user with following code which works fine:
$data = array(
'code' => 'USER1',
'firstName' => 'Milton',
'lastName' => 'Waddams',
'email' => '[email blocked]',
'subscription' => array(
'planCode' => 'FREE'
)
);
try {
$response = $client->newCustomer($data);
echo "\n\tCreated\n";
} catch (Exception $e) {
echo "\n\t" . 'ERROR: (' . $e->getCode() . ') ' . $e->getMessage() . "\n";
}
$data = array(
'code' => 'USER2',
'firstName' => 'Albert',
'lastName' => 'Einstein',
'email' => '[email blocked]',
'subscription' => array(
'planCode' => 'FREE'
)
);
try {
$response = $client->newCustomer($data);
echo "\n\tCreated\n";
} catch (Exception $e) {
echo "\n\t" . 'ERROR: (' . $e->getCode() . ') ' . $e->getMessage() . "\n";
}
After that I try to delete both users with:
try {
$response = $client->deleteCustomer('USER1');
echo "\n\tDeleted\n";
} catch (Exception $e) {
echo "\n\t" . 'ERROR: (' . $e->getCode() . ') ' . $e->getMessage() . "\n";
}
try {
$response = $client->deleteCustomer('USER2');
echo "\n\tDeleted\n";
} catch (Exception $e) {
echo "\n\t" . 'ERROR: (' . $e->getCode() . ') ' . $e->getMessage() . "\n";
}
First user is deleted succesfully, but on the second one I get a ERROR: (404) Customer not found
Why is that?
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by ra.keizer on 25 May, 2012 01:35 PM
This seems to work when I create a new instance of the client between the calls.
Seems to me there are bugs in the client?
Support Staff 2 Posted by Marc Guyer on 25 May, 2012 08:42 PM
That sounds odd. There are hundreds of merchants using the PHP wrapper so I'd be surprised if there's a problem there. I have turned on verbose logging on your account to see what API requests we're getting. Please replicate that and note the time and I'll take a look at our logs.
3 Posted by ra.keizer on 25 May, 2012 09:03 PM
Wanna bet?
Op 25 mei 2012 om 22:42 heeft "Marc Guyer"<[email blocked]> het volgende geschreven:
Support Staff 4 Posted by Marc Guyer on 25 May, 2012 09:36 PM
Continued here: http://support.cheddargetter.com/discussions/problems/1548-more-php...
Marc Guyer closed this discussion on 25 May, 2012 09:36 PM.