Targetpay installeren

Gestart doorBartv27 reacties86 weergaven

28 berichten · pagina 1 van 2

Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik snap targetpay niet echt, ik heb een code gekregen, en daarmee opent een pop-up scherm van targetpay. Ik wil, als je betaald hebt, dat er dan punten worden bij geschreven. Hoe kan ik dit doen? Of is er nog een simpelere manier? het liefst wil ik net zoals op one2xs, maar ik weet niet hoe ik dit moet doen

Alvast bedankt!
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Via de TargetPay API kan je het net zoals o2xs doen.smile
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maar dan krijg je een pop-up enz.
Kan je een beetje codes enz geven? als voorbeeld? want ik snap er echt niks van
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nee, de API werkt niet met een popup. Codes staan op de pagina documentatie op de site van TargetPay.
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
heb nu dit:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]functions.php[/COLOR][COLOR= #007700]);[/COLOR]
up[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_auth[COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
?>
<script language="JavaScript">
function berekenpunten(eurie)
{
        
    return eurie;    
}
</script>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
* Wallie example!
* 
* SVE
* 
* 11-01-2009 
* 
*/[/COLOR]
[URL="http://www.php.net/ini_set"]ini_set[/URL] [COLOR= #007700]([/COLOR] [COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR] [COLOR= #DD0000]classes/TargetPayWallie.class.php[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #FF8000]// ====================================
# Set your rtlo here
# Ga naar https://www.targetpay.com/subaccounts   voor uw layoutcode (rtlo) 

# Stel hier uw layoutcode in
# Ga naar https://www.targetpay.com/subaccounts   voor uw layoutcode (rtlo) [/COLOR]
[COLOR= #0000BB]$iRtlo[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]58458[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]// ====================================[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaal[/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]ShoppingCartID[/COLOR][COLOR= #007700]])) {[/COLOR]  
    [COLOR= #FF8000]# To initiate a payment, initiate the class[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR] [COLOR= #007700]= new[/COLOR] TargetPayWallie [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$iRtlo[/COLOR] [COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]# Set wallie amount in cents so 500 cent will be 5 euro[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieAmount [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaal[/COLOR][COLOR= #007700]]));[/COLOR]

    [COLOR= #FF8000]# Set wallie description[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieDescription  [COLOR= #007700]([/COLOR] [COLOR= #DD0000]Dit is een test betaling[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]# Set return url, wich should return on succes[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieReturnUrl [COLOR= #007700]([/COLOR] [COLOR= #DD0000]http://mesite.nl/wallieExample.php[/COLOR] [COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]/**
    * OPTIONAL PARAMETERS FOR WALLIE
    * UNCOMMENT IF YOU WANT TO USE
    */[/COLOR]

    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieCountry [COLOR= #007700]([/COLOR] [COLOR= #DD0000]31[/COLOR] [COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Set the country   (optional)[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieLang [COLOR= #007700]([/COLOR] [COLOR= #DD0000]NL[/COLOR] [COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Set wallie language (optional)[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]setWallieCurrency [COLOR= #007700]([/COLOR] [COLOR= #DD0000]EUR [/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// Set wallie currency ( optional )

    # Now we can initiate the payment[/COLOR]
    [COLOR= #0000BB]$aReturn[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]startPayment[COLOR= #007700]();[/COLOR]

    [COLOR= #FF8000]# This is the transaction id[/COLOR]
    [COLOR= #0000BB]$intTrxId[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$aReturn[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR]

    [COLOR= #FF8000]# this will be the bank url that will rederect to the bank.[/COLOR]
    [COLOR= #0000BB]$strURL[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$aReturn[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]

    [COLOR= #FF8000]# For check we can echo it here. (uncomment if you want to see. )
    //echo Transaction ID: . $intTrxId . <br/>URL: . $strURL;

    # Rederect your user now to:[/COLOR]
    [URL="http://www.php.net/header"]header[/URL] [COLOR= #007700]([/COLOR] [COLOR= #DD0000]Location: [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$strURL[/COLOR] [COLOR= #007700]);
 }[/COLOR]

[COLOR= #FF8000]/**
* This function will validate the payment
* 
*/

# ?action=vtrxid= trxid [/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]ShoppingCartID[/COLOR][COLOR= #007700]] ) ) {[/COLOR]
    
    [COLOR= #FF8000]# Init the class[/COLOR]
    [COLOR= #0000BB]$oWallie[/COLOR] [COLOR= #007700]= new[/COLOR] TargetPayWallie [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$iRtlo[/COLOR] [COLOR= #007700]);[/COLOR]
    
    [COLOR= #FF8000]# Test mode? 1 = test mode, 0 = normal[/COLOR]
    [COLOR= #0000BB]$iTest[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #FF8000]# Once, only validate the payment once?[/COLOR]
    [COLOR= #0000BB]$iOnce[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]

    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$oWallie[/COLOR][COLOR= #007700]->[/COLOR]validatePayment [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ShoppingCartID[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$iOnce[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$iTest[/COLOR]  [COLOR= #007700]) ==[/COLOR] true [COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De betaling was geslaagd[/COLOR][COLOR= #007700];[/COLOR]   
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO wallies (euro, punten, af) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]", 1)"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden SET uPunten = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/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]De betaling was (nog) niet geslaagd[/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]<div class="content">Wallie betalen</div><div class="contentt">[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]]))
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]U moet wel wat invullen.<br />[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_int"]is_int[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<meta http-equiv="refresh" content="0;url=wallieExample.php?betaal=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]">[/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]<meta http-equiv="refresh" content="0;url=wallieExample.php?betaal=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hoeveel[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]00">[/COLOR][COLOR= #007700];
        }
    }
}[/COLOR]
?>
Alleen ronde getallen, wilt u dit niet? maak dan een ticket en dan handelen wij het af.<br />
<form name="wallie" method="post" action="#">
    <input type="text" name="hoeveel" 
        onkeydown="document.getElementById(punten).innerHTML=berekenpunten(this.value);"
        onkeyup="document.getElementById(punten).innerHTML=berekenpunten(this.value);"
        value="1"/> (&euro;<span id="punten">1</span> euro)<br />
    <input type="submit" name="submit" value="Betaal!">
</form>
</div>
[COLOR= #0000BB]<?php[/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]<div class="content">Wallie betalen</div><div class="contentt">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]U moet ingelogd zijn om punten te kopen.[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];
}[/COLOR]
foot[COLOR= #007700]();[/COLOR]
?>


Hoe kan ik het nu allemaal testen?
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Via database, gewoon via query betaalt of niet betaalt en punten bijschrijven
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@dasaque,
nee, ik wil het gewoon testen, dus vanaf 0 zegmaar.
Of als je hebt betaald, dat je dan ook echt je punten krijgt
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Staat in de class smile
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@dasaque,
beter uitleg aub?
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als je nou gewoon de documentatie doorleest... t Is zo simpel...
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@josnl,
heb ik al gedaan, maar ik snap het nog steeds niet
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Om de integratie voor u gemakkelijk te maken hebben we voor PHP 5 (en hoger) een aantal voorbeeld classes ontwikkeld. Hiermee integreert u alle betaalwijzen van TargetPay zeer eenvoudig in uw website. U hoeft de bestanden alleen maar te uploaden op uw server. Een uitgebreide handleiding is bijgesloten in het ZIP bestand.

https://www.targetpay.com/examples/TargetPayExampleClasses.zip

https://www.targetpay.com/ideal/start In die url zet je de parameters die je op de documentatiepagina ziet. (tabel 1)
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ja maar ik wil testen dat ik zegmaar betaal, en dat dan kijken we dan gebeurt, maar dan niet echt betalen.
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
public function validatePayment ( $intTrxId, $iOnce = 1, $iTest = 0 ) {


Dat staat in de ideal class moetje test even veranderen in 1
0
Tgrm

Lid

Berichten
2.133
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bartv schreef:
ja maar ik wil testen dat ik zegmaar betaal, en dat dan kijken we dan gebeurt, maar dan niet echt betalen.
# Test mode? 1 = test mode, 0 = normal
$iTest = 1;

^^ Dit staat toch in de code? :| Laat hem op 1
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