Skip to content

Commit

Permalink
Merge pull request #423 from mercadopago/feature/add_resource_get_cus…
Browse files Browse the repository at this point in the history
…tomer_card_list

Add resource get customer card list
  • Loading branch information
eltinMeli authored Aug 3, 2023
2 parents dea9c19 + 769abe9 commit be9cf1c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"homepage": "https://github.com/mercadopago/sdk-php",
"license": "MIT",
"version": "2.5.5",
"version": "2.6.0",
"config": {
"platform": {
"php": "7.1"
Expand Down
6 changes: 6 additions & 0 deletions samples/customer-and-cards/card/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
require_once dirname(__FILE__) . '/../../index.php';

$cards = MercadoPago\Card::all(array("customer_id" => "0000000000-zk2BeFiet6otYD"));
echo 'Card ID: ' . $cards[0]->id;
?>
1 change: 1 addition & 0 deletions src/MercadoPago/Entities/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @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")
Expand Down
3 changes: 1 addition & 2 deletions src/MercadoPago/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ public static function read($params = [], $options = [])
/**
* @return mixed
*/
public static function all($options = [])
public static function all($params = [], $options = [])
{
$params = [];
$class = get_called_class();
$entity = new $class();
$entities = array();
Expand Down
2 changes: 1 addition & 1 deletion 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 = '2.5.5';
$_VERSION = '2.6.0';
}

0 comments on commit be9cf1c

Please sign in to comment.