donations.php

fix actual Date
This commit is contained in:
schrom01 2023-02-16 20:03:25 +01:00
parent 9cc8fb405c
commit ec71770847
1 changed files with 1 additions and 5 deletions

View File

@ -1,8 +1,4 @@
<?php
echo "test";
//echo date();
echo "test2";
echo mktime();
$dolibarrURL = "https://dolibarr.romanschenk.ch/";
function createDonation($amount, $dolibarrURL) {
$BusinesspartnerID = "220";
@ -12,7 +8,7 @@ function createDonation($amount, $dolibarrURL) {
curl_setopt($ch, CURLOPT_URL, $dolibarrURL."api/index.php/donations");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"amount\": ".$amount.", \"date\": 1676545200, \"socid\": ".$BusinesspartnerID.", \"note_public\": \"Automatisch generiert von genderwatchprotocol.com\"}");
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"amount\": ".$amount.", \"date\": ".time().", \"socid\": ".$BusinesspartnerID.", \"note_public\": \"Automatisch generiert von genderwatchprotocol.com\"}");
$headers = array();
$headers[] = 'Content-Type: application/json';