init method

Implementation

Future<PayPalAccessToken> init()async{
  String response = await SexyAPI(
    url: _url,
    path: "/v1/oauth2/token",
    parameters: {},
  ).post(
    headers: {
      "Content-Type" : "application/x-www-form-urlencoded",
      "Accept" : "application/json",
      "Authorization" : "Basic $encodedCredentials",
    },
    body: xWwwFormUrlencoded({
      "grant_type" : "client_credentials",
    }),
  );
  accessToken = PayPalAccessToken.parse(_parseResponse(response));
  return accessToken;
}