Handle the indexerror exception on create_order

LMS-2646
use spacing appropriately: `if (data.success) {`