Molie

Gestart doorShahiem7 reacties32 weergaven

8 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Ik wil een Molie Wallie Api gebruiken , nu heb ik het maar hij stuurt je niet door naar de betaalscherm. Hoe los ik dit op?

Code

require_once includes/class/Mollie/Wallie.php;
            include includes/header.php;

            $molliePartnerID = 0; // Fill in your own Mollie Partner ID! 

            // Get an instance of the Mollie_Wallie class
            $wallie = new Mollie_Wallie($molliePartnerID);

            if (!isset($_GET[transaction_id]) and !isset($_GET[amount])) {

              // Create the payment, true on succes, false otherwise
              // $amount = the total money amount that the user has to pay (in cents!)
              // $siteReportUrl = the url where Mollie reports to when the payment is complete.
              //                  Mollie will add payment_type=wallie&transaction_id=<transactionId>&amount=<amount> to this url!
              // $siteReturnUrl = the url where Mollie returns to when the payment is complete.
              //                  Mollie will add transaction_id=<transactionId>&amount=<amount> to this url!
              
              $amount        = 250;
              $siteReportUrl = ROOT.vip/wallie;
              $siteReturnUrl = ROOT.vip/wallie;
              
              if ($wallie->createPayment($amount, $siteReportUrl, $siteReturnUrl)) {
                // Payment created, You could(/should) save the payment information in your database
                
                // Get the url of the chosen bank to redirect the user to,
                // to complete the payment    
                header(location:  . $wallie->getWallieUrl());
              }
              else {
                // show message that the payment could not be created
                // the function $wallie->getStatus() returns the status
                // message that Mollie returns
              }
            }

            // (Background) report from Mollie
            elseif (isset($_GET[payment_type]) and $_GET[payment_type] == wallie and isset($_GET[transaction_id]) and isset($_GET[amount])) {
              // Check if payment is OK.
              $checkPayment = $wallie->checkPayment($_GET[transaction_id], $_GET[amount]);
              // Mollie makes sure a transaction can only
              // be used one time!
              
              if ($checkPayment == true) {
                // Get the amount of money the user has payed
                $paymentAmount = $wallie->getAmount();
                
                // Set in your database the paymentstatus to OK.    
              }  
              else {
                // Payment failed
              }
            }

            // Return of customer
            else {
              // Check in your database if the customer has payed using $_GET[transaction_id] parameter
              // and show customer a thank you-page or a your order will be processed-page.
             
             echo OK;
              
            }
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik denk dat er iets fout zit in de if module waarin de header() functie staat
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik ga denk ik gewoon de Betaalpopups gebruiken
0
Berichten
1.168
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik gebruik de Wallie API ook, zonder problemen..
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
header(location: . $wallie->getWallieUrl());

en daarvoor include je al een header.. volgens mij heb je al data verstuurd, dus dan kan je geen header meer sturen wink
0
Miel

Lid

Berichten
4.462
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
include includes/header.php; wegslopen en na de header plaatsen.
0
Berichten
2
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waar is je
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rexis schreef:
Waar is je
Ergens voor en na deze code emoDat kan je aan de inspringingen al zien.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren