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?

  1. 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?

  2. 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. Wanna bet?

    Op 25 mei 2012 om 22:42 heeft "Marc Guyer"<[email blocked]> het volgende geschreven:

  4. Marc Guyer closed this discussion on 25 May, 2012 09:36 PM.

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

Recent Discussions