Skip to content

Commit

Permalink
Include sub_merchant (#523)
Browse files Browse the repository at this point in the history
* include submerchant

* fix address_door_number

* remove xml
  • Loading branch information
danielen-meli committed Jul 3, 2024
1 parent 08047ec commit 76141e0
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/MercadoPago/Resources/Common/SubMerchant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace MercadoPago\Resources\Common;

/** Submerchant identification class. */
class SubMerchant
{
/** Submerchant code. */
public ?string $sub_merchant_id;

/** Submerchant MCC according to Abecs decision and/or primary CNAE. */
public ?string $mcc;

/** Country where the submerchant is located. */
public ?string $country;

/** Street number where the submerchant is located. */
public ?number $address_door_number;

/** CEP of the submerchant. */
public ?string $zip;

/** CPF or CNPJ identification of the submerchant. */
public ?string $document_number;

/** City where the submerchant is located. */
public ?string $city;

/** Street where the submerchant is located. */
public ?string $address_street;

/** Name of the submerchant . */
public ?string $business_name;

/** State where the submerchant is located . */
public ?string $region_code_iso;

/** Postal code of the submerchant . */
public ?string $region_code;

/** CPF or CNPJ number of the submerchant . */
public ?string $document_type;

/** Phone number of the submerchant . */
public ?string $phone;

/** Payment Facilitator URL . */
public ?string $url;


}
4 changes: 4 additions & 0 deletions src/MercadoPago/Resources/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ class Payment extends MPResource
/** Payer. */
public array|object|null $payer;

/** ForwardData. */
public array|object|null $forward_data;

/** Collector ID. */
public ?int $collector_id;

Expand Down Expand Up @@ -222,6 +225,7 @@ class Payment extends MPResource
public array|object|null $three_ds_info;

private $map = [
"forward_data" => "MercadoPago\Resources\Payment\ForwardData",
"payer" => "MercadoPago\Resources\Payment\Payer",
"fee_details" => "MercadoPago\Resources\Payment\FeeDetails",
"additional_info" => "MercadoPago\Resources\Payment\AdditionalInfo",
Expand Down
27 changes: 27 additions & 0 deletions src/MercadoPago/Resources/Payment/ForwardData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace MercadoPago\Resources\Payment;

use MercadoPago\Serialization\Mapper;

/** ForwardData class. */
class ForwardData
{
/** Class mapper. */
use Mapper;

public array|object|null $sub_merchant;


private $map = [
"identification" => "MercadoPago\Resources\Common\SubMerchant",
];

/**
* Method responsible for getting map of entities.
*/
public function getMap(): array
{
return $this->map;
}
}

0 comments on commit 76141e0

Please sign in to comment.