using PayPal.API requires a DLL Reference. What is that DLL name, and where can I find it.

PastorBurt
Contributor
Contributor

I have had experience with the old API, but I did that likely 8 years ago, to the point where it so long ago I hardly remember it, although one of my sites is still using it.   I've looked at my old code, and I agree the old API was very primitive, but I was able to get the job done.   The new API is C# and this I understand.   This sample code to me looks beautiful:

 

using PayPal.Api;

// Authenticate with PayPal
var config = ConfigManager.Instance.GetProperties();
var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);

// Make an API call
var payment = Payment.Create(apiContext, new Payment
{
    intent = "sale",
    payer = new Payer
    {
        payment_method = "paypal"
    },
    transactions = new List<Transaction>
    {
        new Transaction
        {
            description = "Transaction description.",
            invoice_number = "001",
            amount = new Amount
            {
                currency = "USD",
                total = "100.00",
                details = new Details
                {
                    tax = "15",
                    shipping = "10",
                    subtotal = "75"
                }
            },
            item_list = new ItemList
            {
                items = new List<Item>
                {
                    new Item
                    {
                        name = "Item Name",
                        currency = "USD",
                        price = "15",
                        quantity = "5",
                        sku = "sku"
                    }
                }
            }
        }
    },
    redirect_urls = new RedirectUrls
    {
        return_url = "http://mysite.com/return",
        cancel_url = "http://mysite.com/cancel"
    }
});

I don't need any convincing to know that this above is exactly what I want to do.    The most important line of code for me is the "using PayPal.Api" because this using statement obviously is the key to writing code for the new API.

 

To use "using PayPal.Api"  my training tells me that I have to REFERENCE to the DLL that defines this PayPal library.    As of yet I have not discovered what the name of that DLL is.   I searched the PayPal-Net-SDK-2.0.0.0-rc2 and basically only found one apparently useful DLL, Source.Dll.   But Source.dll seemes to be for PayPal.Core, which I don't think is likely what I want or need.   The approach I hope to produce is essentially a modern Express Checkout using the new API.

 

So to start with, what is the name of the PayPal.Dll that is required a reference or PayPal.Api????    If it is not in the  PayPal-Net-SDK-2.0.0.0-rc2 , what is the name and URL that I have to go to download these resource?   I am using VS2018, and my user interfacing will be ASP.Net, with C# as the language.

 

Realize that I have not written 1 line of the new PayPal C# interfacing code.   I have defined my first application, acquired the Client ID, and Client Secret and put it into an almost empty Web.Config., but to do anything more I have to reference that PayPal.Api in a using statement.   Please tell me where what the name is of that DLL I have to reference, and where do I get it for my project.

 

 

Sincerely, 

Pastor Burt

 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.