{Live} {SandBox}
#BLOCK("WITH_FORM_ERROR", #FormError)
#IF(#FormError)

{InputError}

{PleaseCorrectErrors}

#ENDIF
#IF(NOT #DEFINED(#INPUT.DoTestOnSandBox) OR #INPUT.DoTestOnSandBox == 0) #IF(#DELETELIVE)

{Warning}

{AcceptDelete}
#ENDIF #IF(#LIVETOKEN_DELETED)

{Result}

{TokenDeletedCorrectly}


#ENDIF #IF(#TOKENTESTED) #IF(#ERR_TOKEN)

{Attention}

{TokenNotValid}

#ELSE

{Result}

{TokenSuccessfullyTested}

#ENDIF #ENDIF #IF(#ERR_FETCH_TOKEN)

{Attention}

{AuthenticationNotOk}
({Error}: #ERR_FETCH_TOKEN)

#ENDIF #IF(#SUCCESS_SAVE_TOKEN)

{Result}

{AuthenticationOk}

#ENDIF #IF(#ERR_GETSESSIONID)

{Attention}

{SessionIDNotSet}
({Error}: #ERR_GETSESSIONID)

#ENDIF #ENDIF #LOCAL("SettingsIncomplete",0) #IF(NOT (#EbayRuName AND #EbayDevId AND #EbayAppId AND #EbayCertId AND #EbayProviderLogin AND #EbayProviderPassword) ) #SET("SettingsIncomplete",1) #ELSE #ENDIF #ENDLOCAL

{Attention}

{IncompleteSettings}
{DoComplete}
#IF(#EbayProviderToken) {Status}: {TokenStored}
({expires}: #EbayProviderTokenExpiryDate[datetime]) #ELSE {Status}: {noToken} #ENDIF

#IF(#DEFINED(#INPUT.DoTestOnSandBox) AND #INPUT.DoTestOnSandBox == 1) #IF(#DELETESB)

{Warning}

{AcceptDelete}
#ENDIF #IF(#SBTOKEN_DELETED)

{Result}

{TokenDeletedCorrectly}


#ENDIF #IF(#TOKENTESTED) #IF(#ERR_TOKEN)

{Result}

{TokenNotValid}

#ELSE

{Result}

{TokenSuccessfullyTested}

#ENDIF #ENDIF #IF(#ERR_FETCH_TOKEN)

{Attention}

{AuthenticationNotOk}
({Error}: #ERR_FETCH_TOKEN)

#ENDIF #IF(#SUCCESS_SAVE_TOKEN)

{Result}

{AuthenticationOk}

#ENDIF #IF(#ERR_GETSESSIONID)

{Attention}

{SessionIDNotSet}
({Error}: #ERR_GETSESSIONID)

#ENDIF #ENDIF #LOCAL("SandBoxSettingsIncomplete",0) #IF(NOT (#EbaySandBoxRuName AND #EbaySandBoxDevId AND #EbaySandBoxAppId AND #EbaySandBoxCertId AND #EbaySandBoxProviderLogin AND #EbaySandBoxProviderPassword)) #ELSE #ENDIF #ENDLOCAL

{Attention}

{IncompleteSettings}
{DoComplete}
#IF(#EbaySandBoxProviderToken) {Status}: {TokenStored}
({expires}: #EbaySandBoxProviderTokenExpiryDate[datetime]) #ELSE {Status}: {noToken} #ENDIF

#IF(#DELETELIVE) #ELSE #IF(NOT #SettingsIncomplete) #ENDIF #IF(#EbayProviderToken) #ENDIF #ENDIF
#IF(#DELETESB) #ELSE #IF(NOT #SandBoxSettingsIncomplete) #ENDIF #IF(#EbaySandBoxProviderToken) #ENDIF #ENDIF
#ENDBLOCK