paypal api 英文 版
[PayPal.APIs:构建和运行].(PayPal.APIs:Up.and.Running).Michael.Balderas.文字版.pdfPayPal APls: Up and RunningPay Pal APls: Up and RunningMichael balderasO REILLYBeijing· Cambridge· Farnham·Koln· Sebastopol· TokyoPayPal APls: Up and Runningby michael BalderasCopyright@ 2011 O'Reilly Media, Inc. All rights reservedPrinted in the United States of americaPublished by O Reilly Media, Inc, 1005 Gravenstein Highway North, Sebastopol, CA 95472O'Reilly books may be purchased for educational, business, or sales promotional use. Online editionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformationcontactourcorporate/institutionalsalesdepartment:(800)998-9938orcorporate@oreilly.comEditor: Mary treselerIndexer: Angela HowardProduction Editor: Kristen borgCover designer Karen montgomeryCopyeditor: Genevieve d'EntremontInterior Designer: David FutatoProofreader: Kristen borgIllustrator: Robert roPrinting History:February 2011: First EditionNutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks ofO'Reilly Media, Inc. Pay Pal APIs: Up and Running, the image of an African wildcat, and related tradedress are trademarks of O'Reilly Media, IncMany of the designations used by manufacturers and sellers to distinguish their products are claimed asrademarks. Where those designations appear in this book, and O Reilly Media, Inc, was aware of atrademark claim, the designations have been printed in caps or initial capsWhile every precaution has been taken in the preparation of this book. the publisher and author assumeno responsibility for errors or omissions, or for damages resulting from the use of the information con-tained hereinISBN:978-1-449-39612-1ILSI1297358600Table of contentsPreface1. the payPal APlOverview of the payPal aPIGetting StartedDirect Versus sdk IntegrationTesting Versus Live ImplementationObtaining api credentialsCreating an API SignatureCreating a Name-Value Pair(NvP) requestParsing an NVP Response2. PayPal Express CheckoutCheckout Process Workflows4468111Generic Checkout WorkflowExpress Checkout WorkflowGeneric Versus Express Checkout Workflow12Express Checkout FlowPayPal Express checkout aPi operations15Set Express Checkout16GetExpress CheckoutDetailsDoExpress CheckoutPaymentCallback22Simple Express Checkout Integration24Setting Up the transaction24Express Checkout Integration253. PayPal Website payments Pro...................... 49Overview of direct Paymentirect Payment Workflow49Pay Pal direct Payment aPi operations50Simple direct payment integrationDirect Payment Integrations554. PayPal Adaptive PaymentsOverview of adaptive paymentsPayPal adaptive Payments aPi Operations OverviewAdaptive payments permission levelsAdaptive Payments Application Workflows61Payment Approval and Payment Flows63Explicit payments63Preapproved Payments64mplicit PaymentsGuest paymentsAdaptive Payments API Operations in Depth66Pay API Operation67SetPaymentoptions aPl operationExecutePayment API OperationAdaptive Payments Integration5. PayPal Mobile Express CheckoutMobile express checkout Flow100Mobile Express Checkout Best Practices100Mobile express Checkout Library for iOS101MEC Mobile application Integration101MEC MObile Website Integration102MEC Library Methods102MEC Localization Support104Sample mec code105Summary106Index,107ⅵ i Table of ContentsPrefaceVirtually every application delivery model is experiencing a surging demand for trans-action convenience. In this book, I introduce PayPal APIs, along with instructions andresources for their integration in different environments, including websites and mobileapplicationsGoals of this bookThe goal of this book is to help you understand what PayPal has to offer. Let's face ityou want to get money from your customers into your bank account as quickly aspossible, and i want to help you accomplish this. B y the end of this book, you will havea better understanding of what PayPal is, how PayPal can streamline your paymentsand how to get the most out of Pay Pal for your particular payment situationWho should read this bookThis book is for anyone who wants to accept payments for their goods or servicesthrough PayPal. You might be an individual with an open source project looking toaccept donations, a multimillion-dollar corporation, a nonprofit requesting donationsto help a cause, or a software developer writing mobile apps for cell phones. Pay Pal canprovide you with solutions, no matter who you are. The code samples in this book areprovided in PHP and Objective-C, and limited code coverage of Droid is included inChapter 5. An understanding of using APIs is recommended, but not requiredHow This book ls organizedHere is a brief summary of the chapters in the book and what you can expect from eachChapter 1, The Pay Pal APICovers the Pay Pal aPi and how to start using it to accept payments, with an emphasis on choosing an integration method for your project as well as obtaining thenecessary credentials to get started i also cover how to use the sandbox to test yourapplicationChapter 2, Pay Pal Express CheckoutCovers Express Checkout and how to use the api to execute Express checkoutPayments. This chapter contrasts the Generic (or Traditional) checkout workflowwith the Express Checkout workflow. All four of the Express Checkout operations(SetExpressCheckout, GetExpressCheckoutDetails, DoExpress CheckoutPayment, andCallback) are coveredChapter 3, PayPal Website Payments ProCovers Website Payments Pro, with an emphasis on Direct Payments. I demonstrate the direct Payment workflow in a sample transaction. A simple direct Payment Integration sample is also includedChapter 4, Pay Pal adaptive paymentsCovers Adaptive Payments, including an overview of Adaptive Payments as wellas a breakdown of the Permission Levels provided via Adaptive Payments. Appli-cation workflows, Payment approval, and payment flows are also includedChapter 5, PayPal Mobile Express CheckoutCovers Mobile Checkout with an emphasis on the newly released mobile expressCheckout and the Mobile Payment Libraries for ioS- and Droid-basedsmartphonesConventions Used in this bookThe following typographical conventions are used in this bookalicIndicates new terms. URLs. email addresses filenames, and file extensionsConstant widthUsed for program listings, as well as within paragraphs to refer to program elermentssuch as variable or function names, databases, data types, environment variablesstatements,and keywordsConstant width boldShows commands or other text that should be typed literally by the userⅶ ii Preface