introduction to paypal for c# - asp

Upload: aspintegration

Post on 03-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Introduction to PayPal for C# - ASP

    1/15

    home quick answers discussions features community help Search for articles, questions, tips

    Articles Web Development E-commerce General

    Article

    Browse Code

    Bugs / Suggestions

    Stats

    Revisions (11)

    Alternatives

    Comments (164)

    View this article'sWorkspace

    Fork this Workspace

    Add your ownalternative version

    About Article

    Type Article

    Licence CPOL

    First Posted 7 Oct 2009

    Views 483,724

    Downloads 26,156

    Bookmarked 464 times

    , +

    Related ArticlesSAPrefs - Netscape-likePreferences Dialog

    XNA Snooker Club

    Baboon Framework : ARevolutionary WPF Framework

    Predrag Tomasevic , 6 Nov 2009 Rate:

    Introduction to PayPal for C# - ASP.NET developers

    An overview that presents all PayPal integration options, targeted especially at C# developers.

    Is your email address OK? You are s igned up for our newsletters but your email address is eitherunconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmationemail sent so we can confirm your email address and start sending you newsletters again. Alternatively,

    you can update your subscriptions .

    Download source - 166 KB

    IndexPayPal IntroductionGetting Started with PayPalSetting up a Test AccountWebsite Payments Standard (HTML)PostPayment processing

    AutoReturnDirect Payment (PDT)

    Instant Payment Notification (IPN)PayPal API

    Express CheckoutDirect Payment (Website Payments Pro)

    ConclusionHistory

    IntroductionPayPal is probably one of the first things that gets mentioned once you start discussion on online payments. Its notso without reason in 2008, PayPal moved over 60 billion dollars between accounts which is, youll agree, arespectable amount. And also, all trends show that this growth will continue with huge number of new accounts

    (over 184 million accounts in 2008 compared to 96.2 million in 2005), with a new platform named PayPal X, and withmore cool applications that involve paying (like Twitpay), you can bet that PayPal is here to stay. So, how can you jointhe whole PayPal Development movement?

    Unfortunately, I would say not so easily. When I first started with PayPal integration - it was hard, really hard. If youwish to see what I mean, just jump to the PayPal Developer Center . There is no way youll easily fish out what youneed from that site if you are a PayPal newbie; simply - there are too many links, too many resources, and too manymixings of important and not-so-important information. So, how should you start?

    Getting Started with PayPalTo those who really want to get into PayPal, and are willing to shell out some buck, I would recommend the ProPayPal E-Commerce book - thats how I eventually got into understanding the concepts behind PayPal integration.For those who are not so eager to pay dont worry, thats why this article is here... I'll go over most of the stuff that

    4.93 (182 votes)

    .NET2.0 C#1.0

    C#2.0 .NET3.0

    C#3.0 .NET3.5ASP.NET XML

    Architect Dev

    Sign up for our free weekly Web Developer Newsletter .

    articles

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    2/15

    that will Save You Time andEffort

    WPF: A* search

    DNS.NET Resolver (C#)

    Windows 7 / VS2010 demo app

    Plotting Circular RelationshipGraphs with Silverlight

    Window Tabs (WndTabs)Add-In for DevStudio

    WPF: If Carlsberg did MVVMFrameworks: Part 3 of n

    WPF Localization Using RESXFiles

    Multi-line InputBox control -MC++

    Namespace extensions - theundocumented W indows Shell

    WTL for MFC Programmers,Part IX - GDI Classes, CommonDialogs, and Utility Classes

    Open a command promptanywhere.

    OLE DB - First steps

    Creating alternate GUI usingVector Art

    DSLs: A Deep(ish) lookRemoting ManagementConsole

    Nullsoft Winamp Plug-in WithBitmapped UI, Docking andRestrictive Resizing

    Introduction to D3DImage

    The Complete Idiot's Guide toWriting Shell Extensions - PartVI

    Related Research

    How to Apply Changes to YourDB2 Database with Minimal Risk

    Toad Oracle: Discover the Top10 Most Useful Toad Features

    Data Modeling for EffectiveData Warehousing and Business

    Intelligence

    book covers, but in a more brief and concise manner.

    First and foremost - understanding what kinds of integration PayPal offers is, I would say, the most important thing inorder to successfully start your development journey. A common mistake, that happened to me also, is to start atonce with the PayPal API and Express Checkout. I mean its natural - we are developers, and when they tell us tointegrate with something, the first thing we look for is the SDK & API the PayPal API comes up as a result we sayThats it to ourselves and start working. The problem is the majority of payment scenarios can be handled with away simpler approach - HTML forms that are part of the Website Payments Standard.

    So, without further ado, here is a classification of PayPal integrations:

    Website Payments Standard (HTML)Postpayment Processing

    AutoReturnPayment Data Transfer (PDT)Instant Payment Notification (IPN)

    PayPal API

    Express CheckoutDirect Payment (Website Payments Pro)

    Payflow Gateway

    Items in classification are also ordered in a way I would suggest for everyone to follow. So, if you are new to PayPal first learn all of the options that you have with the Website Payments Standard (HTML). Then, if you need to addsome basic post-payment processing, see if Auto-Return or PDT will solve your problem if not, IPN is a more robustoption you have at your disposal.

    The next level would involve the PayPal API and implementing the Express Checkout, which is the most flexiblePayPal integration solution. And finally, if you long for the ability to directly process credit cards on your website,youll pay a monthly fee to PayPal and implement Direct Payment (effectively getting what is called WebsitePayments Pro).

    The last item from our classification - the Payflow Gateway is, on the other hand, a different beast. It doesnt updatethe stack in a way the previously mentioned technologies do. It is a solution aimed specifically at those businessesthat have/want an Internet Merchant Account (IMA) and just need the payment gateway. In order to keep the articleconsistent, Ill skip explaining the details of the Payflow Gateway. However, if you have any questions related to it, feelfree to leave a message in the comments section and Ill try to answer.

    That said, lets get to setting up a test PayPal account, and then well delve deeper into describing the mentionedintegrations.

    Setting up a Test AccountWord of notice youll want to follow this step even if you already have a live PayPal account. There are two reasonsfor using test accounts:

    you dont want to test and play with real moneyyou want to have access to different types of PayPal accounts

    Personal account most people have these; just an account that allows you to use PayPal when payingfor stuff online. Theoretically, you can use a Personal account to accept money; just know that youll beseverely constrained there is a $500 receiving limit per month, and you are only able to accept onetime payments using the Website Payments Standard (HTML). The big advantage of a Personal accountis that you dont need to pay any transaction fee when receiving money. Note, however, that if youreceive more than $500 in one month, youll be prompted to either upgrade to a Premier/Businessaccount or reject the payment.Premier account step up from a personal account; for anyone who wants to run a personal onlinebusiness. This type of account has all of the integration options (accepting credit cards, recurringpayments, PayPal API). However, most people skip directly from Personal to Business account as Premieraccount has the same transaction fees (in most cases, 2.9% + $0.30 per transaction) while lackingreporting, multi-user access, and other advanced merchant services of the Business account.Business account it has all of the features of the Premier account plus a few more (ability to operateunder your businesss name is one of them). If you are developing a website that needs to acceptpayments in 99% of situations, youll go with this type of account.

    To start, visit the PayPal Sandbox and sign-up for a new account. The process is straightforward, and most developersshould have no trouble finishing it. However, here are the pictures that will help you navigate through the process:

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    3/15

    How to Do a Big Data Project

    Signing up for a Sandbox account

    Filling in the details of your Sandbox account

    Once done with entering the details for your Sandbox account, you'll need to check the email you provided in orderto complete the registration. After that, you'll be able to login and start creating Sandbox PayPal accounts. Clickingon Test Accounts (menu on the left), and then Create Account: Preconfigured - will get you a form like the one onthe image below:

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    4/15

  • 8/11/2019 Introduction to PayPal for C# - ASP

    5/15

    Login to use the PayPal Sandbox features

    Website Payments Standard (HTML)In this section, I'll provide you with a number of examples that will show how to create your own HTML form forreceiving money over PayPal. You'll see how to use different variables in order to influence payment details. Beforewe delve into details, let's take a look at the two most basic variables:

    form's attribute - in most cases, it should be https://www.paypal.com/cgi-bin/webscr . If you are usingSandbox for testing payments, you'll change it to https://www. sandbox. paypal.com/cgi-bin/webscr -effectively, you just insert the word sandbox into the URL (this is also true for some other integrations; e.g., thePayPal API). For upcoming examples, I won't be using the Sandbox URL because most of you would just getthat "Login to use the PayPal Sandbox features" sc reen (look up for the image).form's business child - I'll use [email protected] for most examples; if you copy-paste thecode, you'll want to replace that with the email of your PayPal account.

    Basic Payment

    OK, lets say you have an opened PayPal account and you just wish to be able to accept a $10 payment for a paintingyou are selling through your site. Jus t insert the following HTML into your page and you are set to go:

    Collapse | Copy Code

    < =" :// . . / / " =" ">

    < =" " =" " =" " /> < =" " =" " =" @ . " />

    < =" " =" " ="M " /> < =" " =" " ="10.00" />

    < =" " ="B !" />

    Shipping & Handling

    The next thing that comes to mind is that you'll wish to add shipping and/or handling fees to your form. It's easy - just add more parameters:

    Collapse | Copy Code

    < =" :// . . / / " =" ">

    < =" " =" " =" " /> < =" " =" " =" @ . " />

    < =" " =" " ="M " /> < =" " =" " ="10.00" />

    < =" " ="B !" />

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    6/15

  • 8/11/2019 Introduction to PayPal for C# - ASP

    7/15

    Recurring Payments

    If you are selling a monthly service rather than a product, you'll be interested in the recurring payment options PayPalprovides. Again, it's playing with different variables that have different meaning. Let's say you wish to set a 3 day freetrial after which the user will have to pay you $10.00 per month to keep using the service. The following HTML formshould do the trick:

    Collapse | Copy Code

    < =" :// . . / / " =" "> < =" " =" " =" "/>

    < =" " =" " =" @ . "/> < =" " =" " =" "/> < =" " =" !" />

    < =" " =" 1" ="0"/> < =" " =" 1" ="3"/> < =" " =" 1" ="D"/> < =" " =" 3" ="10.00"/> < =" " =" 3" ="1"/> < =" " =" 3" ="M"/> < =" " =" " ="1"/> < =" " =" " ="0"/> < =" " =" " ="1"/>

    HTML Variables & Resources

    After reading the previous example, you may be wondering what certain variables do (a1? p1? srt?). Luckily, PayPalprovides an " HTML Variables for Website Payments Standard " page on which you can read about any variable thatyou are interested in.

    Also, another great resource (to which I wish someone pointed me when I first started with PP integration) is " skier'sPayPal examples ". You'll find examples for almost all payment scenarios you can think of - so instead of clutteringthis article with more examples, I'll encourage you to visit that page should you wish to implement some moreadvanced PayPal HTML form.

    PostPayment ProcessingWhen you setup your PayPal HTML form, the first question you'll probably ask is - after user pays, can I have somepost-payment processing logic? It is not so without reason; there are numerous post-payment scenarios we can thinkof - from sending a simple "Thank you" email to updating the site database and allowing user access to restrictedresources for which he paid. Depending on your knowledge and the desired level of robustness for post-processing

    logic, there are three ways you can go; and the good thing is you can combine them.

    AutoReturn

    AutoReturn is the simplest PostPayment processing solution that you have - after the user pays, he is automatically* redirected to a specified page on your website on which you can display some confirmation text. If you carefully wentthrough "HTML Variables for Website Payments Standard", you know that you can use a return variable to specify theAutoReturn URL in the HTML form. If you wish to have the default AutoReturn URL, follow these steps:

    Log in to your Premier or Business account1.Click the Profile subtab2.Click the Website Payment Preferences in the Selling Preferences column3.Click the On radio button next to the Auto Return label4.Enter the URL where you want your users to return in the text box labeled Return URL5.Click the Save button at the bottom of the page6.

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    8/15

    Providing the AutoReturl URL in your PayPal profile

    Know that if you have both AutoReturn URL in your profile and provide a return variable in your HTML form, thereturn variable will overwrite the profile URL value.

    Now, when your return page is hit, you'll be getting variables that should allow you to c ustomize the page display and

    log payment:

    - Transaction ID - Payment status

    - Payment amount - Currency code

    Before closing this section, one more thing. The reason why I've italicized the word "automatically" in the firstsentence is: if the user uses a credit card to pay you, he won't be automatically redirected to your return URL; he'llrather need to click on the "Return to Merchant" button. If this sounds weird to you, know that you're not alone ;however, because of legal issues, PayPal refused and still refuses to change the way credit card payments are handledwith AutoReturn.

    Payment Data Transfer (PDT)

    After looking over the list of variables tha t AutoReturn provides, you probably wondered - can I get more detailsabout the transaction that occurred? This is exactly where PDT jumps in - building on the AutoReturn functionality.For that reason, you'll need to enable both AutoReturn and then PDT in your profile; here is how to do that:

    Log in to your Premier or Business account1.Click the Profile sub tab2.Click Website Payment Preferences in the Selling Preferences column3.Click the On radio button next to the Auto Return label4.Enter the URL of the script that will process the PDT HTTP request sent from PayPal5.Under Payment Data Transfer, click the On radio button6.Click Save.7.

    After following these steps, you should get a PDT Identity Token that is needed for querying PayPal. If you don'tcopy-paste the token after clicking Save, know that you can always see it in your Website Payment Preferences:

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    5 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    9/15

  • 8/11/2019 Introduction to PayPal for C# - ASP

    10/15

    L 2. = ;

    , ( . ( " CCE ")) D H = D H . ( ); L 1. =

    .F ( " 0 1 2 3 4 !" , . F N , . L N ,

    . E , .G , .C ); L 1. = " , ..." ;

    In the code I'm attaching with the article, under the PDT directory, you'll see more classes that will help you out infollowing the previously mentioned f low.

    And, as with AutoReturn, one notice before closing the subject - take a look at the variable in PayPal'sresponse to your HTTP POST. You'll probably want to utilize this variable as it allows you to pass some informationfrom your payment page to your post-processing page without presenting it to the user. To name one use, in some of my PayPal implementations, I track the user with it - when he started payment process, and when/if he finished it.

    Instant Payment Notification (IPN)

    One big shortcoming of PDT is that it is a user-driven process, meaning - if the user closes the browser afterperforming a payment and before being redirected to your site, you'll lose the opportunity to run your postprocessing logic. That's why you are advised to combine the PDT with IPN for any serious integration with PayPal.

    IPN is a back-end mechanism that makes HTTP POSTs to your page, notifying you of important events. It is used notonly for PostPayment processing, but also for things that come after, like handling user cancelation of recurringpayments.

    Being a back-end technology, it is somewhat harder to implement and debug than PDT. There are a couple of thingsyou should be aware of before starting to implement IPN:

    IPN messages can be delayed sometimes. I know, I know... that beats the word "Instant" in IPN, but that's howthings are.There is a known history of problems with the IPN service; two latest incidents happened on October 2 nd 2009(2 hour delay) and on September 6 th 2009 (6 hour delay).Whenever you have problems with IPN, be sure to check the Live Status page and see if there is an incidentnotification before digging into debugging and changing your script. There is also a similar page for SandboxStatus .

    Before being able to receive IPN messages, you'll need to activate this service; follow these steps:

    Log in to your Premier or Business account1.Click the Profile sub tab2.Click Instant Payment Notification in the Selling Preferences column3.Click the 'Edit IPN Settings' button to update your settings4.Select 'Receive IPN messages' (Enabled) and enter the URL of your IPN handler5.Click Save, and you should get a message that you have successfully activated IPN6.

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    15 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    11/15

    Activating In stant Payment Notification

    As with AutoReturn, you can overwrite the IPN handler URL set in the profile in individual forms by adding the variable (see the HTML Variables reference ). Know that this will influence not only the initial IPN

    message but all future messages related to that transaction (they will all go to ).

    To handle IPN messages, you'll need to create an HTTP handler somewhere on your website. When a significantevent occurs (e.g., user performs payment), following flow takes place:

    PayPal will send an HTTP POST to your IPN handler with a number of variables.1.After receiving HTTP POST and parsing it, you need to submit the complete body of the message back tohttps://www.paypal.com/cgi-bin/webscr (or https://www.sandbox.paypal.com/cgi-bin/webscr for a Sandbox

    account). When you are doing this, be sure to send a message back in the exact format in which you receivedit; the only thing you a re allowed to do is adding cmd=_notify-validate . This is all done in order to verify thatHTTP POST was authentic and sent from PayPal.

    2.

    PayPal will respond with either VERIFIED or INVALID. After you receive this response, be sure to send 200 OK toprevent additional attempts from PayPal to send an IPN. If you don't close the loop with a 200 OK, PayPal willstart resending IPN (starting from 4 seconds and doubling - 8 seconds, 16 seconds, 32 seconds... up to 4 days).

    3.

    Here is a generic C# IPN handler (for more code, check the zip attached to the article):

    Collapse | Copy Code

    L ( , E A )

    = C M .A " " ; H = (H ) .C ( );

    .M = " " ; .C = " / "; = .B (H C .C . .C L ); = E .A CII.G ( ); = ; += "& = "; .C L = .L ;

    ( (" #"))

    = ( .G (),

    . .E .A CII); . ( ); .C ();

    I = ( .G ().G ()); = I . E (); I .C ();

    D = ( "M "); = .F ( " 0 1 . " ,

    .M ( D ), D .N . ); F . A ( , );

    ( == " E IFIED" ) ( == "IN ALID" )

    If you have received an INVALID response, that could mean two things:

    Someone tried to send a malicious message to your IPN handler.Your implementation isn't perfect.

    In case of a malicious message, you're on your own (log IP, take appropriate action), but for imperfectimplementations, visit this IPN troubleshooting topic on PayPal Developer Forums; it is full of useful tips that shouldhelp you solve INVALID responses.

    Also, before going online with your IPN handler, be sure to test it thoroughly with the Instant Payment Notification(IPN) simulator. As an IPN handler will work in the background, you'll want to test it as much as you can before going

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    15 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    12/15

    live and relying on its processing.

    Another thing you'll want to visit if you are implementing IPN is ScriptGenerator2 page ... it can quickly generate anIPN handler in the language of your choice. Funny thing - they are missing a generator for ASP.NET/C#; for that,check out the IPN directory in the code-archive I've attached to this article and these Code Samples .

    Finally, on PayPal Developer Center, there is this nice page that lists most of the IPN and PDT variables . I'm sayingmost because there are some variables missing on it (check comments on this page ), but the list is far beyond beinguseless.

    PayPal APIAs said in the introduction, most developers, even if they have no previous experience with PayPal, start directly withthe API. Google search brings up either API Reference or the SDKs and Downloads page and then browsing throughDocumentation starts. I don't want to say that there is something wrong with using PayPal API for payments; I wantto say that in most of the cases, it's not necessary to go down that path.

    PayPal API is much more than just a mechanism for payment - if you look at the provided API Reference page, you'llsee that there are lots of methods not tied directly to "user performing payment". You can use the API to browsethrough the history of your transactions, issue a refund, or update a recurring payments profile. So how do you startusing it?

    First and foremost, you'll need to enable API access in your account; follow these steps:

    Log in to your Premier or Business account1.Click the Profile sub tab2.

    Click the API Access link under the Account Information header3.Click the link that says Request API Credentials / View API Certificate4.Select either API Signature or API Certificate5.

    Step 5 from activating API Access

    I recommend that you select API Signature, and the examples that follow will assume you made this choice. There isnothing wrong with selecting API Certificate; I just find it more demanding from a setup perspective.

    Now that you have credentials to make API calls, how do you perform them? The approach that will work equally wellwith all platforms is to download the SDK , target the appropriate API endpoint , and start making HTTP calls witheither Name-Value pairs or SOAP.

    However, for .NET developers, I recommend a different approach. Considering that Visual Studio has an awesomeWSDL parser, I urge you to just add a Web Service Reference to https://www.paypal.com/wsdl/PayPalSvc.wsdl . After afew moments, you'll have an up-to-date class ready to serve you with all the benefits of strong typing - no building of HTTP requests, no copy-pasting field names, and no cumbersome parsing of responses. You have the same thingavailable for Sandbox at: https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl .

    Express Checkout

    Express Checkout is the most flexible PayPal integration solution. The user is redirected to PayPal just forauthentication and confirmation that he wants to pay for your services, and after that, everything is done on yourwebsite; you'll make calls to the PayPal API in the background. The following picture describes the process (takenfrom this page ):

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    15 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    13/15

    Express Checkout flow

    You'll add a PayPal Checkout button that invokes the E C method of the PayPal API after itis clicked.

    1.

    If you are invoking this method for one time payment, it'll be valid if you include only the required fields.Setting the N HI ING variable to 1 is important if you are selling some online service (it'll help youskip the Shipping info page).

    1.

    If you are invoking this method in order to set recurring payments, be sure to set L BILLING E0 to and L BILLINGAG EEMEN DE C I I N0 to a valid description of your service.

    2.

    E C will return a 20 char token that will uniquely identify your transaction. This token isvalid for 3 hours. After you receive it, redirect the user to https://www.paypal.com/cgi-bin

    /webscr?cmd=_express-checkout&token=[TOKEN] (you can guess what the URL for Sandbox is, right?).

    2.

    The user will review payment information, and if everything is OK, enter the login credentials. After this, PayPalwill redirect him to the URL you specified with E N L when you called E C .

    3.

    When your E N L is hit, you need to invoke the G E C D method and see thedetails of the actual transaction; verify that everything is in order.

    4.

    Now, all that is left is to commit the transaction. Depending on what you did in step 1, there are two thingsthat can be done.

    5.

    For one time payments, you'll just invoke D E C and forward the appropriatevariables.

    1.

    For recurring payments, you'll invoke the C method. It is required that youinclude the DESC field and match it to the value entered in L_BILLINGAGREEMENTDESCRIPTION0 whenyou called E C .

    2.

    In a nutshell - that's it. Again, I have provided code examples that follow the previously specified flow in the archiveaccompanying this article (under the API directory). If you wish, you can also use the PayPal Express CheckoutIntegration Wizard for generating the reference code.

    Direct Payment (Website Payments Pro)

    Most developers aren't aware that the PayPal platform can be used for just Credit Card processing. This part of thePayPal API is called Direct Payment, and when combined with Express Checkout (which only services customers withPayPal accounts), you get what is referred to as Website Payments Pro on the PayPal Developer Center.

    To be able to call methods that are part of Direct Payment ( D D and C ),you first need to satisfy some conditions:

    Have a Business account that is based in US, UK, or Canada1.Oblige that you'll implement both Express Checkout and Direct Payment on your website2.Submit application for Website Payments Pro through your PayPal account and have it approved3.Pay monthly fee (currently $30 per month)4.

    After you have a Website Payments Pro account in place, calling Direct Payment methods is pretty straightforward - if in doubt, either visit the API Reference page, or look at the code attached to this article. Just know that if you try tocall any Direct Payment method on an account that doesn't have Pro enabled, you'll get an error with code 10501(this is one of the most c ommon problems reported in the Sandbox forum).

    Lastly, once you start dealing with credit cards, you'll need to take care of PCI Compliance; here is a nice forum threadthat provides more information on that .

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...

    15 7/12/2014 2

  • 8/11/2019 Introduction to PayPal for C# - ASP

    14/15

  • 8/11/2019 Introduction to PayPal for C# - ASP

    15/15

    Permalink | Advertise | Privacy | MobileWeb04 | 2.8.140709.1 | Last Updated 6 Nov 2009

    Article Copyright 2009 by Predrag TomasevicEverything else Copyright CodeProject , 1999-2014

    Terms of Service

    Layout: fixed | fluid

    Member 10275938 7-Feb-14 9:29

    vk0489 20-Jan-14 11:47

    praveenpk 15-Jan-14 0:19

    Member 10491581 28-Dec-13 4:30

    Member 10399961 13-Nov-13 15:02

    LcSila13 21-Oct-13 10:16

    Sampath Lokuge 27-Jul-13 5:15

    Member 10164600 20-Jul-13 5:37

    Rohan Leuva 18-Apr-13 5:52

    Kashif.Scholion 21-Jan-13 16:58

    Punit Belani 21-Jan-13 3:49

    Punit Belani 21-Jan-13 3:48

    Punit Belani 21-Jan-13 3:47

    Pankaj_Upadhyay 23-Nov-12 6:44

    Member 9566577 21-Nov-12 6:52

    Member 8351252 11-Nov-12 1:29

    B.Sudhir 9-Oct-12 0:28

    Member 9171128 28-Sep-12 20:18

    Raghu KT 15-Sep-12 5:52

    Raghu KT 15-Sep-12 5:38

    @amitgajjar 15-Sep-12 3:48

    Member 1078262 8-Aug-12 7:25

    juanjosei 20-Nov-12 10:25

    Last Visit: 31-Dec-99 23:00 Last Update: 11-Jul-14 11:31 Refresh 1 2 3 4 5 6 7 Next

    General News Suggestion Question Bug Answer Joke Rant Admin

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    IPN vs PDT which is before

    Error when using the INE Handler and PayPal API & ExpressCheckout

    PayPal for C# - ASP.NET developers currency Codeimplementation

    Very helpful Article

    Downloading history from code

    Excelent article!

    My vote of 5

    Please update AutoReturn parameters as they have changed

    My vote of 5

    My Gratitude to your Wonderful Post which Helps me a lot.

    Thanks

    My vote of 5

    Subsciption EOT error

    Nice Work.....

    My vote of 5!

    There is complete PayPal API C# .Net Wrapper

    IPN Doesn't work at all

    PAYPAL integrate in ASP.NET webpages

    My vote of 5

    My vote of 5

    My vote of 5

    .net soap api work for sandbox but don't work for regularaccount

    Re: .net soap api work for sandbox but don't work for regularaccount

    uction to PayPal for C# - ASP.NET developers - CodeProject http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-...