Automatically accept order

Started by jlopez, October 29, 2013, 10:49:28 AM

jlopez

We would like to automatically accept certain kind of orders if direct debit is used for payment (e.g. activate web hosting right away if customer has purchased more than one jillion dollars worth of products).
Right now I'm using a hook, after_ordercreate, to call the API and activate it.
The call returns succesfully, this is what it returns:
setOrderActive() - Array
(
    [success] => 1
    [id] => 44
    [call] => setOrderActive
    [server_time] => 1383036823
    [info] => Array
        (
            [0] =>
        )

)


However if I go look into WHM the account isn't created. Specifically it isn't created until I
go to Hostbill and click the green 'Accept Order' button.

Any hints on how to accomplish this? Is it possible to simulate clicking the Accept Order button?

jlopez

Well I think this is impossible to do right now.
The hook worked only when in the Automation tab of a product the Auto-create option was set to "When manually accept pending order".
However this is not desirable because if a user pays with PayPal the order won't be automatically provisioned.

In short, our original idea can't be done.