PHP code example of smart2pay / sdk-php

1. Go to this page and download the library: Download smart2pay/sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smart2pay / sdk-php example snippets


        if( !defined( 'S2P_SDK_SITE_ID' ) )
            define( 'S2P_SDK_SITE_ID', 'SiteID_of_your_Integration_Site' );
    

        if( !defined( 'S2P_SDK_API_KEY' ) )
            define( 'S2P_SDK_API_KEY', 'APIKey_of_your_Integration_Site' );
    

        if( !defined( 'S2P_SDK_ENVIRONMENT' ) )
            define( 'S2P_SDK_ENVIRONMENT', 'test' ); // live or test
    

        if( !defined( 'S2P_SDK_CUSTOM_BASE_URL' ) )
            define( 'S2P_SDK_CUSTOM_BASE_URL', '' );
    

        if( !defined( 'S2P_SDK_PAYMENT_RETURN_URL' ) )
            define( 'S2P_SDK_PAYMENT_RETURN_URL', 'https://www.myshop.com/sdk/samples/_return.php' );