allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
2026-03-30 14:54:57 +07:00
parent 66aed7c4e8
commit b5e3a778ce
21316 changed files with 2777892 additions and 13 deletions

View File

@@ -0,0 +1,163 @@
<?php
namespace MercadoPago\AdvancedPayments;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Entity;
/**
* Advanced Payment class
* @link https://www.mercadopago.com/developers/en/reference/advanced_payments/_advanced_payments_id_search/get/ Click here for more infos
*
* @RestMethod(resource="/v1/advanced_payments", method="create")
* @RestMethod(resource="/v1/advanced_payments/:id", method="read")
* @RestMethod(resource="/v1/advanced_payments/search", method="search")
* @RestMethod(resource="/v1/advanced_payments/:id", method="update")
* @RestMethod(resource="/v1/advanced_payments/:id/refunds", method="refund")
*/
class AdvancedPayment extends Entity
{
/**
* id
* @var int
* @Attribute()
*/
protected $id;
/**
* application_id
* @var int
* @Attribute()
*/
protected $application_id;
/**
* payments
* @var array
* @Attribute()
*/
protected $payments;
/**
* disbursements
* @var array
* @Attribute()
*/
protected $disbursements;
/**
* payer
* @var object
* @Attribute()
*/
protected $payer;
/**
* external_reference
* @var string
* @Attribute()
*/
protected $external_reference;
/**
* description
* @var string
* @Attribute()
*/
protected $description;
/**
* binary_mode
* @var boolean
* @Attribute()
*/
protected $binary_mode;
/**
* status
* @var string
* @Attribute()
*/
protected $status;
/**
* capture
* @var boolean
* @Attribute()
*/
protected $capture;
/**
* cancel
* @return bool|mixed
* @throws \Exception
*/
public function cancel() {
$this->status = 'cancelled';
return $this->update();
}
/**
* capture
* @return bool|mixed
* @throws \Exception
*/
public function capture()
{
$this->capture = true;
return $this->update();
}
/**
* refund
* @param int $amount
* @return bool
* @throws \Exception
*/
public function refund($amount = 0){
$refund = new Refund(["advanced_payment_id" => $this->id]);
if ($amount > 0){
$refund->amount = $amount;
}
if ($refund->save()){
$advanced_payment = self::get($this->id);
$this->_fillFromArray($this, $advanced_payment->toArray());
return true;
}else{
$this->error = $refund->error;
return false;
}
}
/**
* refundDisbursement
* @param $disbursement_id
* @param int $amount
* @return bool
* @throws \Exception
*/
public function refundDisbursement($disbursement_id, $amount = 0){
$refund = new DisbursementRefund(["advanced_payment_id" => $this->id, "disbursement_id" => $disbursement_id]);
if ($amount > 0){
$refund->amount = $amount;
}
if ($refund->save()){
$advanced_payment = self::get($this->id);
$this->_fillFromArray($this, $advanced_payment->toArray());
return true;
}else{
$this->error = $refund->error;
return false;
}
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* Disbursement Refund class file
*/
namespace MercadoPago\AdvancedPayments;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Entity;
/**
* Disbursement Refund class
* @RestMethod(resource="/v1/advanced_payments/:advanced_payment_id/disbursements/:disbursement_id/refunds", method="create")
* @RestMethod(resource="/v1/advanced_payments/:advanced_payment_id/disbursements/:disbursement_id/refunds/:refund_id", method="read")
*/
class DisbursementRefund extends Entity {
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* payment_id
* @Attribute(serialize=false)
* @var int
*/
protected $payment_id;
/**
* amount
* @Attribute()
* @var float
*/
protected $amount;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* source
* @Attribute()
* @var object
*/
protected $source;
/**
* date_created
* @Attribute(readOnly=true)
* @var \DateTime
*/
protected $date_created;
/**
* advanced_payment_id
* @Attribute(serialize=false)
* @var int
*/
protected $advanced_payment_id;
/**
* disbursement_id
* @Attribute(serialize=false)
* @var int
*/
protected $disbursement_id;
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* Refund class file
*/
namespace MercadoPago\AdvancedPayments;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Entity;
/**
* Refund class
* @RestMethod(resource="/v1/advanced_payments/:advanced_payment_id/refunds", method="create")
* @RestMethod(resource="/v1/advanced_payments/:advanced_payment_id/refunds/:refund_id", method="read")
*/
class Refund extends Entity {
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* payment_id
* @Attribute(serialize=false)
* @var int
*/
protected $payment_id;
/**
* amount
* @Attribute()
* @var float
*/
protected $amount;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* source
* @Attribute()
* @var object
*/
protected $source;
/**
* date_created
* @Attribute(readOnly=true)
* @var \DateTime
*/
protected $date_created;
}

View File

@@ -0,0 +1,147 @@
<?php
/**
* Authorized Payments class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Authorized Payments Class
*
* @RestMethod(resource="/authorized_payments/:id", method="read")
* @RestMethod(resource="/authorized_payments/search", method="search")
*/
class AuthorizedPayment extends Entity
{
/**
* id
* @Attribute(primaryKey = true)
* @var int
*/
protected $id;
/**
* preapprova_id
* @Attribute(type = "string")
* @var int
*/
protected $preapproval_id;
/**
* type
* @Attribute(type = "string")
* @var string
*/
protected $type;
/**
* status
* @Attribute(type = "string")
* @var string
*/
protected $status;
/**
* date_created
* @Attribute(type = "date")
* @var string
*/
protected $date_created;
/**
* last_modified
* @Attribute(type = "date")
* @var string
*/
protected $last_modified;
/**
* transaction_amount
* @Attribute(type = "float")
* @var float
*/
protected $transaction_amount;
/**
* currency_id
* @Attribute(type = "string")
* @var string
*/
protected $currency_id;
/**
* reason
* @Attribute(type = "string")
* @var string
*/
protected $reason;
/**
* external_reference
* @Attribute(type = "string")
* @var string
*/
protected $external_reference;
/**
* payment
* @Attribute(type = "object")
* @var object
*/
protected $payment;
/**
* rejection_code
* @Attribute(type = "string")
* @var string
*/
protected $rejection_code;
/**
* retry_attempt
* @Attribute(type = "string")
* @var string
*/
protected $retry_attempt;
/**
* next_retry_date
* @Attribute(type = "date")
* @var string
*/
protected $next_retry_date;
/**
* last_retry_date
* @Attribute(type = "date")
* @var string
*/
protected $last_retry_date;
/**
* expire_date
* @Attribute(type = "date")
* @var string
*/
protected $expire_date;
/**
* debit_date
* @Attribute(type = "date")
* @var string
*/
protected $debit_date;
/**
* coupon_code
* @Attribute(type = "string")
* @var string
*/
protected $coupon_code;
}

View File

@@ -0,0 +1,118 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* The cards class is the way to store card data of your customers safely to improve the shopping experience.
*
* This will allow your customers to complete their purchases much faster and easily, since they will not have to complete their card data again.
*
* This class must be used in conjunction with the Customer class.
*
* @link https://www.mercadopago.com/developers/en/guides/online-payments/web-tokenize-checkout/customers-and-cards Click here for more infos
*
* @RestMethod(resource="/v1/customers/:customer_id/cards", method="create")
* @RestMethod(resource="/v1/customers/:customer_id/cards", method="list")
* @RestMethod(resource="/v1/customers/:customer_id/cards/:id", method="read")
* @RestMethod(resource="/v1/customers/:customer_id/cards/:id", method="update")
* @RestMethod(resource="/v1/customers/:customer_id/cards/:id", method="delete")
*/
class Card extends Entity
{
/**
* id
* @Attribute(primaryKey = true)
* @var int
*/
protected $id;
/**
* token
* @Attribute()
* @var string
*/
protected $token;
/**
* customer_id
* @Attribute(required = true, serialize = false)
* @var string
*/
protected $customer_id;
/**
* expiration_month
* @Attribute()
* @var int
*/
protected $expiration_month;
/**
* expiration_year
* @Attribute()
* @var int
*/
protected $expiration_year;
/**
* first_six_digits
* @Attribute()
* @var string
*/
protected $first_six_digits;
/**
* last_four_digits
* @Attribute()
* @var string
*/
protected $last_four_digits;
/**
* payment_method
* @Attribute()
* @var object
*/
protected $payment_method;
/**
* security_code
* @Attribute()
* @var object
*/
protected $security_code;
/**
* issuer
* @Attribute()
* @var object
*/
protected $issuer;
/**
* cardholder
* @Attribute()
* @var object
*/
protected $cardholder;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* date_last_updated
* @Attribute()
* @var string
*/
protected $date_last_updated;
}

View File

@@ -0,0 +1,131 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Card Token class
* This class will allow you to send your customers card data for Mercado Pago server and receive a token to complete the payments transactions.
*
* @RestMethod(resource="/v1/card_tokens?public_key=:public_key", method="create")
* @RestMethod(resource="/v1/card_tokens?public_key=:public_key", method="read")
* @RestMethod(resource="/v1/card_tokens?public_key=:public_key", method="update")
*/
class CardToken extends Entity
{
/**
* card_id
* @Attribute(primaryKey = true)
* @var int
*/
protected $card_id;
/**
* public_key
* @Attribute()
* @var string
*/
protected $public_key;
/**
* first_six_digits
* @Attribute()
* @var string
*/
protected $first_six_digits;
/**
* luhn_validation
* @Attribute()
* @var string
*/
protected $luhn_validation;
/**
* date_used
* @Attribute()
* @var string
*/
protected $date_used;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* date_due
* @Attribute()
* @var string
*/
protected $date_due;
/**
* card_number_length
* @Attribute()
* @var int
*/
protected $card_number_length;
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* security_code_length
* @Attribute()
* @var int
*/
protected $security_code_length;
/**
* expiration_year
* @Attribute()
* @var int
*/
protected $expiration_year;
/**
* expiration_month
* @Attribute()
* @var int
*/
protected $expiration_month;
/**
* date_last_updated
* @Attribute()
* @var string
*/
protected $date_last_updated;
/**
* last_four_digits
* @Attribute()
* @var string
*/
protected $last_four_digits;
/**
* cardholder
* @Attribute()
* @var string
*/
protected $cardholder;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* Chargeback class file
* @link https://www.mercadopago.com/developers/en/reference/chargebacks/_chargebacks_id/get/ Click here for more infos
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Chargeback class
* @RestMethod(resource="/v1/chargebacks/:id", method="read")
*/
class Chargeback extends Entity
{
/**
* id
* @Attribute(primaryKey = true, type = "string", readOnly = true)
* @var string
*/
protected $id;
/**
* payments
* @Attribute(type = "array", readOnly = true)
* @var array
*/
protected $payments;
/**
* amount
* @Attribute(type = "string", readOnly = true)
* @var string
*/
protected $amount;
/**
* coverage_applied
* @Attribute(type = "float", readOnly = true)
* @var float
*/
protected $coverage_applied;
/**
* coverage_elegible
* @Attribute(readOnly = true)
* @var float
*/
protected $coverage_elegible;
/**
* documentation_required
* @Attribute(readOnly = true)
* @var mixed
*/
protected $documentation_required;
/**
* documentation_status
* @Attribute(readOnly = true)
* @var mixed
*/
protected $documentation_status;
/**
* documentation
* @Attribute(type = "string", readOnly = true)
* @var string
*/
protected $documentation;
/**
* date_documentation_deadline
* @Attribute(type = "array", readOnly = true)
* @var array
*/
protected $date_documentation_deadline;
/**
* date_created
* @Attribute(type = "date", readOnly = true)
* @var \DateTime
*/
protected $date_created;
/**
* date_last_updated
* @Attribute(type = "date", readOnly = true)
* @var \DateTime
*/
protected $date_last_updated;
/**
* live_mode
* @Attribute(type = "boolean", readOnly = true)
* @var boolean
*/
protected $live_mode;
}

View File

@@ -0,0 +1,143 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* This class allows you to store customers data safely to improve the shopping experience.
*
* This will allow your customer to complete their purchases much faster and easily when used in conjunction with the Cards class.
*
* @link https://mercadopago.com/developers/en/guides/online-payments/web-tokenize-checkout/customers-and-cards Click here for more infos
*
* @RestMethod(resource="/v1/customers/:id", method="read")
* @RestMethod(resource="/v1/customers/search", method="search")
* @RestMethod(resource="/v1/customers/", method="create")
* @RestMethod(resource="/v1/customers/:id", method="update")
* @RestMethod(resource="/v1/customers/:id", method="delete")
*/
class Customer extends Entity
{
/**
* email
* @Attribute(primaryKey = true)
* @var string
*/
protected $email;
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* first_name
* @Attribute()
* @var string
*/
protected $first_name;
/**
* last_name
* @Attribute()
* @var string
*/
protected $last_name;
/**
* phone
* @Attribute()
* @var object
*/
protected $phone;
/**
* identification
* @Attribute()
* @var object
*/
protected $identification;
/**
* default_address
* @Attribute()
* @var string
*/
protected $default_address;
/**
* address
* @Attribute()
* @var object
*/
protected $address;
/**
* date_registered
* @Attribute()
* @var string
*/
protected $date_registered;
/**
* description
* @Attribute()
* @var string
*/
protected $description;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* date_last_updated
* @Attribute()
* @var string
*/
protected $date_last_updated;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* default_card
* @Attribute()
* @var string
*/
protected $default_card;
/**
* card
* @Attribute()
* @var array
*/
protected $cards;
/**
* addresses
* @Attribute()
* @var array
*/
protected $addresses;
/**
* live_mode
* @Attribute(type = "boolean")
* @var boolean
*/
protected $live_mode;
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* Discount Campaign class file
*/
namespace MercadoPago;
use http\Params;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* discount Campaign class
* @RestMethod(resource="/v1/discount_campaigns", method="read")
*/
class DiscountCampaign extends Entity
{
/**
* id
* @Attribute(primaryKey = true)
* @var int
*/
protected $id;
/**
* name
* @Attribute()
* @var string
*/
protected $name;
/**
* percent_off
* @Attribute()
* @var float
*/
protected $percent_off;
/**
* amount_off
* @Attribute()
* @var float
*/
protected $amount_off;
/**
* coupon_amount
* @Attribute()
* @var float
*/
protected $coupon_amount;
/**
* currency_id
* @Attribute()
* @var string
*/
protected $currency_id;
/**
* read
* @param array $options
* @param array $params
* @return mixed|null
* @throws \Exception
*/
public static function read($options = [], $params = []){
return parent::read([], $options);
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Instore Order class
* @link https://www.mercadopago.com/developers/en/reference/instore_orders/_mpmobile_instore_qr_user_id_external_id/post/ Click here for more infos
*
* @RestMethod(resource="/mpmobile/instore/qr/:user_id/:external_id", method="create")
*/
class InstoreOrder extends Entity
{
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_reference;
/**
* notification_url
* @Attribute()
* @var string
*/
protected $notification_url;
/**
* items
* @Attribute()
* @var array
*/
protected $items;
}

View File

@@ -0,0 +1,125 @@
<?php
/**
* Invoice class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Invoice class
* @RestMethod(resource="/v1/invoices/:id", method="read")
*/
class Invoice extends Entity
{
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* subscription_id
* @Attribute()
* @var string
*/
protected $subscription_id;
/**
* plan_id
* @Attribute()
* @var string
*/
protected $plan_id;
/**
* payer
* @Attribute()
* @var object
*/
protected $payer;
/**
* application_fee
* @Attribute()
* @var float
*/
protected $application_fee;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* description
* @Attribute()
* @var string
*/
protected $description;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_reference;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* last_modified
* @Attribute()
* @var string
*/
protected $last_modified;
/**
* live_mode
* @Attribute()
* @var boolean
*/
protected $live_mode;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* payments
* @Attribute()
* @var array
*/
protected $payments;
/**
* debit_date
* @Attribute()
* @var string
*/
protected $debit_date;
/**
* next_payment_date
* @Attribute()
* @var string
*/
protected $next_payment_date;
}

View File

@@ -0,0 +1,174 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* This class will allow you to create and manage your orders. You can attach one or more payments in your merchant order.
* @link https://www.mercadopago.com/developers/en/reference/merchant_orders/_merchant_orders_search/get/ Click here for more infos
*
* @RestMethod(resource="/merchant_orders/:id", method="read")
* @RestMethod(resource="/merchant_orders/", method="create")
* @RestMethod(resource="/merchant_orders/:id", method="update")
*/
class MerchantOrder extends Entity
{
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* preferenceId
* @Attribute()
* @var string
*/
protected $preferenceId;
/**
* dateCreated
* @Attribute()
* @var string
*/
protected $dateCreated;
/**
* lastUpdated
* @Attribute()
* @var string
*/
protected $lastUpdate;
/**
* applicationId
* @Attribute
* @var string
*/
protected $applicationId;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* siteId
* @Attribute()
* @var string
*/
protected $siteId;
/**
* payer
* @Attribute()
* @var object
*/
protected $payer;
/**
* collector
* @Attribute()
* @var object
*/
protected $collector;
/**
* sponsorId
* @Attribute()
* @var int
*/
protected $sponsorId;
/**
* payments
* @Attribute()
* @var array
*/
protected $payments;
/**
* paidAmount
* @Attribute()
* @var float
*/
protected $paidAmount;
/**
* refundedAmount
* @Attribute()
* @var float
*/
protected $refundedAmount;
/**
* shippingCost
* @Attribute()
* @var float
*/
protected $shippingCost;
/**
* cancelled
* @Attribute()
* @var boolean
*/
protected $cancelled;
/**
* items
* @Attribute()
* @var array
*/
protected $items;
/**
* shipments
* @Attribute()
* @var array
*/
protected $shipments;
/**
* notificationUrl
* @Attribute()
* @var string
*/
protected $notificationUrl;
/**
* additionalInfo
* @Attribute()
* @var string
*/
protected $additionalInfo;
/**
* externalReference
* @Attribute()
* @var string
*/
protected $externalReference;
/**
* marketplace
* @Attribute()
* @var string
*/
protected $marketplace;
/**
* totalAmount
* @Attribute()
* @var float
*/
protected $totalAmount;
}

View File

@@ -0,0 +1,143 @@
<?php
/**
* OAuth class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\Attribute;
/**
* OAuth class
* @RestMethod(resource="/oauth/token", method="create")
*/
class OAuth extends Entity
{
/**
* client_secret
* @Attribute()
* @var string
*/
protected $client_secret;
/**
* grant_type
* @Attribute()
* @var string
*/
protected $grant_type;
/**
* code
* @Attribute()
* @var string
*/
protected $code;
/**
* redirect_uri
* @Attribute()
* @var string
*/
protected $redirect_uri;
/**
* access_token
* @Attribute()
* @var string
*/
protected $access_token;
/**
* public_key
* @Attribute()
* @var string
*/
protected $public_key;
/**
* refresh_token
* @Attribute()
* @var string
*/
protected $refresh_token;
/**
* live_mode
* @Attribute()
* @var boolean
*/
protected $live_mode;
/**
* user_id
* @Attribute()
* @var int
*/
protected $user_id;
/**
* token_type
* @Attribute()
* @var string
*/
protected $token_type;
/**
* expires_in
* @Attribute()
* @var int
*/
protected $expires_in;
/**
* scope
* @Attribute()
* @var string
*/
protected $scope;
/**
* getAuthorizationURL
* @param $app_id
* @param $redirect_uri
* @return string
*/
public function getAuthorizationURL($app_id, $redirect_uri){
$county_id = strtolower(SDK::getCountryId());
return "https://auth.mercadopago.com.{$county_id}/authorization?client_id={$app_id}&response_type=code&platform_id=mp&redirect_uri={$redirect_uri}";
}
/**
* getOAuthCredentials
* @param $authorization_code
* @param $redirect_uri
* @return bool|mixed
* @throws \Exception
*/
public function getOAuthCredentials($authorization_code, $redirect_uri){
$this->client_secret = SDK::getAccessToken();
$this->grant_type = 'authorization_code';
$this->code = $authorization_code;
$this->redirect_uri = $redirect_uri;
return $this->save();
}
/**
* refreshOAuthCredentials
* @param $refresh_token
* @return bool|mixed
* @throws \Exception
*/
public function refreshOAuthCredentials($refresh_token){
$this->client_secret = SDK::getAccessToken();
$this->grant_type = 'refresh_token';
$this->refresh_token = $refresh_token;
return $this->save();
}
}

View File

@@ -0,0 +1,111 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* POS class
* @link https://www.mercadopago.com/developers/en/reference/pos/_pos/post/ Click here for more infos
*
* @RestMethod(resource="/pos/:id", method="read")
* @RestMethod(resource="/pos", method="create")
* @RestMethod(resource="/pos/:id", method="update")
* @RestMethod(resource="/pos/:id", method="delete")
* @RestMethod(resource="/pos", method="search")
*/
class POS extends Entity
{
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* name
* @Attribute()
* @var string
*/
protected $name;
/**
* fixed_amount
* @Attribute()
* @var float
*/
protected $fixed_amount;
/**
* category
* @Attribute()
* @var int
*/
protected $category;
/**
* store_id
* @Attribute()
* @var string
*/
protected $store_id;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_id;
/**
* qr
* @Attribute()
* @var object
*/
protected $qr;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* date_last_updated
* @Attribute()
* @var string
*/
protected $date_last_updated;
/**
* uuid
* @Attribute()
* @var string
*/
protected $uuid;
/**
* compatible_id
* @Attribute()
* @var string
*/
protected $compatible_id;
/**
* user_id
* @Attribute()
* @var int
*/
protected $user_id;
}

View File

@@ -0,0 +1,97 @@
<?php
/**
* Plan class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Plan class
* @RestMethod(resource="/v1/plans/:id", method="read")
* @RestMethod(resource="/v1/plans/", method="create")
* @RestMethod(resource="/v1/plans/:id", method="update")
*/
class Plan extends Entity
{
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* application_fee
* @Attribute()
* @var float
*/
protected $application_fee;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* description
* @Attribute()
* @var string
*/
protected $description;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_reference;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* last_modified
* @Attribute()
* @var string
*/
protected $last_modified;
/**
* auto_recurring
* @Attribute()
* @var boolean
*/
protected $auto_recurring;
/**
* live_mode
* @Attribute()
* @var boolean
*/
protected $live_mode;
/**
* setup_fee
* @Attribute()
* @var float
*/
protected $setup_fee;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
}

View File

@@ -0,0 +1,150 @@
<?php
/**
* Preapproval class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* preapproval class
* @RestMethod(resource="/preapproval/:id", method="read")
* @RestMethod(resource="/preapproval/search", method="search")
* @RestMethod(resource="/preapproval/", method="create")
* @RestMethod(resource="/preapproval/:id", method="update")
*/
class Preapproval extends Entity
{
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* payer_id
* @Attribute()
* @var int
*/
protected $payer_id;
/**
* payer_email
* @Attribute()
* @var string
*/
protected $payer_email;
/**
* back_url
* @Attribute()
* @var string
*/
protected $back_url;
/**
* collector_id
* @Attribute()
* @var int
*/
protected $collector_id;
/**
* application_id
* @Attribute()
* @var string
*/
protected $application_id;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* auto_recurring
* @Attribute()
* @var boolean
*/
protected $auto_recurring;
/**
* init_point
* @Attribute()
* @var string
*/
protected $init_point;
/**
* sandbox_init_point
* @Attribute()
* @var string
*/
protected $sandbox_init_point;
/**
* reason
* @Attribute()
* @var string
*/
protected $reason;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_reference;
/**
* date_created
* @Attribute()
* @var string
*/
protected $date_created;
/**
* last_modified
* @Attribute()
* @var string
*/
protected $last_modified;
/**
* preapproval_plan_id
* @Attribute()
* @var string
*/
protected $preapproval_plan_id;
/**
* payment_method_id
* @Attribute()
* @var string
*/
protected $payment_method_id;
/**
* card_id
* @Attribute()
* @var string
*/
protected $card_id;
/**
* @Attribute()
*/
protected $next_payment_date;
/**
* @Attribute()
*/
protected $summarized;
}

View File

@@ -0,0 +1,231 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* This class will allow you to charge your customers through our web form from any device in a simple, fast and secure way.
*
* @link https://www.mercadopago.com/developers/en/guides/online-payments/checkout-pro/introduction Click here for more infos
*
* @RestMethod(resource="/checkout/preferences", method="create")
* @RestMethod(resource="/checkout/preferences/:id", method="read")
* @RestMethod(resource="/checkout/preferences/search", method="search")
* @RestMethod(resource="/checkout/preferences/:id", method="update")
*/
class Preference extends Entity
{
/**
* id
* @Attribute(primaryKey = true, type = "string", readOnly = true)
* @var string
*/
protected $id;
/**
* auto_return
* @Attribute()
* @var string
*/
protected $auto_return;
/**
* back_urls
* @Attribute()
* @var object
*/
protected $back_urls;
/**
* notification_url
* @Attribute(type = "string")
* @var string
*/
protected $notification_url;
/**
* init_point
* @Attribute(type = "string")
* @var string
*/
protected $init_point;
/**
* sandbox_init_point
* @Attribute(type = "string")
* @var string
*/
protected $sandbox_init_point;
/**
* operation_type
* @Attribute(type = "string")
* @var string
*/
protected $operation_type;
/**
* additional_info
* @Attribute(type = "string")
* @var string
*/
protected $additional_info;
/**
* external_reference
* @Attribute(type = "string")
* @var string
*/
protected $external_reference;
/**
* expires
* @Attribute()
* @var boolean
*/
protected $expires;
/**
* expiration_date_from
* @Attribute(type = "date")
* @var \DateTime
*/
protected $expiration_date_from;
/**
* expiration_date_to
* @Attribute(type = "date")
* @var \DateTime
*/
protected $expiration_date_to;
/**
* date_of_expiration
* @Attribute(type = "date")
* @var \DateTime
*/
protected $date_of_expiration;
/**
* collector_id
* @Attribute(type = "int")
* @var int
*/
protected $collector_id;
/**
* client_id
* @Attribute(type = "int")
* @var int
*/
protected $client_id;
/**
* marktplace
* @Attribute(type = "string")
* @var string
*/
protected $marketplace;
/**
* marketplace_fee
* @Attribute(type = "float")
* @var float
*/
protected $marketplace_fee;
/**
* differential_pricing
* @Attribute()
* @var object
*/
protected $differential_pricing;
/**
* payment_methods
* @Attribute()
* @var object
*/
protected $payment_methods;
/**
* items
* @Attribute(type = "array", required = "true")
* @var array
*/
protected $items;
/**
* payer
* @Attribute(type = "object")
* @var object
*/
protected $payer;
/**
* shipments
* @Attribute(type = "object")
* @var object
*/
protected $shipments;
/**
* date_created
* @Attribute(type = "date")
* @var \DateTime
*/
protected $date_created;
/**
* sponsor_id
* @Attribute(type = "integer")
* @var int
*/
protected $sponsor_id;
/**
* processing_modes
* @Attribute(type = "array")
* @var array
*/
protected $processing_modes;
/**
* binary_mode
* @Attribute()
* @var boolean
*/
protected $binary_mode;
/**
* taxes
* @Attribute(type = "array")
* @var array
*/
protected $taxes;
/**
* statement_descriptor
* @var string
* @Attribute()
*/
protected $statement_descriptor;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* tracks
* @Attribute(type = "array")
* @var array
*/
protected $tracks;
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* Refund class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* refund class
* @RestMethod(resource="/v1/payments/:payment_id/refunds", method="create")
* @RestMethod(resource="/v1/payments/:payment_id/refunds/:id", method="read")
*/
class Refund extends Entity {
/**
* id
* @Attribute()
* @var int
*/
protected $id;
/**
* payment_id
* @Attribute(serialize=false)
* @var int
*/
protected $payment_id;
/**
* amount
* @Attribute()
* @var float
*/
protected $amount;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* source
* @Attribute()
* @var object
*/
protected $source;
/**
* date_created
* @Attribute(readOnly=true)
* @var \DateTime
*/
protected $date_created;
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* Documentation class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Annotation\DenyDynamicAttribute;
/**
* Documentation class
*/
class Documentation extends Entity
{
/**
* type
* @Attribute(type = "string", readOnly = true)
* @var string
*/
protected $type;
/**
* url
* @Attribute(type = "string", readOnly = true)
* @var string
*/
protected $url;
/**
* description
* @Attribute(type = "string", readOnly = true)
* @var string
*/
protected $description;
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Item class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Annotation\DenyDynamicAttribute;
/**
* Item class
*/
class Item extends Entity
{
/**
* id
* @Attribute(type = "string")
* @var string
*/
protected $id;
/**
* title
* @Attribute(type = "string")
* @var string
*/
protected $title;
/**
* description
* @Attribute(type = "string")
* @var string
*/
protected $description;
/**
* category_id
* @Attribute(type = "string")
* @var string
*/
protected $category_id;
/**
* picture_url
* @Attribute(type = "string")
* @var string
*/
protected $picture_url;
/**
* currency_id
* @Attribute(type = "string")
* @var string
*/
protected $currency_id;
/**
* quantity
* @Attribute(type = "int")
* @var int
*/
protected $quantity;
/**
* unit_price
* @Attribute(type = "float")
* @var float
*/
protected $unit_price;
}

View File

@@ -0,0 +1,99 @@
<?php
/**
* Payer class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
use MercadoPago\Annotation\DenyDynamicAttribute;
/**
* Payer Class
*/
class Payer extends Entity
{
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* entity_type
* @Attribute(type = "string")
* @var string
*/
protected $entity_type;
/**
* type
* @Attribute(type = "string")
* @var string
*/
protected $type;
/**
* name
* @Attribute(type = "string")
* @var string
*/
protected $name;
/**
* surname
* @Attribute(type = "string")
* @var string
*/
protected $surname;
/**
* first_name
* @Attribute(type = "string")
* @var string
*/
protected $first_name;
/**
* last_name
* @Attribute(type = "string")
* @var string
*/
protected $last_name;
/**
* email
* @Attribute(type = "string")
* @var string
*/
protected $email;
/**
* date_created
* @Attribute(type = "date")
* @var \DateTime
*/
protected $date_created;
/**
* phone
* @Attribute()
* @var object
*/
protected $phone;
/**
* identification
* @Attribute()
* @var object
*/
protected $identification;
/**
* address
* @Attribute()
* @var object
*/
protected $address;
}

View File

@@ -0,0 +1,644 @@
<?php
/**
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* This class provides the methods to access the API that will allow you to create your own payment experience on your website.
*
* From basic to advanced configurations, you control the whole experience.
*
* @link https://www.mercadopago.com/developers/en/guides/online-payments/checkout-api/introduction/ Click here for more infos
*
* @RestMethod(resource="/v1/payments", method="create")
* @RestMethod(resource="/v1/payments/:id", method="read")
* @RestMethod(resource="/v1/payments/search", method="search")
* @RestMethod(resource="/v1/payments/:id", method="update")
* @RestMethod(resource="/v1/payments/:id/refunds", method="refund")
*/
class Payment extends Entity
{
/**
* id
* @var int
* @Attribute(primaryKey = true)
*/
protected $id;
/**
* acquirer
* @var string
* @Attribute()
*/
protected $acquirer;
/**
* acquirer_reconciliation
* @var string
* @Attribute()
*/
protected $acquirer_reconciliation;
/**
* site_id
* @var string
* @Attribute(idempotency = true)
*/
protected $site_id;
/**
* sponsor_id
* @var int
* @Attribute()
*/
protected $sponsor_id;
/**
* operation_type
* @var string
* @Attribute()
*/
protected $operation_type;
/**
* order_id
* @var int
* @Attribute(idempotency = true)
*/
protected $order_id;
/**
* order
* @var int
* @Attribute()
*/
protected $order;
/**
* binary_mode
* @var boolean
* @Attribute()
*/
protected $binary_mode;
/**
* external_reference
* @var string
* @Attribute()
*/
protected $external_reference;
/**
* status
* @var string
* @Attribute()
*/
protected $status;
/**
* status_detail
* @var string
* @Attribute()
*/
protected $status_detail;
/**
* store_id
* @var int
* @Attribute()
*/
protected $store_id;
/**
* taxes_amount
* @var float
* @Attribute()
*/
protected $taxes_amount;
/**
* payment_type
* @var string
* @Attribute(type = "string")
*/
protected $payment_type;
/**
* date_created
* @var \DateTime
* @Attribute()
*/
protected $date_created;
/**
* last_modified
* @var \DateTime
* @Attribute()
*/
protected $last_modified;
/**
* live_mode
* @var boolean
* @Attribute()
*/
protected $live_mode;
/**
* date_last_update
* @var \DateTime
* @Attribute()
*/
protected $date_last_updated;
/**
* date_of_expiration
* @var \DateTime
* @Attribute()
*/
protected $date_of_expiration;
/**
* deduction_schema
* @var string
* @Attribute()
*/
protected $deduction_schema;
/**
* date_approved
* @var \DateTime
* @Attribute()
*/
protected $date_approved;
/**
* money_release_date
* @var \DateTime
* @Attribute()
*/
protected $money_release_date;
/**
* money_release_days
* @var int
* @Attribute()
*/
protected $money_release_days;
/**
* money_release_schema
* @var string
* @Attribute()
*/
protected $money_release_schema;
/**
* money_release_status
* @var string
* @Attribute()
*/
protected $money_release_status;
/**
* currency_id
* @var string
* @Attribute()
*/
protected $currency_id;
/**
* transaction_amount
* @var float
* @Attribute(type = "float")
*/
protected $transaction_amount;
/**
* transaction_amount_refunded
* @var float
* @Attribute(type = "float")
*/
protected $transaction_amount_refunded;
/**
* shipping_cost
* @var float
* @Attribute()
*/
protected $shipping_cost;
/**
* total_paid_amount
* @var float
* @Attribute(idempotency = true)
*/
protected $total_paid_amount;
/**
* finance_charge
* @var float
* @Attribute(type = "float")
*/
protected $finance_charge;
/**
* net_received_amount
* @var float
* @Attribute()
*/
protected $net_received_amount;
/**
* marketplace
* @var string
* @Attribute()
*/
protected $marketplace;
/**
* marketplace_fee
* @var float
* @Attribute(type = "float")
*/
protected $marketplace_fee;
/**
* reason
* @var string
* @Attribute()
*/
protected $reason;
/**
* payer
* @var object
* @Attribute()
*/
protected $payer;
/**
* collector
* @var object
* @Attribute()
*/
protected $collector;
/**
* collector_id
* @var int
* @Attribute()
*/
protected $collector_id;
/**
* counter_currency
* @var string
* @Attribute()
*/
protected $counter_currency;
/**
* payment_method_id
* @var string
* @Attribute()
*/
protected $payment_method_id;
/**
* payment_type_id
* @var string
* @Attribute()
*/
protected $payment_type_id;
/**
* pos_id
* @var string
* @Attribute()
*/
protected $pos_id;
/**
* transaction_details
* @var object
* @Attribute()
*/
protected $transaction_details;
/**
* fee_details
* @var object
* @Attribute()
*/
protected $fee_details;
/**
* differential_pricing_id
* @var int
* @Attribute()
*/
protected $differential_pricing_id;
/**
* application_fee
* @var float
* @Attribute()
*/
protected $application_fee;
/**
* authorization_code
* @var string
* @Attribute()
*/
protected $authorization_code;
/**
* capture
* @var boolean
* @Attribute()
*/
protected $capture;
/**
* captured
* @var boolean
* @Attribute()
*/
protected $captured;
/**
* card
* @var int
* @Attribute()
*/
protected $card;
/**
* call_for_authorize_id
* @var string
* @Attribute()
*/
protected $call_for_authorize_id;
/**
* statement_descriptor
* @var string
* @Attribute()
*/
protected $statement_descriptor;
/**
* refunds
* @var object
* @Attribute()
*/
protected $refunds;
/**
* Shipping_amount
* @var float
* @Attribute()
*/
protected $shipping_amount;
/**
* additional_info
* @var array
* @Attribute()
*/
protected $additional_info;
/**
* campaign_id
* @var string
* @Attribute()
*/
protected $campaign_id;
/**
* coupon_amount
* @var float
* @Attribute()
*/
protected $coupon_amount;
/**
* installments
* @var int
* @Attribute(type = "int")
*/
protected $installments;
/**
* token
* @var string
* @Attribute()
*/
protected $token;
/**
* description
* @var string
* @Attribute()
*/
protected $description;
/**
* notification_url
* @var string
* @Attribute()
*/
protected $notification_url;
/**
* issuer_id
* @var string
* @Attribute()
*/
protected $issuer_id;
/**
* processing_mode
* @var string
* @Attribute()
*/
protected $processing_mode;
/**
* merchant_account_id
* @var int
* @Attribute()
*/
protected $merchant_account_id;
/**
* merchant_number
* @var int
* @Attribute()
*/
protected $merchant_number;
/**
* metadata
* @var object
* @Attribute()
*/
protected $metadata;
/**
* callback_url
* @var string
* @Attribute()
*/
protected $callback_url;
/**
* amount_refunded
* @var float
* @Attribute()
*/
protected $amount_refunded;
/**
* coupon_code
* @var string
* @Attribute()
*/
protected $coupon_code;
/**
* barcode
* @var string
* @Attribute()
*/
protected $barcode;
/**
* marketplace_owner
* @var int
* @Attribute()
*/
protected $marketplace_owner;
/**
* integrator_id
* @var string
* @Attribute()
*/
protected $integrator_id;
/**
* corporation_id
* @var string
* @Attribute()
*/
protected $corporation_id;
/**
* platform_id
* @var string
* @Attribute()
*/
protected $platform_id;
/**
* charges details
* @var object
* @Attribute()
*/
protected $charges_details;
/**
* taxes
* @Attribute(type = "array")
* @var array
*/
protected $taxes;
/**
* net_amount
* @var float
* @Attribute(type = "float")
*/
protected $net_amount;
/**
* payer
* @var object
* @Attribute()
*/
protected $point_of_interaction;
/**
* payment_method_option_id
* @var string
* @Attribute()
*/
protected $payment_method_option_id;
/**
* merchant_services
* @var object
* @Attribute()
*/
protected $merchant_services;
/**
* build_version
* @var string
* @Attribute()
*/
protected $build_version;
/**
* payment_method
* @var object
* @Attribute()
*/
protected $payment_method;
/**
* refund
* @param int $amount
* @return bool
* @throws \Exception
*/
public function refund($amount = 0){
$refund = new Refund(["payment_id" => $this->id]);
if ($amount > 0){
$refund->amount = $amount;
}
if ($refund->save()){
$payment = self::get($this->id);
$this->_fillFromArray($this, $payment->toArray());
return true;
}else{
$this->error = $refund->error;
return false;
}
}
/**
* capture
* @param int $amount
* @return Payment
* @throws \Exception
*/
public function capture($amount = 0)
{
$this->capture = true;
if ($amount > 0){
$this->transaction_amount = $amount;
}
return $this->update();
}
}

View File

@@ -0,0 +1,114 @@
<?php
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Payment Method class
* @link https://www.mercadopago.com/developers/en/reference/payment_methods/_payment_methods/get/ Click here for more infos
*
* @RestMethod(resource="/v1/payment_methods", method="list")
*/
class PaymentMethod extends Entity
{
/**
* id
* @Attribute(primaryKey = true)
* @var string
*/
protected $id;
/**
* name
* @Attribute(type = "string")
* @var string
*/
protected $name;
/**
* payment_type_id
* @Attribute(type = "string")
* @var string
*/
protected $payment_type_id;
/**
* status
* @Attribute(type = "string")
* @var string
*/
protected $status;
/**
* secure_thumbnail
* @Attribute(type = "string")
* @var string
*/
protected $secure_thumbnail;
/**
* thumbnail
* @Attribute(type = "string")
* @var string
*/
protected $thumbnail;
/**
* deferred_capture
* @Attribute(type = "string")
* @var string
*/
protected $deferred_capture;
/**
* settings
* @Attribute()
* @var object
*/
protected $settings;
/**
* additional_info_needed
* @Attribute()
* @var string
*/
protected $additional_info_needed;
/**
* min_allowed_amount
* @Attribute(type = "float")
* @var float
*/
protected $min_allowed_amount;
/**
* max_allowed_amount
* @Attribute(type = "float")
* @var float
*/
protected $max_allowed_amount;
/**
* accreditation_time
* @Attribute(type = "integer")
* @var int
*/
protected $accreditation_time;
/**
* financial_institutions
* @Attribute(type = "")
* @var object
*/
protected $financial_institutions;
/**
* processing_modes
* @Attribute(type = "")
* @var array
*/
protected $processing_modes;
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Tax class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
/**
* Tax class
*/
class Tax extends Entity
{
/**
* type
* @Attribute(type = "string")
* @var string
*/
protected $type;
/**
* value
* @Attribute(type = "float")
* @var float
*/
protected $value;
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Track class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
/**
* Track class
*/
class Track extends Entity
{
/**
* type
* @Attribute(type = "string")
* @var string
*/
protected $type;
/**
* value
* @Attribute(type = "object")
* @var object
*/
protected $value;
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Track Values class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\Attribute;
/**
* Track Values class
*/
class TrackValues extends Entity
{
/**
* conversion_id
* @Attribute(type = "string")
* @var string
*/
protected $conversion_id;
/**
* conversion_label
* @Attribute(type = "string")
* @var string
*/
protected $conversion_label;
/**
* pixel_id
* @Attribute(type = "string")
* @var string
*/
protected $pixel_id;
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* Shipments class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
use phpDocumentor\Descriptor\Type\FloatDescriptor;
/**
* Shipments class
* @RestMethod(resource="/v1/payments/:payment_id/refunds", method="create")
* @RestMethod(resource="/v1/payments/:payment_id/refunds/:id", method="read")
* @deprecated This class is deprecated
*/
class Shipments extends Entity {
/**
* mode
* @Attribute()
* @var string
*/
protected $mode;
/**
* local_pickup
* @Attribute()
* @var boolean
*/
protected $local_pickup;
/**
*free_methods
* @Attribute()
* @var array
*/
protected $free_methods;
/**
* cost
* @Attribute()
* @var Float
*/
protected $cost;
/**
* free_shipping
* @Attribute()
* @var boolean
*/
protected $free_shipping;
/**
* receiver_address
* @Attribute()
* @var object
*/
protected $receiver_address;
/**
* dimensions
* @Attribute()
* @var object
*/
protected $dimensions;
/**
* default_shipping_method
* @Attribute()
* @var string
*/
protected $default_shipping_method;
}

View File

@@ -0,0 +1,126 @@
<?php
/**
* Subscription class file
*/
namespace MercadoPago;
use MercadoPago\Annotation\RestMethod;
use MercadoPago\Annotation\RequestParam;
use MercadoPago\Annotation\Attribute;
/**
* Subscription class
* @RestMethod(resource="/v1/subscriptions/:id", method="read")
* @RestMethod(resource="/v1/subscriptions/", method="create")
* @RestMethod(resource="/v1/subscriptions/:id", method="update")
*/
class Subscription extends Entity
{
/**
* id
* @Attribute()
* @var string
*/
protected $id;
/**
* plan_id
* @Attribute()
* @var string
*/
protected $plan_id;
/**
* payer
* @Attribute()
* @var object
*/
protected $payer;
/**
* application_fee
* @Attribute()
* @var float
*/
protected $application_fee;
/**
* status
* @Attribute()
* @var string
*/
protected $status;
/**
* description
* @Attribute()
* @var string
*/
protected $description;
/**
* external_reference
* @Attribute()
* @var string
*/
protected $external_reference;
/**
* date_created
* @Attribute()
* @var \DateTime
*/
protected $date_created;
/**
* last_modified
* @Attribute()
* @var \DateTime
*/
protected $last_modified;
/**
* live_mode
* @Attribute()
* @var boolean
*/
protected $live_mode;
/**
* start_date
* @Attribute()
* @var \DateTime
*/
protected $start_date;
/**
* end_date
* @Attribute()
* @var \DateTime
*/
protected $end_date;
/**
* metadata
* @Attribute()
* @var object
*/
protected $metadata;
/**
* charge_detail
* @Attribute()
* @var object
*/
protected $charges_detail;
/**
* setup_fee
* @Attribute()
* @var float
*/
protected $setup_fee;
}