NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
FTP/SSL support


Joined: 30 Nov 2007
Posts: 2
Reply with quote
Hello,

Im thinking about purchasing phpED, and i am wondering what version is right for me.

Im not a coder, and im just looking to play around, however i was planning on taking a look at a PHP and the built in SOAP tools.

I notice that the standard version says that its does'nt have FTP/SSL support, so this mean that OPENSSL will not work with it?


Thanks


Mike
View user's profileFind all posts by m82palmerSend private message


Joined: 30 Nov 2007
Posts: 2
Reply with quote
Is there a way of configuring the trial to act as the Standard version?


Here is the code that i wish to run that uses SOAP and Open SSL.


Code:

<?php

// Before using this example, replace the generic values with you own merchant ID and password.
define( 'MERCHANT_ID', 'your_merchant_id' );
define( 'TRANSACTION_KEY', 'your_transaction_key' );
define( 'WSDL_URL', 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl' );


class ExtendedClient extends SoapClient {

   function __construct($wsdl, $options = null) {
     parent::__construct($wsdl, $options);
   }

// This section inserts the UsernameToken information in the outgoing SOAP message.
   function __doRequest($request, $location, $action, $version) {

     $user = MERCHANT_ID;
     $password = TRANSACTION_KEY;
     
     $soapHeader = "<SOAP-ENV:Header xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><wsse:Security SOAP-ENV:mustUnderstand=\"1\"><wsse:UsernameToken><wsse:Username>$user</wsse:Username><wsse:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">$password</wsse:Password></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header>";

     $requestDOM = new DOMDocument('1.0');
     $soapHeaderDOM = new DOMDocument('1.0');

     try {

         $requestDOM->loadXML($request);
    $soapHeaderDOM->loadXML($soapHeader);

    $node = $requestDOM->importNode($soapHeaderDOM->firstChild, true);
    $requestDOM->firstChild->insertBefore(
            $node, $requestDOM->firstChild->firstChild);

         $request = $requestDOM->saveXML();

    printf( "Modified Request:\n*$request*\n" );

     } catch (DOMException $e) {
         die( 'Error adding UsernameToken: ' . $e->code);
     }

     return parent::__doRequest($request, $location, $action, $version);
   }
}

try {
   $soapClient = new ExtendedClient(WSDL_URL, array());

   /*
   To see the functions and types that the SOAP extension can automatically
    generate from the WSDL file, uncomment this section.
   $functions = $soapClient->__getFunctions();
   print_r($functions);
   $types = $soapClient->__getTypes();
   print_r($types);
   */

        $request = new stdClass();
   
   $request->merchantID = MERCHANT_ID;
   
   // Before using this example, replace the generic value with you own.
   $request->merchantReferenceCode = "your_merchant_reference_code";

   // To help us troubleshoot any problems that you may encounter,
    // please include the following information about your PHP application.
   $request->clientLibrary = "PHP";
        $request->clientLibraryVersion = phpversion();
        $request->clientEnvironment = php_uname();

   // This section contains a sample transaction request for the authorization
    // service with complete billing, payment card, and purchase (two items) information.   
   $ccAuthService = new stdClass();
   $ccAuthService->run = "true";
   $request->ccAuthService = $ccAuthService;

   $billTo = new stdClass();
   $billTo->firstName = "John";
   $billTo->lastName = "Doe";
   $billTo->street1 = "1295 Charleston Road";
   $billTo->city = "Mountain View";
   $billTo->state = "CA";
   $billTo->postalCode = "94043";
   $billTo->country = "US";
   $billTo->email = "null@cybersource.com";
   $billTo->ipAddress = "10.7.111.111";
   $request->billTo = $billTo;

   $card = new stdClass();
   $card->accountNumber = "4111111111111111";
   $card->expirationMonth = "12";
   $card->expirationYear = "2020";
   $request->card = $card;

   $purchaseTotals = new stdClass();
   $purchaseTotals->currency = "USD";
   $request->purchaseTotals = $purchaseTotals;

   $item0 = new stdClass();
   $item0->unitPrice = "12.34";
   $item0->quantity = "2";
   $item0->id = "0";   

   $item1 = new stdClass();
   $item1->unitPrice = "56.78";
   $item1->id = "1";

   $request->item = array($item0, $item1);

   $reply = $soapClient->runTransaction($request);
   
   // This section will show all the reply fields.
   var_dump($reply);

   // To retrieve individual reply fields, follow these examples.
   printf( "decision = $reply->decision\n" );
   printf( "reasonCode = $reply->reasonCode\n" );
   printf( "requestID = $reply->requestID\n" );
   printf( "requestToken = $reply->requestToken\n" );
   printf( "ccAuthReply->reasonCode = " . $reply->ccAuthReply->reasonCode . "\n");
} catch (SoapFault $exception) {
   var_dump(get_class($exception));
   var_dump($exception);
}
?>
View user's profileFind all posts by m82palmerSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7881
Reply with quote
Quote:
its does'nt have FTP/SSL support, so this mean that OPENSSL will not work with it?

it will work.
what you need is enable corresponding php extension in php.ini (namely php_openssl.dll)
Standard version does not impose any limitations on php.

Quote:
Is there a way of configuring the trial to act as the Standard version?

no yet.
but if your code shown aboev works in trial version, it will definitely work in standard too.
Generally speaking, what "Standard" version imposes is limitation on how you can debug your scripts. You can't do it remotely.
Also it provides only FTP protocol for publishing your scripts to live sites while PRO version supports FTP, SFTP and WebDAV.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
FTP/SSL support
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic