mollie vreemd probleem in webhook

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Daniel van Seggelen

Daniel van Seggelen

04/12/2024 05:32:02
Quote Anchor link
Na een (test) bestelling, word er een post verstuurd naar webhook.php en dat heeft altijd prima gewerkt.

Nu wil ik een loop gebruiken, waarbij er meerdere mensen apart een mail horen krijgen.
Maar dit gebeurd niet, als ik heb zonder mollie post trans_id aanspreek, dan is de code verder prima.

Ik kan het nergen debuggen, in de apache logs staat niks.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
$cart_id = $DBD->getField('orders','id','cart_id',$orderId);
$cart_id_arr = unserialize($cart_id); // array bestaat


 $mail = new PHPMailer();    
 try {
          // ISPAID ALLE MAILS van de publishers links emails<br>
             $cartArr = unserialize($cart_id);
            // ob_start();

            // $myHTML = ob_get_clean();              
              foreach ($cartArr as  $value)
              {
                        $link_id = $DBD->getField('cart','id','link_id',$value);
                        $type = $DBD->getField('links','id','type',$link_id);
                        $priceOne = $DBD->getField('cart','id','amount',$value);
                        $pub_id = $DBD->getField('cart','id','publisher_id',$value);
                        $publisher_mail = $DBD->getField('members','id','email',$pub_id);
                        $publisher_naam = $DBD->getField('members','id','gebruikersnaam',$pub_id);
                        
                        if ($type == 'startpagina_link')
                        {
                         $type = $_SESSION["def"]["STARTPAGE_LINK"];

                        } else {
                           $type = $type;  
                        }

                        if ($type == $_SESSION["def"]["STARTPAGE_LINK"] || $type == 'link')
                        {
                          $typeText = $_SESSION["def"]["SOLD_LINKS"];    
                          $typeUrl = 'https://app.test.com/nl/publisher?state=link-sold';        
                        }
                        else if ($type == 'blog')
                        {
                          $typeText = $_SESSION["def"]["SOLD_BLOGS"];    
                          $typeUrl = 'https://app.test.com/nl/publisher?state=blog-sold';        
                        }
                    $priceOne = $priceOne / 1.20;
                  
                  
                   // include(DOC_ROOT.'inc/email_payment_done_seller.php');
                                                ob_start();
                                                   include(DOC_ROOT.'inc/email_payment_done_seller.php');
                                                 $myHTMLp = ob_get_clean();
                                                 $berichtOne = preg_replace('~[\n\r\s]+~',' ', $myHTMLp);    
                              

                                        





$mail->setFrom('[email protected]', 'test');
                                         $mail->addAddress(''.$publisher_mail.'', 'test');     // Add a recipient
                                         $mail->addBCC('[email protected]');
                                         $mail->addBCC('[email protected]');
                                        $mail->addBCC(''.$publisher_mail.'');
                                         $mail->addReplyTo('[email protected]', 'no-reply');

                                        //Content
                                         $mail->isHTML(true);                                  // Set email format to HTML
                                         $mail->Subject = ''.$typeText.' EURO: '.number_format($priceOne,2).'';
                                         $mail->Body    = $berichtOne;
                                        //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
                                         $mail->send();
                                         $mail->clearAddresses();
                                         $myHTMLp = '';
                                         $berichtOne = '';
                                       // echo 'Message has been sent';

                                

            } // end foreach

        } catch (Exception $e) {
            echo 'Message could not be sent.';
            echo 'Mailer Error: ' .  $mail->ErrorInfo;
        }    


Krijg echt niks binnen. via mollie, wel in de BCC soms, maar niet naar het

"$mail->addAddress(''.$publisher_mail.'', 'test'); "
 
PHP hulp

PHP hulp

04/12/2024 19:36:31
 
- Ariën  -
Beheerder

- Ariën -

04/12/2024 09:13:02
Quote Anchor link
Dan zet je toch de debugging-optie van phpMailer aan?
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.