Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Type Error on Methods.php on line 147 #10

Open
rudiullon opened this issue Oct 6, 2022 · 1 comment · Fixed by #12
Open

[BUG] Type Error on Methods.php on line 147 #10

rudiullon opened this issue Oct 6, 2022 · 1 comment · Fixed by #12
Labels
bug Something isn't working

Comments

@rudiullon
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
$onfleet = new Onfleet("valid_api_key",6000);
$data = [
"name" => "User Name",
"phone" => "+1XXXXXX", #valid phone number
"notes" => " ",
"skipPhoneNumberValidation" => false,
"skipSMSNotifications" => false,
]

$recipient = $onfleet->recipients->create($data);
TypeError: Onfleet\errors\HttpError::__construct(): Argument #2 ($cause) must be of type string, array given, called in /home/my_project_folder/vendor/onfleet/php-onfleet/src/Methods.php on line 147

Expected behavior
It should create and return a new recipient

@rudiullon rudiullon added the bug Something isn't working label Oct 6, 2022
@vic-onfleet vic-onfleet linked a pull request May 26, 2023 that will close this issue
@vic-onfleet vic-onfleet reopened this May 26, 2023
@vic-onfleet
Copy link
Contributor

vic-onfleet commented May 26, 2023

HI @rudiullon!

Could you let me know if you're still getting this error?

I have just tried and used your data object:

$data = [
"name" => "User Name",
"phone" => "+380946547392", #valid phone number
"notes" => " ",
"skipPhoneNumberValidation" => false,
"skipSMSNotifications" => false,
];
 $recipient = $api->recipients->create($data);

This code worked as expected and I received a recipient object in response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants