/var/www/hkosl.com/imusiccircle/paypal/Configuration.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

    
class Configuration
    
{
        
// For a full list of configuration parameters refer in wiki page (https://github.com/paypal/sdk-core-php/wiki/Configuring-the-SDK)
        
public static function getConfig()
        {
            
$config = array(
                
// values: 'sandbox' for testing
                //           'live' for production
                //         'tls' for testing if your server supports TLSv1.2
                
"mode" => "sandbox",
                
// TLSv1.2 Check: Comment the above line, and switch the mode to tls as shown below
                // "mode" => "tls"

                
'log.LogEnabled' => true,
                
'log.FileName'   => '../PayPal.log',
                
'log.LogLevel'   => 'FINE'

                
// These values are defaulted in SDK. If you want to override default values, uncomment it and add your value.
                // "http.ConnectionTimeOut" => "5000",
                // "http.Retry" => "2",
            
);
            return 
$config;
        }

        
// Creates a configuration array containing credentials and other required configuration parameters.
        
public static function getAcctAndConfig()
        {
            
$result self::getConfig();
            if (
$result["mode"] == "live") {
                
$config = array(
                    
// Signature Credential
                    
"acct1.UserName"  => "jb-us-seller_api1.paypal.com",
                    
"acct1.Password"  => "WX4WTU3S8MY44S7F",
                    
"acct1.Signature" => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy",
                );
            } else if (
$result["mode"] == "sandbox") {
                
$config = array(
                    
// Signature Credential
                    
"acct1.UserName"  => "gsell_1323239795_biz_api1.onesolution.com.hk",
                    
"acct1.Password"  => "1323239817",
                    
"acct1.Signature" => "AFcWxV21C7fd0v3bYYYRCpSSRl31A2Ni4PMlMO01P84TBKRiL0XIEELh",
                );
            }

            return 
array_merge($configself::getConfig());
        }

    }