wcPointsAndRewardsUser method
Get the users points and rewards information using the userToken
.
Returns a WcPointsAndRewardUser future. Throws an Exception if fails.
Implementation
Future<WcPointsAndRewardUser> wcPointsAndRewardsUser(
{String? userToken}) async {
// send http request
final json = await _http(
method: "POST",
url: _urlForRouteType(WPRouteType.WCPointsAndRewardsUser),
userToken: userToken,
shouldAuthRequest: true,
);
// return response
return _jsonHasBadStatus(json)
? this._throwExceptionForStatusCode(json)
: WcPointsAndRewardUser.fromJson(json['data']);
}