wcPointsAndRewardsCalculatePoints method
Calculate the value of points using the userToken
and points
.
Returns a WcPointsAndRewardCalculatePoints future. Throws an Exception if fails.
Implementation
Future<WcPointsAndRewardCalculatePoints> wcPointsAndRewardsCalculatePoints(
{required double points, String? userToken}) async {
// send http request
final json = await _http(
method: "POST",
url: _urlForRouteType(WPRouteType.WCPointsAndRewardsCalculatePoints),
userToken: userToken,
shouldAuthRequest: true,
body: {"points": points},
);
// return response
return _jsonHasBadStatus(json)
? this._throwExceptionForStatusCode(json)
: WcPointsAndRewardCalculatePoints.fromJson(json['data']);
}