Targetpay API op localhost

Gestart doorAzdin17 reacties16 weergaven

18 berichten · pagina 1 van 2

Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,

Ik heb nu een script alleen.. hij werkt wel op shared hosting, maar niet op xampp/IIS.. Dan krijg je deze error:

Quote:
HTTP-fout 500 (Internal Server Error): Er is een onverwachte voorwaarde gevonden toen de server het verzoek wilde uitvoer

Dit is het 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]TargetPayWallie.class.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]userid[/COLOR][COLOR= #007700]]))
{[/COLOR]
    ?>
    <form action="" method="get">
    Username<input type="text" name="userid" />
    <br />
    <input type="submit" value="Koop!" />
    </form>
    [COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$iRtlo[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]75901[/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] [COLOR= #0000BB]500[/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://www.dev.maartenlefever.be/test/wallieExample.php?userid=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/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]Je bent nu VIP[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET vip = 1 WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/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]
  
  
  
?>
0
Berichten
473
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Van xampp weet ik dat je het script niet kan onderbreken ( tenminste dacht ik ) met ?> dus dan moet je het in een echo zetten
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En met IIS dan?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Habbooo schreef:
Van xampp weet ik dat je het script niet kan onderbreken ( tenminste dacht ik ) met ?> dus dan moet je het in een echo zetten
Kan wel emo
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en dus niet met php ervoor.
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb t veranderd, maar dan krijg ik dit nu:

Quote:
An attempt was made to access a socket in a way forbidden by its access permissions.

ligt echt puur aan het script..raar
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Klinkt als een IP die bij TargetPay niet op de whitelist staat?
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nop, ik test het allemaal op localhost dus ja..
Ligt echt puur aan het script..
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En dan is er nog niets over de topictitel gezegd emo
0
Berichten
4.214
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Azdinnn schreef:
Heb t veranderd, maar dan krijg ik dit nu:

Quote:
An attempt was made to access a socket in a way forbidden by its access permissions.

ligt echt puur aan het script..raar
Laten staan dat
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Timmie schreef:
Eerdere citaten tonen
Azdinnn schreef:
Heb t veranderd, maar dan krijg ik dit nu:
Quote:
An attempt was made to access a socket in a way forbidden by its access permissions.

ligt echt puur aan het script..raar
Laten staan dat
Geen idee wat er mis moet zijn..alle andere PHP scripts op IIS localhost werken gewoon perfect, echt raar..
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Wat is de instelling van de fopen configuratie in PHP?

Is testen op Apache anders geen optie?
0
Berichten
5.952
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zou de oplossing niet weten maar bij mij werkte het op IIS gewoon hoor.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eens proberen door te linken met de meta tag ?

toevoeging op 8 mei 2012, 081342:
+ testmode staat aan sadley
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Doorlinken met de metatag? Dus als het een aanvraag is waar gebruikersgegevens in staan, heb jij het advies om deze door te verwijzen met een meta-tag? Als dit zo zou zijn ben ik blij dat je niet voor mij werkt. schaterschater
metatags staan in de source, dus trek je conclusies..
Ik zet in op de fopen() configuratie, of een firewall...
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