Wallie API

Gestart doorJvdw2 reacties84 weergaven

3 berichten · pagina 1 van 1

Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
he one2xs,
ik wil betalingen maken op mijn site.
Nu wil ik een Wallie API dat ik per script een Betaling heb, en dat na de betaling het bestand dat hij gekocht heeft download.
Zou mij iemand willen helpen?
0
Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mollie gebruiken smile
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Dit script een beetje ombouwen:
http://www.one2xs.com/wallieapi_o2x.rar
(Dit in example.php:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*******
 * Voorbeeldscript voor de werking met de Wallie API voor one2xs
 * Meer informatie: http://www.one2xs.com/wallieinfo
 * Versie        1.0.0
 * Copyright    one2apps 2010
 * Datum        15 juni 2010
 * Alle rechten voorbehouden.
 * Gebruik op eigen risico.
 * Misbruik wordt bestraft.
 ***
 * Dit is een voorbeeldscript; je bent vrij om je eigen draai aan het systeem te geven, op voorwaarde dat je je aan de regels houdt.
 * Succes ermee.
 **/[/COLOR]

[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]lennard[/COLOR][COLOR= #007700];[/COLOR]                                        [COLOR= #FF8000]// gebruikersnaam op one2xs voor wie gebeld moet worden[/COLOR]
[COLOR= #0000BB]$bedrag[/COLOR] [COLOR= #007700]= .[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700];[/COLOR]                                                [COLOR= #FF8000]// bedrag in euros; minimaal 0.10, maximaal 500.00; gebruik geen kommas maar punten[/COLOR]
[COLOR= #0000BB]$terugstuur[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://localhost/wallieapi_o2x/example.php[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// de url waar de gebruiker terug moet komen na de betaling[/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];[/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]transkey[/COLOR][COLOR= #007700]]))[/COLOR] [COLOR= #FF8000]// betaling voorbereiden als er geen transactiecode 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= #DD0000]init[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$terugstuur[/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/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]done[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]true[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv=Refresh content="0; URL=downloadlink">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
            
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is wat fout gegaan![/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// neem even contact op met de one2xs-support als dit verschijnt[/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= #FF8000]// als er wel een transactiecode is opgegeven: checken of die klopt[/COLOR]
[COLOR= #007700]{[/COLOR]
    
    [COLOR= #0000BB]$api[/COLOR] [COLOR= #007700]= new[/COLOR] api[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]volt[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$terugstuur[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// verwerking van de betaling[/COLOR]
    
    [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]addParam[COLOR= #007700]([/COLOR][COLOR= #DD0000]transkey[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]transkey[/COLOR][COLOR= #007700]]);[/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![/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 betaling is al eerder verwerkt.[/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]
?>


?)
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