Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未在paypal sdk中找到CFC_Paypal_Coldfusion_Application.cfc - Fatal编程技术网

未在paypal sdk中找到CFC

未在paypal sdk中找到CFC,paypal,coldfusion,application.cfc,Paypal,Coldfusion,Application.cfc,我使用colfusion paypal SDK进行直接支付,链接如下: 我已将application.cfc文件粘贴到下面。我的问题是,每次我转到samples-->dodirectpayment.cfm并提交测试表单时,它都会声明“错误:找不到ColdFusion组件或接口CallerService”。我认为这与引用CallerService.cfc文件有关,但无法找出哪里出了问题。非常感谢您的帮助。application.cfc在这里 <cfscript> /** @dateC

我使用colfusion paypal SDK进行直接支付,链接如下:

我已将application.cfc文件粘贴到下面。我的问题是,每次我转到samples-->dodirectpayment.cfm并提交测试表单时,它都会声明“错误:找不到ColdFusion组件或接口CallerService”。我认为这与引用CallerService.cfc文件有关,但无法找出哪里出了问题。非常感谢您的帮助。application.cfc在这里

<cfscript>
/**
@dateCreated "July 18, 2011"
@hint "You implement methods in Application.cfc to handle ColdFusion application events and set variables in the CFC to configure application characteristics."
*/


component output="false" {

    /* **************************** APPLICATION VARIABLES **************************** */
    THIS.name = "NVPSample";
    THIS.applicationTimeout = createTimeSpan(0, 2, 0, 0);


    customtagpaths = "{#getDirectoryFromPath(ExpandPath('../lib/'))#,#getDirectoryFromPath(ExpandPath('../lib/services/'))#}";

    THIS.customTagPaths = customtagpaths; 

    THIS.serverSideFormValidation = true;
    THIS.sessionManagement = true;
    THIS.sessionTimeout = createTimeSpan(0, 0, 30, 0);

    THIS.setClientCookies = true;
    THIS.setDomainCookies = false;

    THIS.scriptProtect = true;
    THIS.secureJSON = false;
    THIS.secureJSONPrefix = "";


    THIS.enablerobustexception = true;


/* **************************** APPLICATION METHODS **************************** */

    public void function onApplicationEnd(struct ApplicationScope=structNew()) {

        return;
    }


    public boolean function onApplicationStart() {

        return true;
    }

    public void function onCFCRequest(required string cfcname, required string method, required string args) {

        return;
    }


    public void function onRequestEnd() {

        return;
    }


    public boolean function onRequestStart(required string TargetPage) {

        request.serverURL = "https://api-3t.sandbox.paypal.com/nvp";

        /* SUBJECT to be uncommented for UNIPAY all the other credentials like API username,
              password,signature can be commented for UNIPAY
              To enable Payments for Third Party Email whcih will be passed along with Partner's 3token credentials
              uncomment both subject and 3 token credentials.
       */


        request.SUBJECT="sales-facilitator@totalsportsadvantage.com"; 

        APIuserName = "sales-facilitator_api1.totalsportsadvantage.com";
        APIPassword = "1387466817";
        APISignature = "An5ns1Kso7MWUdW4ErQKJJJ4qi4-AMJWATXVSChE1ExjnH8FyoZD8U5Q";

        /*
         request.SUBJECT="clip_1309031681_biz@paypal.com"; 

        APIuserName = "clip_1309031681_biz_api1.paypal.com";
        APIPassword = "1309031732";
        APISignature = "AFcWxV21C7fd0v3bYYYRCpSSRl31An2lFbilAjH412uQjiC0OEJh45pL";
        */

        //condition to check if it is UNIPAY 
        if (isdefined("SUBJECT") && (isdefined("APIuserName") eq "false" && isdefined("APIPassword") eq "false" && isdefined("APISignature") eq "false") )
        {
            request.UNIPAYSUBJECT="#SUBJECT#"; 
            request.USER = "";
            request.PWD = "";
            request.SIGNATURE = "";
        }



        //condition to check if it is Payments for Third Party Email
        if (isdefined("SUBJECT") && isdefined("APIuserName") && isdefined("APIPassword") && isdefined("APISignature"))
        {
            request.UNIPAYSUBJECT="#SUBJECT#"; 
            request.USER = "#APIuserName#";
            request.PWD = "#APIPassword#";
            request.SIGNATURE = "#APISignature#";
        }


        //condition to check if it is 3 token credentials 
        if (isdefined("SUBJECT") eq "false" && isdefined("APIuserName") && isdefined("APIPassword") && isdefined("APISignature") )
        {
            request.UNIPAYSUBJECT=""; 
            request.USER = "#APIuserName#";
            request.PWD = "#APIPassword#";
            request.SIGNATURE = "#APISignature#";
        }


        request.PayPalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
        request.version = "65.1";

        /*
        By default the API requests doesn't go through proxy. To route the requests through a proxy server
            set "useProxy" value as "true" and set values for proxyName and proxyPort. Set proxyName with
        the Host Name or the IP address of the proxy server. proxyPort should be a valid port number.
        eg: 
        useProxy = "true";
        proxyName = "127.0.0.1";
        proxyPort = "8081";
        */

        request.useProxy = "false";
        request.proxyName = "";
        request.proxyPort = "";

        return true;
    }


    public void function onSessionEnd(required struct SessionScope, struct ApplicationScope=structNew()) {

        return;
    }


    public void function onSessionStart() {

        return;
    }

}
</cfscript>

/**
@创建日期“2011年7月18日”
@提示“您在Application.cfc中实现方法以处理ColdFusion应用程序事件,并在cfc中设置变量以配置应用程序特征。”
*/
组件输出=“false”{
/**************************************应用程序变量**********************************************/
THIS.name=“NVPSample”;
THIS.applicationTimeout=createTimeSpan(0,2,0,0);
customtagpaths=“{#getDirectoryFromPath(ExpandPath('../lib/'))#,#getDirectoryFromPath(ExpandPath('../lib/services/'))#}”;
THIS.customTagPaths=customTagPaths;
THIS.serverSideFormValidation=true;
THIS.sessionManagement=true;
THIS.sessionTimeout=createTimeSpan(0,0,30,0);
THIS.setClientCookies=true;
THIS.setDomainCookies=false;
THIS.scriptProtect=true;
THIS.secureJSON=false;
THIS.secureJSONPrefix=“”;
THIS.enablerobustexception=true;
/**************************************应用方法*************************************************/
ApplicationEnd上的公共void函数(struct ApplicationScope=structNew()){
返回;
}
ApplicationStart()上的公共布尔函数{
返回true;
}
公共void函数onCFCRequest(必需的字符串名称、必需的字符串方法、必需的字符串参数){
返回;
}
公共void函数onRequestEnd(){
返回;
}
公共布尔函数onRequestStart(必需的字符串TargetPage){
request.serverURL=”https://api-3t.sandbox.paypal.com/nvp";
/*UNIPAY所有其他凭证(如API用户名)的主题未注释,
UNIPAY的密码、签名可以注释
要启用第三方电子邮件付款,将随合作伙伴的3 Token凭证一起传递
取消对subject和3个令牌凭据的注释。
*/
request.SUBJECT=“销售-facilitator@totalsportsadvantage.com"; 
APIuserName=“sales-facilitator\u api1.totalsportsadvantage.com”;
APIPassword=“1387466817”;
APISignature=“an5ns1kso7mwudw4erqkjj4qi4-AMJWATXVSChE1ExjnH8FyoZD8U5Q”;
/*
request.SUBJECT=“clip_1309031681_biz@paypal.com"; 
APIuserName=“clip_1309031681_biz_api1.paypal.com”;
APIPassword=“1309031732”;
APISignature=“AFCWXV21C7FD0V3BYYRCPSSRL31AN2LFBILAJH412UQJIC0OEJH45PL”;
*/
//检查是否为UNIPAY的条件
如果(isdefined(“SUBJECT”)&&(isdefined(“APIuserName”)eq“false”&&isdefined(“APIPassword”)eq“false”&&isdefined(“APISignature”)eq“false”))
{
request.unipaypubject=“#SUBJECT#”;
request.USER=“”;
request.PWD=“”;
request.SIGNATURE=“”;
}
//检查是否为第三方电子邮件付款的条件
如果(已定义(“主体”)&&isdefined(“APIuserName”)&&isdefined(“APIPassword”)&&isdefined(“APISignature”))
{
request.unipaypubject=“#SUBJECT#”;
request.USER=“#APIuserName#”;
request.PWD=“#APIPassword#”;
request.SIGNATURE=“#APISignature#”;
}
//检查是否为3个令牌凭据的条件
if(已定义(“主体”)eq“false”&&isdefined(“APIuserName”)&&isdefined(“APIPassword”)&&isdefined(“APISignature”))
{
请求。UNIPAYSUBJECT=“”;
request.USER=“#APIuserName#”;
request.PWD=“#APIPassword#”;
request.SIGNATURE=“#APISignature#”;
}
request.PayPalURL=”https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-签出和令牌=“;
request.version=“65.1”;
/*
默认情况下,API请求不通过代理。要通过代理服务器路由请求
将“useProxy”值设置为“true”,并设置proxyName和proxyPort的值。将proxyName设置为
代理服务器的主机名或IP地址。proxyPort应该是有效的端口号。
如:
useProxy=“true”;
proxyName=“127.0.0.1”;
proxyPort=“8081”;
*/
request.useProxy=“false”;
request.proxyName=“”;
request.proxyPort=“”;
返回true;
}
公共void函数onSessionEnd(必需的结构会话范围,结构应用范围=structNew()){
返回;
}
公共无效函数onSessionStart(){
返回;
}
}

getDirectoryFromPath确实引用了这些文件的实际位置,但由于某些原因,应用程序无法在该位置找到它们。最终的解决方案是将这些文件复制到application.cfc文件所在的同一个文件夹中,一切正常。谢谢你的帮助

当我在您的代码示例中搜索callerservice.cfc时,我也找不到它。它是我链接到的SDK的/lib/services文件夹中的一个自定义标记。您通过这种方式或疑难解答做了什么?Does
getDirectoryFromPath(ExpandPath('../lib/services/'))
从您浏览的文件的角度解析这些文件的实际位置?getDirectoryFromPath确实引用了这些文件的实际位置,但由于某些原因,应用程序无法在该位置找到它们。最终的解决方案是将这些文件复制到application.cfc文件所在的同一个文件夹中,一切正常。谢谢你的帮助。你能让它工作很好,但我认为这不重要