toMap method

Map<String, dynamic> toMap({
  1. bool quickbooksFormat = false,
})

If quickbooksFormat is false, will send the accessTokenExpireDate and the refreshTokenExpireDate, which are not originally given by quickbooks.

Implementation

Map<String, dynamic> toMap({bool quickbooksFormat = false}) {
  return <String, dynamic>{
    'x_refresh_token_expires_in': xRefreshTokenExpiresIn,
    'expires_in': expiresIn,
    if (!quickbooksFormat)
      'access_token_expire_date':
          accessTokenExpireDate.millisecondsSinceEpoch,
    if (!quickbooksFormat)
      'refresh_token_expire_date':
          refreshTokenExpireDate.millisecondsSinceEpoch,
    'refresh_token': refreshToken,
    'access_token': accessToken,
    'token_type': tokenType,
    'company_id': companyId,
  };
}