-
Notifications
You must be signed in to change notification settings - Fork 134
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
Unable to do refund due to bad requestRazorpay\Api\Errors\ServerError: The server did not send back a well-formed response. #383
Comments
I am encountering the same issue with refunds, receiving an 'Array to string conversion' error. This functionality was working fine earlier but has recently started causing this error. |
@pankajsahukumar seems like libraby is broken i tried with latest version then also there is same problem for refund I am using now API. you can also use API.
|
Still some time i am getting this error |
actually package is not broken there api server is throwing an error which is not compatible with the package error handler |
Am also getting same error while doing refund |
Looks like PHP SDK is using a request URL (v1/refund/create) that is no longer supported. It should be /v1/payments/:id/refund. You can replace the
|
@nptugoz tried your suggestion but its not working. |
@raguventhan even the API solution didn't work for you? |
@raguventhan It is working for me. Are you using |
@nptugoz am using this $rzpApi->payment ->fetch( $paymentId )->refund( $data ); |
@rishab1788 the curl approach is working |
@rishab1788 This issue has been fixed, you don't have to do any changes. Could you please check once from your end and let us know? |
@ankitdas13, can we know what went wrong and what is fixed? just for information. |
Steps to reproduce the behavior
Use Refund API -
here while refund the API fails and give below response it used to work before but now it does not work can some please help me here
Unable to do refund due to bad requestRazorpay\Api\Errors\ServerError: The server did not send back a well-formed response. Server Response: Array in /var/www/html/gearz-vehicle/razorpay-php/src/Request.php:150 Stack trace: #0 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(219): Razorpay\Api\Request->throwServerError(Array, 404) #1 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(115): Razorpay\Api\Request->verifyErrorFormat(Array, 404) #2 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(109): Razorpay\Api\Request->processError(Array, 404, Object(WpOrg\Requests\Response)) #3 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(58): Razorpay\Api\Request->checkErrors(Object(WpOrg\Requests\Response)) #4 /var/www/html/gearz-vehicle/razorpay-php/src/Entity.php(92): Razorpay\Api\Request->request('POST', 'https://api.raz...', Array) #5 /var/www/html/gearz-vehicle/razorpay-php/src/Entity.php(20): Razorpay\Api\Entity->request('POST', 'refunds/', Array) #6 /var/www/html/gearz-vehicle/razorpay-php/src/Refund.php(17): Razorpay\Api\Entity->create(Array) #7 /var/www/html/gearz-vehicle/razorpay-php/src/Payment.php(52): Razorpay\Api\Refund->create(Array) #8 /var/www/html/gearz-vehicle/includes/classes/payment/OrderRefundProcessor.php(20): Razorpay\Api\Payment->refund(Array) #9 /var/www/html/gearz-vehicle/admin/edit-booking.php(195): OrderRefundProcessor->processRefund('19537', 'pay_PcuYuxicJ8W...', 'boooking succes...', '144') #10
here while refund the API fails and give below response it used to work before but now it does not work can some please help me here
Expected behavior
This api should do the refund instead of throwing error
Actual behavior
thworing error
Code snippets
`Unable to do refund due to bad requestRazorpay\Api\Errors\ServerError: The server did not send back a well-formed response. Server Response: Array in /var/www/html/gearz-vehicle/razorpay-php/src/Request.php:150 Stack trace: #0 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(219): Razorpay\Api\Request->throwServerError(Array, 404) #1 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(115): Razorpay\Api\Request->verifyErrorFormat(Array, 404) #2 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(109): Razorpay\Api\Request->processError(Array, 404, Object(WpOrg\Requests\Response)) #3 /var/www/html/gearz-vehicle/razorpay-php/src/Request.php(58): Razorpay\Api\Request->checkErrors(Object(WpOrg\Requests\Response)) #4 /var/www/html/gearz-vehicle/razorpay-php/src/Entity.php(92): Razorpay\Api\Request->request('POST', 'https://api.raz...', Array) #5 /var/www/html/gearz-vehicle/razorpay-php/src/Entity.php(20): Razorpay\Api\Entity->request('POST', 'refunds/', Array) #6 /var/www/html/gearz-vehicle/razorpay-php/src/Refund.php(17): Razorpay\Api\Entity->create(Array) #7 /var/www/html/gearz-vehicle/razorpay-php/src/Payment.php(52): Razorpay\Api\Refund->create(Array) #8 /var/www/html/gearz-vehicle/includes/classes/payment/OrderRefundProcessor.php(20): Razorpay\Api\Payment->refund(Array) #9 /var/www/html/gearz-vehicle/admin/edit-booking.php(195): OrderRefundProcessor->processRefund('19537', 'pay_PcuYuxicJ8W...', 'boooking succes...', '144') #10 `
Php version
Php v7.2
Library version
2.8.5
Additional Information
No response
The text was updated successfully, but these errors were encountered: