createAccount method

Future<Account> createAccount({
  1. required String email,
  2. required String type,
  3. required String bussiness_name,
  4. required String xenditApiKey,
  5. Map<String, String>? headers,
})

Implementation

Future<Account> createAccount({
  required String email,
  required String type,
  required String bussiness_name,
  required String xenditApiKey,
  Map<String, String>? headers,
}) async {
  return await invokeRaw<Account>(
    parameters: XenditInvokeParameters(
      endpoint: "POST https://api.xendit.co/v2/accounts",
      xenditApiKey: xenditApiKey,
      parameters: {
        "email": email,
        "type": type,
        "public_profile": {
          "business_name": bussiness_name,
        },
      },
      headers: headers,
      queryParameters: {},
      specialTypeSucces: "account",
      isThrowOnError: false,
      builder: (result) {
        return Account(result);
      },
    ),
  );
}