PHP API

ra.keizer's Avatar

ra.keizer

25 May, 2012 01:30 PM

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. 1 Posted by ra.keizer on 25 May, 2012 01:35 PM

    ra.keizer's Avatar

    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. Support Staff 2 Posted by Marc Guyer on 25 May, 2012 08:42 PM

    Marc Guyer's Avatar

    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. 3 Posted by ra.keizer on 25 May, 2012 09:03 PM

    ra.keizer's Avatar

    Wanna bet?

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

  4. Support Staff 4 Posted by Marc Guyer on 25 May, 2012 09:36 PM

    Marc Guyer's Avatar
  5. 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

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM