From 943926576d5c9961a623044d7a7bba7ad84d2f84 Mon Sep 17 00:00:00 2001 From: edmarSoaress Date: Thu, 22 Feb 2024 14:26:05 -0300 Subject: [PATCH 1/2] add filed barcode and verification_code in transaction_details --- src/MercadoPago/Resources/Payment/Barcode.php | 10 ++++++++++ src/MercadoPago/Resources/Payment/TransactionData.php | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/MercadoPago/Resources/Payment/Barcode.php diff --git a/src/MercadoPago/Resources/Payment/Barcode.php b/src/MercadoPago/Resources/Payment/Barcode.php new file mode 100644 index 00000000..86c2bd81 --- /dev/null +++ b/src/MercadoPago/Resources/Payment/Barcode.php @@ -0,0 +1,10 @@ + "MercadoPago\Resources\Payment\BankInfo", + "barcode" => "MercadoPago\Resources\Payment\Barcode", ]; /** From dd7c79e4b7559d89871065326a4ca06eee50a0f9 Mon Sep 17 00:00:00 2001 From: edmarSoaress Date: Fri, 23 Feb 2024 14:22:19 -0300 Subject: [PATCH 2/2] add filed barcode and verification_code in transaction_details --- .../Resources/Payment/TransactionData.php | 7 ------ .../Resources/Payment/TransactionDetails.php | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/MercadoPago/Resources/Payment/TransactionData.php b/src/MercadoPago/Resources/Payment/TransactionData.php index f53259a0..4c01f29f 100644 --- a/src/MercadoPago/Resources/Payment/TransactionData.php +++ b/src/MercadoPago/Resources/Payment/TransactionData.php @@ -34,15 +34,8 @@ class TransactionData /** E2E ID. */ public ?string $e2e_id; - /** Barcode info. */ - public array|object|null $barcode; - - /** Verification code info. */ - public ?string $verification_code; - private $map = [ "bank_info" => "MercadoPago\Resources\Payment\BankInfo", - "barcode" => "MercadoPago\Resources\Payment\Barcode", ]; /** diff --git a/src/MercadoPago/Resources/Payment/TransactionDetails.php b/src/MercadoPago/Resources/Payment/TransactionDetails.php index 2bcebb0f..79f01b6c 100644 --- a/src/MercadoPago/Resources/Payment/TransactionDetails.php +++ b/src/MercadoPago/Resources/Payment/TransactionDetails.php @@ -2,9 +2,14 @@ namespace MercadoPago\Resources\Payment; +use MercadoPago\Serialization\Mapper; + /** TransactionDetails class. */ class TransactionDetails { + /** Class mapper. */ + use Mapper; + /** External financial institution identifier. */ public ?string $financial_institution; @@ -40,4 +45,22 @@ class TransactionDetails /** Transaction ID. */ public ?string $transaction_id; + + /** Barcode info. */ + public array|object|null $barcode; + + /** Verification code info. */ + public ?string $verification_code; + + private $map = [ + "barcode" => "MercadoPago\Resources\Payment\Barcode", + ]; + + /** + * Method responsible for getting map of entities. + */ + public function getMap(): array + { + return $this->map; + } }