Closed tgonzales closed 6 years ago
Funcionando normalmente
plan = iugu.Plan() res = plan.list() res {u'totalItems': 0, u'items': []} plan.create({ "name": "teste", "identifier": "teste_plan", "interval": 1, "interval_type": "months", "value_cents": 5000, "payable_with": "all", "currency": "BRL", }) {u'interval': 1, u'name': u'teste', u'payable_with': u'all', u'created_at': u'2018-07-29T12:39:29-03:00', u'interval_type': u'months', u'updated_at': u'2018-07-29T12:39:29-03:00', u'prices': [{u'plan_id': u'F6A867FF50054626B8C0F92C7C303925', u'created_at': u'2018-07-29T12:39:29-03:00', u'updated_at': u'2018-07-29T12:39:29-03:00', u'value_cents': 5000, u'currency': u'BRL', u'id': u'D73B302C16F34625A64B58716F445C67'}], u'identifier': u'teste_plan', u'id': u'F6A867FF50054626B8C0F92C7C303925', u'features': []}
res = plan.list() res {u'totalItems': 1, u'items': [{u'interval': 1, u'name': u'teste', u'payable_with': u'all', u'created_at': u'2018-07-29T12:39:29-03:00', u'interval_type': u'months', u'updated_at': u'2018-07-29T12:39:29-03:00', u'prices': [{u'value_cents': 5000, u'currency': u'BRL', u'created_at': u'2018-07-29T12:39:29-03:00', u'id': u'D73B302C16F34625A64B58716F445C67', u'updated_at': u'2018-07-29T12:39:29-03:00'}], u'identifier': u'teste_plan', u'id': u'F6A867FF50054626B8C0F92C7C303925', u'features': []}]}
plan.search(id="F6A867FF50054626B8C0F92C7C303925") {u'interval': 1, u'name': u'teste', u'payable_with': u'all', u'created_at': u'2018-07-29T12:39:29-03:00', u'interval_type': u'months', u'updated_at': u'2018-07-29T12:39:29-03:00', u'prices': [{u'plan_id': u'F6A867FF50054626B8C0F92C7C303925', u'created_at': u'2018-07-29T12:39:29-03:00', u'updated_at': u'2018-07-29T12:39:29-03:00', u'value_cents': 5000, u'currency': u'BRL', u'id': u'D73B302C16F34625A64B58716F445C67'}], u'identifier': u'teste_plan', u'id': u'F6A867FF50054626B8C0F92C7C303925', u'features': []}
plan.search(identifier="teste_plan") {u'interval': 1, u'name': u'teste', u'payable_with': u'all', u'created_at': u'2018-07-29T12:39:29-03:00', u'interval_type': u'months', u'updated_at': u'2018-07-29T12:39:29-03:00', u'prices': [{u'plan_id': u'F6A867FF50054626B8C0F92C7C303925', u'created_at': u'2018-07-29T12:39:29-03:00', u'updated_at': u'2018-07-29T12:39:29-03:00', u'value_cents': 5000, u'currency': u'BRL', u'id': u'D73B302C16F34625A64B58716F445C67'}], u'identifier': u'teste_plan', u'id': u'F6A867FF50054626B8C0F92C7C303925', u'features': []}
Olá amigos, não consigo carregar um plano baseado em seu ID ou Identifier. Segue o resultado do console.
plan = iugu.Plan() res = plan.list() {"response": {"totalItems": 1, "items": [{"created_at": "2018-03-05T15:27:12-03:00", "updated_at": "2018-03-05T15:27:12-03:00", "interval": 1, "prices": [{"created_at": "2018-03-05T15:27:12-03:00", "value_cents": 1000, "currency": "BRL", "updated_at": "2018-03-05T15:27:12-03:00", "id": "3E684E90F2BF48BCA55976B531FF84A0"}], "payable_with": "all", "id": "E087F9CDFA8E49E996BB7F5E6FA96C3D", "identifier": "basic_plan", "interval_type": "months", "name": "Plano Basico"}]}}
res = plan.search(id="E087F9CDFA8E49E996BB7F5E6FA96C3D") {"response": {"errors": "Invalid UUID format."}}
res = plan.search(identifier="basic_plan") {"response": {"errors": "Not Found"}}
obrigado