
We provide both examples PHP web pages for form integration and the test cases for demostrating direct API usage.
1. PHP web pages are for FORM INTEGRATION which must be deployed on PHP web server.
2. Testcases are for DIRECT API integeration and can be run by PHPUNIT after you install composer

Here are directory instructions:
----
   |--examples
     |
     | -- example_data.php
     |	    Containing the common settings for the examples, such as: merchant id, password, etc.
     | -- forms
     |	    Containing the sample php files for integration mode: iframe(js.php)/redirect(redirect.php)/hostedpaypage(hostedpayment.php) 			
     | -- tests
            Containing test cases for DIRECT API.

To run the FORM INTEGERATION, please put the folder into your web server and access the below URL: 
    a. Iframe integeration  - http://YOUR_DOMAIN/YOUR_CONTEXT_PATH/examples/forms/js.php
    b. Redirect integration - http://YOUR_DOMAIN/YOUR_CONTEXT_PATH/examples/forms/redirect.php 	 
    c. Hostedpayment Integeration - http://YOUR_DOMAIN/YOUR_CONTEXT_PATH/examples/forms/hostedpayment.php 
    
    
To run testcases from local, please refer to the below instructions:
    a. Install composer
    b. Open up command line and change to currenct dir, then run composer install
    c. Before run the test cases, you must make sure your IP is whitelisted by the payment gateway. You can check this by running:
    	.\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\IpCheck.php
 	   If you see OK at the end, then it's ready to run other testcases. Otherwise, please check the detail message.
 	d. Run the test suites by performing:  .\vendor\bin\phpunit

	1. How to run CAPTURE testcase?    
        a. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\SampleAuthData.php from command line, this will generate [data.txt] file'
	    b. Open up [data.txt] file, copy the value of the redirectionUrl field, access it in browser, then click [Success] button
	    c. Open up [data.txt] file, copy the value of the merchantTxId  field, assign it to the variable [$originalMerchantTxId]
	    d. Uncomment the statements block in CaptureTest.php
	    e. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\CaptureTest.php from command line
	    f. Verify the result. If there's any error occurs or the testcase fails, change [$enableLog] to [true] in IpgBaseTest.php to see more details.
	    
	2. How to run VOID testcase?    
        a. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\SampleAuthData.php from command line, this will generate [data.txt] file'
	    b. Open up [data.txt] file, copy the value of the redirectionUrl field, access it in browser, then click [Success] button
	    c. Open up [data.txt] file, copy the value of the merchantTxId  field, assign it to the variable [$originalMerchantTxId]
	    d. Uncomment the statements block in VoidTest.php
	    e. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\VoidTest.php from command line
	    f. Verify the result. If there's any error occurs or the testcase fails, change [$enableLog] to [true] in IpgBaseTest.php to see more details.
	       
	    
	3. How to run GET_STATUS testcase?    
        a. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\SampleAuthData.php from command line, this will generate [data.txt] file'
	    b. Open up [data.txt] file, copy the value of the redirectionUrl field, access it in browser, then click [Success] button
	    c. Open up [data.txt] file, copy the value of the merchantTxId  field, assign it to the variable [$originalMerchantTxId]
	    d. Uncomment the statements block in StatusCheckTest.php
	    e. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\StatusCheckTest.php from command line
	    f. Verify the result. If there's any error occurs or the testcase fails, change [$enableLog] to [true] in IpgBaseTest.php to see more details.
	    
	    
	4. How to run REFUND testcase?    
        a. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\SamplePurchaseData.php from command line, this will generate [purchasedata.txt] file'
	    b. Open up [purchasedata.txt] file, copy the value of the redirectionUrl field, access it in browser, then click [Success] button
	    c. Open up [purchasedata.txt] file, copy the value of the merchantTxId  field, assign it to the variable [$originalMerchantTxId]
	    d. Uncomment the statements block in RefundTest.php
	    e. Run .\vendor\bin\phpunit --bootstrap .\vendor\autoload.php .\tests\RefundTest.php from command line
	    f. Verify the result. If there's any error occurs or the testcase fails, change [$enableLog] to [true] in IpgBaseTest.php to see more details.
       
           
        