Page MenuHomePhabricator

rejected_other_reason not mapped for dlocal non-recurring redirect and not logged
Closed, ResolvedPublicBUG REPORT

Description

https://localhost:9001/index.php/Special:DlocalGateway?title=Special%3ADlocalGateway&uselang=en&language=en&currency=INR&country=IN&debug=true

when select a submethod:

gt internal error:
[8581589647ecb65a6bc11a82] /index.php/Special:DlocalGateway?title=Special%3ADlocalGateway&uselang=en&language=en&currency=INR&country=IN&debug=true TypeError: Argument 1 passed to SmashPig\PaymentProviders\Responses\PaymentProviderResponse::hasError() must be of the type string, null given, called in /var/www/html/vendor/wikimedia/smash-pig/PaymentProviders/Responses/PaymentProviderResponse.php on line 144

Backtrace:

from /var/www/html/vendor/wikimedia/smash-pig/PaymentProviders/Responses/PaymentProviderResponse.php(124)
#0 /var/www/html/vendor/wikimedia/smash-pig/PaymentProviders/Responses/PaymentProviderResponse.php(144): SmashPig\PaymentProviders\Responses\PaymentProviderResponse->hasError()
#1 /var/www/html/vendor/wikimedia/smash-pig/PaymentProviders/dlocal/DlocalCreatePaymentResponseFactory.php(42): SmashPig\PaymentProviders\Responses\PaymentProviderResponse->addErrors()
#2 /var/www/html/vendor/wikimedia/smash-pig/PaymentProviders/dlocal/HostedPaymentProvider.php(26): SmashPig\PaymentProviders\dlocal\DlocalCreatePaymentResponseFactory::fromRawResponse()
#3 /var/www/html/extensions/DonationInterface/dlocal_gateway/dlocal.adapter.php(267): SmashPig\PaymentProviders\dlocal\HostedPaymentProvider->createPayment()
#4 /var/www/html/extensions/DonationInterface/dlocal_gateway/dlocal.adapter.php(45): DlocalAdapter->callCreatePayment()
#5 /var/www/html/extensions/DonationInterface/gateway_common/GatewayPage.php(379): DlocalAdapter->doPayment()
#6 /var/www/html/extensions/DonationInterface/gateway_common/GatewayPage.php(332): GatewayPage->processPayment()
#7 /var/www/html/extensions/DonationInterface/gateway_common/GatewayPage.php(181): GatewayPage->handleDonationRequest()
#8 /var/www/html/extensions/DonationInterface/gateway_common/GatewayPage.php(165): GatewayPage->handleRequest()
#9 /var/www/html/includes/specialpage/SpecialPage.php(701): GatewayPage->execute()
#10 /var/www/html/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#11 /var/www/html/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#12 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#13 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#14 /var/www/html/index.php(50): MediaWiki->run()
#15 /var/www/html/index.php(46): wfIndexMain()
#16 {main}

which from the api raw response, it's
{"id":"R-413092-8fb7d607-1e73-4280-a2ef-5bd085635942","amount":1254.00,"currency":"INR","payment_method_id":"NB","payment_method_type":"BANK_TRANSFER","payment_method_flow":"REDIRECT","country":"IN","created_date":"2023-03-14T23:41:14.000+0000","status":"REJECTED","status_detail":"rejected_other_reason","status_code":"100","order_id":"9134528.1","description":"Wikimedia 877 600 9454","notification_url":"https://paymentsipntest6.wmcloud.org/dlocal"}

We should also log those errors

Event Timeline

AnnWF renamed this task from PaymentProviderResponse::hasError() for dlocal non-recurrign ir redirect to rejected_other_reason not mapped for dlocal non-recurring redirect and not logged.Mar 14 2023, 11:33 PM
AnnWF updated the task description. (Show Details)

Change 899068 had a related patch set uploaded (by AndyRussG; author: AndyRussG):

[wikimedia/fundraising/SmashPig@master] Add mapping for 100 other error

https://gerrit.wikimedia.org/r/899068

Change 899068 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Add mapping for 100 other error

https://gerrit.wikimedia.org/r/899068

Change 899882 had a related patch set uploaded (by Wfan; author: AndyRussG):

[wikimedia/fundraising/SmashPig@master] Remove mapping for 100 use fall back to other error

https://gerrit.wikimedia.org/r/899882

@AndyRussG
this is another mocked transaction response:
100 is pending, so do not add 100 to ErrorMap
{

"id": "R-413092-5b5a4cfc-6115-4967-bef1-ec277ec3a85d",
"amount": 10.00,
"currency": "INR",
"payment_method_id": "NB",
"payment_method_type": "BANK_TRANSFER",
"payment_method_flow": "REDIRECT",
"country": "IN",
"created_date": "2023-03-15T23:54:59.000+0000",
"status": "PENDING",
"status_detail": "The payment is pending.",
"status_code": "100",
"order_id": "49752900001140",
"notification_url": "http://merchant.com/notifications",
"redirect_url": "https://sandbox.dlocal.com/gmf-apm/payments/M-47757115-e7ac-436b-9dff-ad505d081230"

}

Change 899882 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Remove mapping for 100 use fall back to other error

https://gerrit.wikimedia.org/r/899882

Dwisehaupt set Final Story Points to 2.