def create(**data): """ Create a Payment request. :param data: data required to create the payment :return: The payment resource :rtype resources.Payment """ http_client = HttpClient() response, _ = http_client.post(routes.url(routes.CREATE_PAYMENT), data) return resources.Payment(**response)
def create(**data): """ Create a customer. :param data: data required to create the customer :return: The customer resource :rtype resources.Customer """ http_client = HttpClient() response, _ = http_client.post(routes.url(routes.CUSTOMER_RESOURCE), data) return resources.Customer(**response)
def create(**data): """ Create a Payment request. :param data: data required to create the payment :return: The payment resource :rtype resources.Payment """ http_client = HttpClient() response, _ = http_client.post(routes.url(routes.PAYMENT_RESOURCE), data) return resources.Payment(**response)
def create(**data): """ Create a customer. :param data: data required to create the customer :return: The customer resource :rtype resources.Customer """ http_client = HttpClient() response, _ = http_client.post(routes.url(routes.CUSTOMER_RESOURCE), data) return resources.Customer(**response)
def create(payment, **data): """ Create a refund on a payment. :param payment: Either the payment object or the payment id you want to refund. :type payment: resources.Payment|string :param data: data required to create the refund :return: The refund resource :rtype resources.Refund """ if isinstance(payment, resources.Payment): payment = payment.id http_client = HttpClient() response, _ = http_client.post(routes.url(routes.CREATE_REFUND, payment_id=payment), data) return resources.Refund(**response)
def create(customer, **data): """ Create a card instance. :param customer: the customer id or object :type customer: string|Customer :param data: data required to create the card :return: The card resource :rtype resources.Card """ if isinstance(customer, resources.Customer): customer = customer.id http_client = HttpClient() response, _ = http_client.post(routes.url(routes.CARD_RESOURCE, customer_id=customer), data) return resources.Card(**response)
def create(customer, **data): """ Create a card instance. :param customer: the customer id or object :type customer: string|Customer :param data: data required to create the card :return: The card resource :rtype resources.Card """ if isinstance(customer, resources.Customer): customer = customer.id http_client = HttpClient() response, _ = http_client.post( routes.url(routes.CARD_RESOURCE, customer_id=customer), data) return resources.Card(**response)
def create(payment, **data): """ Create a refund on a payment. :param payment: Either the payment object or the payment id you want to refund. :type payment: resources.Payment|string :param data: data required to create the refund :return: The refund resource :rtype resources.Refund """ if isinstance(payment, resources.Payment): payment = payment.id http_client = HttpClient() response, _ = http_client.post( routes.url(routes.REFUND_RESOURCE, payment_id=payment), data) return resources.Refund(**response)