Open james-ingold opened 2 weeks ago
Seems to no longer be occurring.
Seem to be randomly getting this issue in production fyi. The order id is populated.
$captureBody = [ "id" => _the_order_id, ];
$this->client->getOrdersController()->ordersCapture($captureBody);
apimatic\jsonmapper\JsonMapperException: Could not find required constructor arguments for PaypalServerSdkLib\Models\NetworkTransactionReference: id
(apimatic\jsonmapper\JsonMapperException(code: 0): Could not find required constructor arguments for PaypalServerSdkLib\Models\NetworkTransactionReference: id at /app/vendor/apimatic/jsonmapper/src/JsonMapperException.php:169)
It also seems like the charge to the user is occurring even though this errors so potentially occurring when parsing the paypal api response? The response on these is a 201 with status COMPLETED
Switching back to old payment flow until this is resolved
$captureBody = {"id":"0SV24052CE043231L"} is this legit for php?
$captureBody = ['id' => '0SV24052CE043231L'];
Thanks, @alisacorporation just an issue copy and pasting code to github, since I redacted the order id. I've updated the post in github but that is not the issue. Most of our transactions are going through successfully in both the sandbox and production. This issue occurs occasionally and from the call stack is from parsing the capture response in the Paypal PHP SDK. If it was an issue with the capture body we wouldn't be getting to this point.
@DPoplin Hey do you have any insight into this issue? I also received a support response from Paypal Technical Support that this library is deprecated which is hopefully not the case.
This library is not deprecated; it is new and in beta, some kinks left to work out apparently...
That confusion must arise because a much older repository, called "PayPal-PHP-SDK" (no "server-") was long ago deprecated
Hello all. Apologies for being late to the discussion.
@james-ingold I can confirm that @PrestonPHX is correct, this SDK is part of six (6) new SDKs we are building to replace older deprecated SDKs. There may be some folks on our support teams who aren't aware of this. In any case, I and my team are very much working on them to correct issues and add additional features.
To the point, would it be possible for you to grab a debug ID from a failed request as well as a non-failed request for me? These should be available in the response headers or possibly logged by the SDK depending on your logging config. With those I can take a look and try to compare what's going on here.
Thanks @LeonarthusMectus for checking this out. Just to clarify these are all successful, non-failed responses in paypal, (200, 201 response codes) but seem to be erroring in the SDK when parsing the response:
Example request that threw this error: DEBUG ID: 6f4811777118b (capture request) Request that did not throw this error: DEBUG ID: 1c9d2861bc074 (capture request)
3 more examples from today: @LeonarthusMectus Same user tried to make a payment, and was charged 3 times, hitting the error each time even though they were successful payments and 201 capture responses from Paypal.
DEBUG ID: 030f6676c8f78 DEBUG ID: 6375849bf2e17 DEBUG ID: 9e6fc0792097c
Not sure if it helps but these seem to be debit cards when this occurs, but that might just be a coincidence
Perfect! Thanks for those. It definitely looks like all these instances are all Debit cards, and are missing the id
property of the network transaction reference object in the capture response, which from what I understand should always be present.
I'm following up with some colleagues on our API teams to try and understand the relationship between Debit networks & the network transaction reference to work out if there's a case where the ID would not be present, or if it's mistakenly being omitted in the response. That should give us an idea of where the fix is needed, and we can go about getting that put into place to remediate the exception.
I'll follow up here just as soon I have any details or updates to share.
Just started getting this error in the sandbox when calling ordersCapture. I've been testing error handling so not sure if I've made too many calls or something. Order is created and then the error happens on capture. This was working previously.
$captureBody = [ "id" => _the_order_id, ];
$apiResponse = $this->client->getOrdersController()->ordersCapture($captureBody);