Skip to content

Commit

Permalink
Merge pull request #40 from Potelo/get-user-credit-cards
Browse files Browse the repository at this point in the history
Adiciona método que retorna todos os cartões de crédito do usuário.
  • Loading branch information
gabrielpeixoto committed Feb 7, 2022
2 parents bff96ea + bfbee3b commit aba0f39
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/GuPaymentTrait.php
Expand Up @@ -584,4 +584,16 @@ public function duplicate($id,$config)

return $iuguInvoice->duplicate($config);
}

/**
* Get all customer payment methods.
*
* @return Iugu_SearchResult|mixed|void
*/
public function creditCards()
{
Iugu::setApiKey($this->getApiKey());

return \Iugu_PaymentMethod::fetch(['customer_id' => $this->getIuguUserId()]);
}
}

0 comments on commit aba0f39

Please sign in to comment.