Skip to content

Commit

Permalink
Merge pull request #235 from mercadopago/release/1.7.0
Browse files Browse the repository at this point in the history
Release/1.7.0
  • Loading branch information
Pedro Gonçalves authored Jan 2, 2020
2 parents 39e3c87 + 971725f commit 4dcd9d0
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/MercadoPago/Entities/Preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,13 @@ class Preference extends Entity
* @Attribute(type = "array")
*/
protected $taxes;
/**
* @Attribute()
*/
protected $metadata;
/**
* @Attribute(type = "array")
*/
protected $tracks;

}
12 changes: 12 additions & 0 deletions src/MercadoPago/Entities/Shared/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,18 @@ class Payment extends Entity
* @Attribute()
*/
protected $marketplace_owner;
/**
* @Attribute()
*/
protected $integrator_id;
/**
* @Attribute()
*/
protected $corporation_id;
/**
* @Attribute()
*/
protected $platform_id;

public function refund($amount = 0){
$refund = new Refund(["payment_id" => $this->id]);
Expand Down
21 changes: 21 additions & 0 deletions src/MercadoPago/Entities/Shared/Track.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
namespace MercadoPago;

use MercadoPago\Annotation\Attribute;

/**
* Tack class
*
* @package MercadoPago
*/
class Track extends Entity
{
/**
* @Attribute(type = "string")
*/
protected $type;
/**
* @Attribute(type = "object")
*/
protected $value;
}
25 changes: 25 additions & 0 deletions src/MercadoPago/Entities/Shared/TrackValues.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
namespace MercadoPago;

use MercadoPago\Annotation\Attribute;

/**
* TrackValues class
*
* @package MercadoPago
*/
class TrackValues extends Entity
{
/**
* @Attribute(type = "string")
*/
protected $conversion_id;
/**
* @Attribute(type = "string")
*/
protected $conversion_label;
/**
* @Attribute(type = "string")
*/
protected $pixel_id;
}
44 changes: 44 additions & 0 deletions src/MercadoPago/SDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,49 @@ public static function delete($uri, $options=[])
return self::$_restClient->delete($uri, $options);
}

/**
* Set Platform Id for SDK .
*/
public static function setPlatformId($platform_id){
if (!isset(self::$_config)){
self::initialize();
}
self::$_config->configure(['x-platform-id' => $platform_id]);
self::addCustomTrackingParam('x-platform-id', $platform_id);
}

public static function getPlatformId(){
return self::$_config->get('x-platform-id');
}

/**
* Set Corporation Id for SDK .
*/
public static function setCorporationId($corporation_id){
if (!isset(self::$_config)){
self::initialize();
}
self::$_config->configure(['x-corporation-id' => $corporation_id]);
self::addCustomTrackingParam('x-corporation-id', $corporation_id);
}

public static function getCorporationId(){
return self::$_config->get('x-corporation-id');
}

/**
* Set Integrator Id for SDK .
*/
public static function setIntegratorId($integrator_id){
if (!isset(self::$_config)){
self::initialize();
}
self::$_config->configure(['x-integrator-id' => $integrator_id]);
self::addCustomTrackingParam('x-integrator-id', $integrator_id);
}

public static function getIntegratorId(){
return self::$_config->get('x-integrator-id');
}
}

4 changes: 2 additions & 2 deletions src/MercadoPago/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
class Version
{
public static
$_VERSION = '1.5.0';
}
$_VERSION = '1.7.0';
}

0 comments on commit 4dcd9d0

Please sign in to comment.