Skip to content

Commit

Permalink
Merge pull request #32 from mercadolibre/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
luana-ogawa authored Jun 2, 2023
2 parents 0c20c00 + 63c39d7 commit ababe8f
Show file tree
Hide file tree
Showing 24 changed files with 567 additions and 198 deletions.
56 changes: 40 additions & 16 deletions src/Entity/Notification/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@
/**
* Class Notification
*
* @property string $ip_address
* @property string $notification_id
* @property string $notification_url
* @property string $status
* @property string $external_reference
* @property float $transaction_id
* @property string $transaction_id
* @property string $transaction_type
* @property string $platform_id
* @property string $external_reference
* @property string $preference_id
* @property float $transaction_amount
* @property float $total_pending
* @property float $total_approved
* @property float $total_paid
* @property float $total_rejected
* @property float $total_approved
* @property float $total_pending
* @property float $total_refunded
* @property float $total_rejected
* @property float $total_cancelled
* @property float $total_charged_back
* @property string $multiple_payment_transaction_id
* @property array $payments_metadata
* @property PaymentDetails $payments_details
* @property PaymentDetailsList $payments_details
* @property RefundNotifyingList $refunds_notifying
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
Expand All @@ -49,17 +52,27 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var string
*/
protected $external_reference;
protected $transaction_id;

/**
* @var float
* @var string
*/
protected $transaction_id;
protected $transaction_type;

/**
* @var string
*/
protected $transaction_type;
protected $platform_id;

/**
* @var string
*/
protected $external_reference;

/**
* @var string
*/
protected $preference_id;

/**
* @var float
Expand All @@ -69,7 +82,7 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var float
*/
protected $total_pending;
protected $total_paid;

/**
* @var float
Expand All @@ -79,17 +92,17 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var float
*/
protected $total_paid;
protected $total_pending;

/**
* @var float
*/
protected $total_rejected;
protected $total_refunded;

/**
* @var float
*/
protected $total_refunded;
protected $total_rejected;

/**
* @var float
Expand All @@ -101,16 +114,26 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
*/
protected $total_charged_back;

/**
* @var string
*/
protected $multiple_payment_transaction_id;

/**
* @var array
*/
protected $payments_metadata;

/**
* @var PaymentDetails
* @var PaymentDetailsList
*/
protected $payments_details;

/**
* @var RefundNotifyingList
*/
protected $refunds_notifying;

/**
* Notification constructor.
*
Expand All @@ -120,6 +143,7 @@ public function __construct($manager)
{
parent::__construct($manager);
$this->payments_details = new PaymentDetailsList($manager);
$this->refunds_notifying = new RefundNotifyingList($manager);
}

/**
Expand Down
35 changes: 18 additions & 17 deletions src/Entity/Notification/PaymentDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,70 +8,71 @@
/**
* Class PaymentDetails
*
* @property float $id
* @property string $status
* @property string $status_detail
* @property string $payment_type_id
* @property int $id
* @property string $payment_method_id
* @property PaymentMethodInfo $payment_method_info
* @property string $payment_type_id
* @property float $total_amount
* @property float $paid_amount
* @property float $coupon_amount
* @property float $shipping_cost
* @property float $coupon_amount
* @property string $status
* @property string $status_detail
* @property RefundList $refunds
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
class PaymentDetails extends AbstractEntity
{
/**
* @var float
* @var int
*/
protected $id;

/**
* @var string
*/
protected $status;
protected $payment_method_id;

/**
* @var string
* @var PaymentMethodInfo
*/
protected $status_detail;
protected $payment_method_info;

/**
* @var string
*/
protected $payment_type_id;

/**
* @var string
* @var float
*/
protected $payment_method_id;
protected $total_amount;

/**
* @var float
*/
protected $total_amount;
protected $paid_amount;

/**
* @var float
*/
protected $paid_amount;
protected $shipping_cost;

/**
* @var float
*/
protected $coupon_amount;

/**
* @var float
* @var string
*/
protected $shipping_cost;
protected $status;

/**
* @var PaymentMethodInfo
* @var string
*/
protected $payment_method_info;
protected $status_detail;

/**
* @var RefundList
Expand Down
23 changes: 16 additions & 7 deletions src/Entity/Notification/PaymentMethodInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
/**
* Class PaymentMethodInfo
*
* @property string $barcode_content
* @property string $external_resource_url
* @property string $payment_method_reference_id
* @property string $date_of_expiration
* @property string $last_four_digits
* @property float $installments
* @property float $installment_rate
* @property double $installment_amount
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
class PaymentMethodInfo extends AbstractEntity
Expand All @@ -27,24 +36,24 @@ class PaymentMethodInfo extends AbstractEntity
protected $payment_method_reference_id;

/**
* @var bool
* @var string
*/
protected $date_of_expiration;

/**
* @var double
* @var string
*/
protected $installments;
protected $last_four_digits;

/**
* @var double
* @var float
*/
protected $installment_rate;
protected $installments;

/**
* @var string
* @var float
*/
protected $last_four_digits;
protected $installment_rate;

/**
* @var double
Expand Down
8 changes: 4 additions & 4 deletions src/Entity/Notification/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
/**
* Class Refund
*
* @property float $id
* @property int $id
* @property string $status
* @property bool $notifying
* @property object $metadata
* @property array $metadata
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
class Refund extends AbstractEntity
{
/**
* @var float
* @var int
*/
protected $id;

Expand All @@ -32,7 +32,7 @@ class Refund extends AbstractEntity
protected $notifying;

/**
* @var object
* @var array
*/
protected $metadata;
}
32 changes: 32 additions & 0 deletions src/Entity/Notification/RefundNotifying.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace MercadoPago\PP\Sdk\Entity\Notification;

use MercadoPago\PP\Sdk\Common\AbstractEntity;

/**
* Class RefundNotifying
*
* @property int $id
* @property bool $notifying
* @property float $amount
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
class RefundNotifying extends AbstractEntity
{
/**
* @var int
*/
protected $id;

/**
* @var bool
*/
protected $notifying;

/**
* @var float
*/
protected $amount;
}
26 changes: 26 additions & 0 deletions src/Entity/Notification/RefundNotifyingList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace MercadoPago\PP\Sdk\Entity\Notification;

use MercadoPago\PP\Sdk\Common\AbstractCollection;

/**
* Class RefundNotifyingList
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
class RefundNotifyingList extends AbstractCollection
{
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
public function add(array $entity, string $key = null)
{
$item = new RefundNotifying($this->manager);
$item->setEntity($entity);
parent::addEntity($item, $key);
}
}
12 changes: 9 additions & 3 deletions src/Entity/Payment/AdditionalInfoPayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
*
* @property string $first_name
* @property string $last_name
* @property Phone $phone
* @property AdditionalInfoPayerAddress $address
* @property Phone $phone
* @property string $registration_date
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
Expand All @@ -27,15 +28,20 @@ class AdditionalInfoPayer extends AbstractEntity
*/
protected $last_name;

/**
* @var AdditionalInfoPayerAddress
*/
protected $address;

/**
* @var Phone
*/
protected $phone;

/**
* @var AdditionalInfoPayerAddress
* @var string
*/
protected $address;
protected $registration_date;

/**
* AdditionalInfoPayer constructor.
Expand Down
Loading

0 comments on commit ababe8f

Please sign in to comment.