Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.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 使用“时如何获取安全令牌”;托管签出页面“;和RestApiSDK-ASP.Net_Paypal_Gateway - Fatal编程技术网

Paypal 使用“时如何获取安全令牌”;托管签出页面“;和RestApiSDK-ASP.Net

Paypal 使用“时如何获取安全令牌”;托管签出页面“;和RestApiSDK-ASP.Net,paypal,gateway,Paypal,Gateway,在使用“托管签出页面”时,是否可以使用RestApiSDK获取安全令牌?如果是,请举例说明。(C#首选。) 此处第31页描述了我所指的安全令牌: 请注意,我没有使用“快速结帐”。(在PayPal文档中,旧的PayPal产品和新产品之间存在很多混淆。) 我在StackOverflow上发现的一个示例存在以下问题: 指向SDK和文档的链接已失效。 DOSecureTokenAuth.cs文件在我能找到的任何SDK或示例中都不存在。 在本例中,作者无法从源文件复制代码。 谢谢,, 卡盘目前不可能

在使用“托管签出页面”时,是否可以使用RestApiSDK获取安全令牌?如果是,请举例说明。(C#首选。)

此处第31页描述了我所指的安全令牌:

请注意,我没有使用“快速结帐”。(在PayPal文档中,旧的PayPal产品和新产品之间存在很多混淆。)

我在StackOverflow上发现的一个示例存在以下问题: 指向SDK和文档的链接已失效。 DOSecureTokenAuth.cs文件在我能找到的任何SDK或示例中都不存在。

在本例中,作者无法从源文件复制代码。

谢谢,,
卡盘

目前不可能。REST API不支持托管的签出付款方法。REST流程允许PayPal交易(非常类似于快速结帐)和信用卡支付(您将账单信息传递给PayPal进行验证)

您提到的帖子--是针对Payflow SDK的,Payflow不支持REST。

请查看此帖子

或者你可以使用

           payflow_dotnet.dll
请查看payflow_dotnet.dll的此代码

 public void CreateAuthorization()
    {
// Create the Payflow  Connection data object with the required connection details.
        // The PAYFLOW_HOST property is defined in the webconfig
        PayflowConnectionData Connection = new PayflowConnectionData();

         // Create Invoice
        Invoice Inv = new Invoice();

        // Set Amount
        Currency Amt = new Currency(new decimal(premiumAmount), "USD");

        //adding the amount to invoice
        Inv.Amt = Amt;

 //creating a new express check out request
        ExpressCheckoutRequest currRequest = new ECSetRequest(WebConfigkeys.ReturnToApplication, WebConfigkeys.ReturnToApplication);

        PayPalTender currTender = new PayPalTender(currRequest);

        //creating a new transaction
        SaleTransaction currTransaction = new SaleTransaction(User, Connection, Inv, currTender, PayflowUtility.RequestId);

        //submitting the transaction and accepting the response message
        Response Resp = currTransaction.SubmitTransaction();

 if (Resp != null)
        {
            TransactionResponse TrxnResponse = Resp.TransactionResponse;
            ExpressCheckoutResponse eResponse = Resp.ExpressCheckoutSetResponse;
            if ((TrxnResponse != null) && (eResponse != null))
            {
              eResponse.Token;//get your token
            }

        }

}
将此添加到Web配置