Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History
Under Construction
This proposal is under construction and is not ready for review.

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Service_PayPal Component Proposal

Proposed Component Name Zend_Service_PayPal
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Service_PayPal
Proposers Shahar Evron
Revision 0.1 - 27 February 2007: Started proposal process (wiki revision: 11)

Table of Contents

1. Overview

Zend_Service_PayPal is a Zend Framework interface to the PayPal on-line payment service, through PayPal's exposed APIs. Initially, it is intended to support the lighter PayPal Name-Value Pairs (NVP) interface, but could eventually go over the traditional SOAP interface, depending on the user's choice.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • Zend_Service_PayPal will implement the new PayPal NVP interface to the PayPal API servers
  • Zend_Service_PayPal will include a set of container classes for common PayPal data types: CreditCard, Address, Authentication Information, ...
    • TODO: Expand this
  • Zend_Service_PayPal will allow API users to authenticate using both PayPal API Signatures and PayPal API Certificates
  • Zend_Service_PayPal will allow API users to perform the business functions:
    • DoDirectPayment
    • SetExpressCheckout
    • GetExpressCheckoutDetails
    • DoExpressCheckoutPayment
    • DoCapture
    • DoAuthorize
    • DoVoid
    • DoReauthorize
    • RefundTransaction
    • TransactionSearch
    • GetTransactionDetails
    • MassPay
  • Zend_Service_PayPal will expose methods in a way allowing abstraction between the NVP interface and the SOAP interface if it will be implemented
  • Zend_Service_PayPal will implement a common PayPal API response class allowing easy access to response messages
  • Zend_Service_PayPal will use Zend_Http_Client to preform HTTP requests, and will allow the developer to override the default Http_Client object (allowing the usage of custom Http_Client adapters, etc.)
  • Zend_Service_PayPal will not attempt to be built in a payment-service abstract fashion, due to the complexity of PayPal's service

4. Dependencies on Other Framework Components

  • Zend_Http_Client
  • Zend_Filter
  • Zend_Validate_Ccnum
  • Zend_Service_Exception

5. Theory of Operation

The PayPal service object will be used in slightly different manners, depending on the API call that is preformed. Generally speaking, a single interface object is instantiated, and the API credentials are set (API user name, password and signature / certificate). Internally, the object also instantiates a Zend_Http_Client object and prepares it for an NVP request (set the method to POST, preset some always-required POST parameters, etc.).

Depending on the request type, the user will also need to instantiate additional container objects - for example, a DoDirectPayment request would require credit card information and billing address to be passed. These pieces of information will be represented in objects that will be passed to the interface object when calling an API method.

Once an API method is called, the interface object will set all the required POST parameters, and send the HTTP request. All API calls will return a common Response object - containing all the information in the PayPal response (status, transaction ID, failure reasons, etc.)

Note: Supporting PayPal certificate authentication might require improvements to Zend_Http_Client - namely resolving ZF-1004.

6. Milestones / Tasks

  • Milestone 1: design notes will be published here
  • Milestone 2: As part of the proposal process, integration with other Framework components will be considered (eg. Zend_Currency, Zend_Auth, Zend_Log)
  • Milestone 3: Working prototype for DoDirectPayment and ExpressCheckout calls, along with container classes for common data objects
  • Milestone 4: Unit tests exist, work, and are checked into SVN.
  • Milestone 5: Initial documentation exists.
  • Milestone 6: All API other listed API calls are working using the NVP interface, along with unit tests and documentation.
  • Milestone 7: (optional, depending on a separate proposal) Implementation of the SOAP interface

7. Class Index

  • Zend_Service_PayPal_Exception
  • Zend_Service_PayPal_Interface
  • Zend_Service_PayPal_Nvp
  • Zend_Service_PayPal_Soap (optional, depending on a separate proposal)
  • Zend_Service_PayPal_Response
  • Zend_Service_PayPal_Data_Exception
  • Zend_Service_PayPal_Data_Address
  • Zend_Service_PayPal_Data_AuthInfo
  • Zend_Service_PayPal_Data_CreditCard
  • Zend_Service_PayPal_Data_User
  • Zend_Service_PayPal_Data_OrderItem
  • ...

8. Use Cases

UC-1: Charding a credit card using the DirectPayment API call
UC-2: Charding a PayPal account through Express Checkout

Start the checkout process:

After the user is redirected back from PayPal after authorizing the payment:

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.