Tier Account Requests example

Updated: March 6, 2020

    This example demonstrates a script that will process Tier Account Requests for a vendor

    require_once "vendor/autoload.php";
    class ProcessTAR extends \Connect\TierAccountRequestsAutomation
        public function processTierAccountRequest(\Connect\TierAccountRequest $request)
            //$request is instance of \Connect\TierAccountRequest
                //Get changes
                $changes = $request->account->diffWithPreviousVersion();
                //Do something with external system to change TA data
                throw new \Connect\TierAccountRequestAccept("Proocessed");
           catch (Exception $e){
                throw new \Connect\TierAccountRequestIgnore("Issue while processing, we ignore");
    //Main Code Block
        $tarProcessor = new ProcessTar();
    } catch (Exception $e) {
        print "error ".$e->getMessage();
    Is this page helpful?
    Translate with Google
    Copied to clipboard