chargebee-php icon indicating copy to clipboard operation
chargebee-php copied to clipboard

Transaction->errorDetail not available as a classed object

Open yched opened this issue 1 year ago • 0 comments

Description of the Bug

Result::transaction() maps the 'gateway_error_detail' API field to the Models\TransactionGatewayErrorDetail class

But the 'gateway_error_detail' API field does not exist, it's 'error_detail' in the actuel JSON data for a transaction : https://apidocs.eu.chargebee.com/docs/api/transactions?lang=curl#transaction_error_detail

Steps to reproduce

$t = \ChargeBee\ChargeBee\Models\Transaction::retrieve('some_failed_transaction')->transaction();
$t->errorDetail === [
  "error_category" => "invalid_request_error",
  "error_message" => "This PaymentIntent requires a mandate, but (...)",
  "object" => "gateway_error_detail",
]

Expected Behavior

$t->errorDetail should be an instance of Models\TransactionGatewayErrorDetail

Operating System

Linux

Language version

Php 8.1.30

Library version

v3.38.0

yched avatar Jan 03 '25 18:01 yched