How to use the mercadopago.abstract_api.RetrievableAPIResource function in mercadopago

To help you get started, we’ve selected a few mercadopago examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github federicobond / pymercadopago / mercadopago / api.py View on Github external
class CustomerAPI(RetrievableAPIResource, CreatableAPIResource,
                  UpdatableAPIResource, DeletableAPIResource,
                  SearchableAPIResource):
    _base_path = '/v1/customers'

    def cards(self, id):
        return CardAPI(self._client, id)


class IdentificationTypeAPI(ListableAPIResource):
    _base_path = '/identification_types'


class InvoiceAPI(RetrievableAPIResource):
    _base_path = '/v1/invoices'


class MerchantOrderAPI(RetrievableAPIResource, CreatableAPIResource,
                       UpdatableAPIResource):
    _base_path = '/merchant_orders'


class PaymentMethodAPI(ListableAPIResource):
    _base_path = '/v1/payment_methods'

    def card_issuers(self, payment_method_id):
        return self._client.get('/card_issuers', params={'payment_method_id': payment_method_id})

    def installments(self, **data):
        return self._client.get('/installments', params=data)
github federicobond / pymercadopago / mercadopago / api.py View on Github external
class DisbursementAPI(API):
    _base_path = '/v1/advanced_payments/{payment_id}/disbursements'

    def __init__(self, client, payment_id):
        super().__init__(client, path_args={'payment_id': payment_id})

    def refunds(self, id, **data):
        return self._client.post('/{disbursement_id}/refunds', {'disbursement_id': id}, json=data)

    def disburses(self, id, **data):
        return self._client.post('/{disbursement_id}/disburses', {'disbursement_id': id}, json=data)


class ChargebackAPI(RetrievableAPIResource):
    _base_path = '/v1/chargebacks'


class PlanAPI(RetrievableAPIResource, CreatableAPIResource,
              UpdatableAPIResource):
    _base_path = '/v1/plans'


class PreferenceAPI(RetrievableAPIResource, CreatableAPIResource,
                    UpdatableAPIResource, ListableAPIResource):
    _base_path = '/checkout/preferences'


class MoneyRequestAPI(RetrievableAPIResource, CreatableAPIResource):
    _base_path = '/money_requests'