bel api

Gestart doorKrm0 reacties63 weergaven

1 berichten · pagina 1 van 1

Krm

Lid · Topicstarter

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik wil dat als je betaald hebt dat je je link kan invullen en dat die link in de database word opgeslagen maar lukt me niet

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]layout.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Saldo kopen[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je link toevoegen in linkspel."[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]kerem[/COLOR][COLOR= #007700];[/COLOR]    [COLOR= #FF8000]// gebruikersnaam op one2xs voor wie gebeld moet worden[/COLOR]
[COLOR= #0000BB]$bedrag[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1.3[/COLOR][COLOR= #007700];[/COLOR]            [COLOR= #FF8000]// bedrag in euros; minimaal 0.25, maximaal 10.00; gebruik geen kommas[/COLOR]
[COLOR= #0000BB]$testmode[/COLOR] [COLOR= #007700]=[/COLOR] FALSE[COLOR= #007700];[/COLOR]        [COLOR= #FF8000]// testmodus aan? TRUE voor ja, FALSE voor nee. Bij TRUE krijg je geen punten bij je tegoed, maar kun je testen of je systeem goed werkt[/COLOR]
[COLOR= #0000BB]$land[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]nl[/COLOR][COLOR= #007700];[/COLOR]            [COLOR= #FF8000]// land waar de beller vandaan belt[/COLOR]

[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL] [COLOR= #DD0000]api.cls.php[/COLOR][COLOR= #007700];

function[/COLOR] format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700])[/COLOR] [COLOR= #FF8000]// functie om de bedragen (euros) netjes weer te geven (punten en kommas op de goede plek)[/COLOR]
[COLOR= #007700]{[/COLOR]
    
    [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/number_format"]number_format[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000],[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000].[/COLOR][COLOR= #007700]);
    
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telnr[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]]))[/COLOR] [COLOR= #FF8000]// betaling voorbereiden als er geen telnr en code is opgegeven[/COLOR]
[COLOR= #007700]{[/COLOR]
    
    [COLOR= #0000BB]$api[/COLOR] [COLOR= #007700]= new[/COLOR] api[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$land[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]init[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$testmode[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]// api instantie maken[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]doTransaction[COLOR= #007700]() ===[/COLOR] TRUE[COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]getMessages[COLOR= #007700]();[/COLOR] [COLOR= #FF8000]// berichten ophalen[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<b>Bellen met je mobiele telefoon</b><br />[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Bel naar <strong>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telnr[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</strong> en voer deze code in: <strong>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</strong>.<br />[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit kost je &euro; [/COLOR][COLOR= #007700].[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]per_eenheid[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] per [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]per[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] (totaal dus &euro; [/COLOR][COLOR= #007700].[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]). [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]extra[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a href="?telnr=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telnr[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&amp;code=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">Klik hier als je gebeld hebt.</a>[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #FF8000]// Je bent VERPLICHT om het servicenummer, de paycode, de prijs en de prijs per eenheid (bijvoorbeel 10 cent per minuut of 90 cent per gesprek) weer te geven
        // Zie http://www.one2xs.com/belapiinfo voor meer informatie.[/COLOR]
        
    [COLOR= #007700]}[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]API fout.[/COLOR][COLOR= #007700];
        
    }
    
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    
    [COLOR= #0000BB]$api[/COLOR] [COLOR= #007700]= new[/COLOR] api[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$land[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]volt[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$testmode[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// verwerking van de betaling[/COLOR]
    [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]addParam[COLOR= #007700]([/COLOR][COLOR= #DD0000]nr[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telnr[/COLOR][COLOR= #007700]]);[/COLOR]    [COLOR= #FF8000]// telnr waar naartoe gebeld is meegeven[/COLOR]
    [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]addParam[COLOR= #007700]([/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]]);[/COLOR]    [COLOR= #FF8000]// evenals de belcode[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]doTransaction[COLOR= #007700]() ===[/COLOR] TRUE[COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$ret[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]getMessages[COLOR= #007700]();[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt niet betaald.[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
        {[/COLOR]
        
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald! je kan nu je link toevoegen.[/COLOR][COLOR= #007700];
            
        
        }[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Deze code is al gebruikt in de testmodus.[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Onbekende fout. Neem contact op met de beheerders voor meer informatie.[/COLOR][COLOR= #007700];
            
        }
        
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]API fout.[/COLOR][COLOR= #007700];
        
    }
    
}[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
?>
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