2 Angajamente 3c493e0602 ... aa567f0b2e

Autor SHA1 Permisiunea de a trimite mesaje. Dacă este dezactivată, utilizatorul nu va putea trimite nici un fel de mesaj Data
  Sylhaf aa567f0b2e fixed quotes mistake 2 ani în urmă
  Sylhaf 284e9804cf update readme 2 ani în urmă
3 a modificat fișierele cu 8 adăugiri și 7 ștergeri
  1. 2 2
      main.py
  2. 5 4
      readme.md
  3. 1 1
      references_example.conf

+ 2 - 2
main.py

@@ -206,7 +206,7 @@ LOGGER.setLevel(logging.CRITICAL)
 
 logger.info("CRM Login")
 driver = webdriver.Edge()
-driver.get(dolibarr_url + "index.php")
+driver.get(str(dolibarr_url) + "/index.php")
 assert "Identifiant" in driver.title
 
 
@@ -223,7 +223,7 @@ current_date = datetime.datetime.now()
 
 if args.planned : 
     logger.info("preparation phase : trigger planned work in CRM")
-    work_url = dolibarr_url + "/public/cron/cron_run_jobs_by_url.php?securitykey=" + \
+    work_url = str(dolibarr_url) + "/public/cron/cron_run_jobs_by_url.php?securitykey=" + \
         dolibarr_planned_work_key + "&userlogin=" + dolibarr_username + "&id=" + str(dolibarr_planned_work_cron_job_id)
     driver.get(work_url)
     logger.info("temporization 1 sec....")

+ 5 - 4
readme.md

@@ -11,7 +11,7 @@ thanks [https://www.mistergeek.net](https://www.mistergeek.net) for the visibili
 Manual : 
 
 1. get a dolibarr account that can read/write invoices/contracts/clients and get an read Stripe API KEY, put both in a reference.conf file.  an exemple of conf is in the file references_example.conf.
-2. Create your contract associated to your client in dolibarr and get his ID in its URL : https://dolibarr_instance.com/contrat/card.php?id=13 -> here the ID is 13
+2. Create your contract associated to your client in dolibarr and get his ID in its URL : https://dolibarr_instance.com/contrat/card.php?id=13 -> here the ID is 13, with the contract you can create an invoice manually or use recuuring invoice. For now it's working only for monthly subscriptions. i can add the feature if requested.
 3. you have to wait the first payment of your client in Stripe, when it's done get the subscription ID, it looks like something like that : 
 sub_1Lsdhjqsdlkqh2367sdhqjTx
 
@@ -35,7 +35,8 @@ options:
   
   
   1. verify connection to Stripe
-  2. Test All Stripe Subscription référence and gather Data about it ( last payment) 
-  3. Connect to dolibarr via Selenium to Gather contracts last invoices data and their status.
+  2. Test All Stripe Subscription référence and gather Data about it (last payment) 
+  3. Connect to dolibarr via Selenium to Gather contracts data, specifically all invoice associated.
+                if an invoice is "unpaid" and have the same month of the stripe payment it will be registered for processing later. 
   4. make a summary in console of what action will be perfomed
-  5. perform actions : mark corresponding invoices as "paid" and if option is activated send a mail to the client registered in dolibarr. (it uses the Stripe Mail) 
+  5. perform actions : mark corresponding invoices as "paid" with stripe details and if option is activated send a mail to the client registered in dolibarr. (it uses the Stripe Mail) 

+ 1 - 1
references_example.conf

@@ -1,5 +1,5 @@
 [credentials]
-dolibarr_url = "https://your_dolibarr.com"
+dolibarr_url = https://your_dolibarr.com
 stripe_api_key = example_key_2349872349874
 dolibarr_username = user
 dolibarr_password = pass