Paypal API:获取订单列表

时间:2019-01-27 05:21:15

标签: c# paypal

因此,我试图根据某些日期之间从Paypal发出的订单来获取必须交付的物品清单。我在贝宝开发人员文档中找不到任何解决方案或解释。

因此,我在一周内使用“这里的Paypal”接收POS付款。如果您愿意的话,我基本上想获得一份订单清单(令我惊讶的是,贝宝​​没有为此提供API调用)。订单清单是指客户清单以及每个客户已订购的商品清单(购物车)。我相信“贝宝(Paypal)在这里”会将所有订单视为发票。

因此,经过大量研究,我从api中获得了发票清单。但是,所有发票均不包含购物车信息(已订购的商品)。我将不胜感激任何建议或帮助。

配置文件--->

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <!--<startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>-->
    <configSections>
      <section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
    </configSections>

    <!-- PayPal SDK settings -->
    <paypal>
      <settings>
        <add name="mode" value="live" />
        <add name="clientId" value=" client id" />
        <add name="clientSecret" value="client Secret" />
      </settings>
    </paypal>
</configuration>

C#代码--->

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PayPal.Api;

namespace PaypalConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Authenticate with PayPal
            var config = ConfigManager.Instance.GetProperties();
            var accessToken = new OAuthTokenCredential(config).GetAccessToken();
            var apiContext = new APIContext(accessToken); 
            var test = Invoice.GetAll(apiContext, pageSize: 10, totalCountRequired: true); 
        }
    }
}

更新: 链接到SDK-> https://github.com/paypal/PayPal-NET-SDK

0 个答案:

没有答案
相关问题