GNU GPL


The GNU GPL is an
open-source license.
Free Read License

14 Day money-back guarantee

Full refund within 14 days of purchase date.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Nov 6, 2011
    Last Update: Nov 1, 2012
  • Language: PHP
  • Category: Ecommerce
(22 ratings)

PHP PayPal Pro Adaptive PayFlow API Class

PHP PayPal Pro Adaptive PayFlow API Class
Developed by Angell EYE, Released Nov 6, 2011

Easily integrate PayPal API web services for Payments Pro, Adaptive Payments, Adaptive Accounts, Permissions, or PayFlow into any PHP project.

PHP

Tags: adaptive payments , class , e-commerce , ecommerce

This class library includes methods to easily integrate all of PayPal's API's including PayPal Payments Pro, Adaptive Payments, Adaptive Accounts, Permissions, and PayFlow.

The class makes it extremely quick and easy to tie PayPal into your applications. It comes with template solution files for nearly every API call available. All you have to do is populate the request parameters and you'll get a PHP array result that includes everything you'll need from the API call.

Current calls included are:

PayPal Payments Pro

  • AddressVerify
  • BillAgreementUpdate
  • BillOutstandingAmount
  • CreateRecurringPaymentsProfile
  • DoAuthorization
  • DoCapture
  • DoDirectPayment
  • DoExpressCheckoutPayment
  • DoMobileCheckoutPayment
  • DoNonReferencedCredit
  • DoReauthorization
  • DoReferenceTransaction
  • DoVoid
  • GetAccessPermissionsDetails
  • GetAuthDetails
  • GetBalance
  • GetBillingAgreementCustomerDetails
  • GetExpressCheckoutDetails
  • GetTransactionDetails
  • ManagePendingTransactionStatus
  • ManageRecurringPaymentsProfileStatus
  • MassPay
  • RefundTransaction
  • SetAccessPermissions
  • SetExpressCheckout
  • SetMobileCheckout
  • TransactionSearch
  • UpdateAccessPermissions
  • UpdateRecurringPaymentsProfile

PayPal Adaptive Payments

  • AddBankAccount
  • AddPaymentCard
  • CancelInvoice
  • CancelPermissions
  • CancelPreapproval
  • CreateAccount
  • CreateAndSendInvoice
  • CreateInvoice
  • ExecutePayment
  • GetAccessToken
  • GetAdvancedPersonalData
  • GetBasicPersonalData
  • GetFundingPlans
  • GetInvoiceDetails
  • GetPaymentOptions
  • GetPermissions
  • GetShippingAddress
  • GetVerifiedStatus
  • MarkInvoiceAsPaid
  • Pay
  • PaymentDetails
  • Preapproval
  • PreapprovalDetails
  • Refund
  • RequestPermissions
  • SearchInvoices
  • SendInvoice
  • SetFundingSourceConfirmed
  • SetPaymentOptions
  • UpdateInvoice
  • BMButtonSearch

PayPal PayFlow

  • Authorization
  • Balance Inquiry
  • Credit
  • Delayed Capture
  • Voice Authorization
  • Inquiry
  • Data Upload
  • Duplicate Transaction
  • Sale
  • Void
View all 7 reviews »

User Reviews

  • Ravendra Patel 3 months ago
    very good
    Flag
    Was this helpful? Yes No
  • Volodymyr Makuh 10 months ago
    Class is implemented very well. Support the latest version of PayPal API.
    Enjoy.
    Flag
    Was this helpful? Yes No
  • skyer2000 1 year ago
    The class is extremely light-weight and easy to integrate into existing projects. Nice work!
    Flag
    Was this helpful? Yes No
Read all 37 comments »

Questions & Comments


Or enter your name and Email
  • perera malinda 2 months ago
    Thanks..how to use this code digital download website.
    • Andrew Angell Developer 2 months ago
      I'm not sure I understand what you're asking. Are you talking about Express Checkout for Digital Goods?
  • Jerry Harrison 10 months ago
    Hi there,

    So far great plugin I have a couple of questions and some help with paypal.class.php itself.

    First off I noticed on some of the lines the arrays were reference different variables or keys. I so far have only noticed on a couple of lines -

    ln 3647 ...
    $XMLRequest .= $PaymentPeriod != '' ? '' . $Memo . '' : '';

    The var $Memo needs to be changed to $PaymentPeriod

    $XMLRequest .= $PaymentPeriod != '' ? '' . $PaymentPeriod . '' : '';

    ln 3652
    $XMLRequest .= $SenderEmail != '' ? '' . $PinType . '' : '';

    TO

    $XMLRequest .= $SenderEmail != '' ? '' . $SenderEmail . '' : '';

    And finally Line 3613

    $ClientDetailsFields = isset($DataArray['ClientDetailsFields']) ? $DataArray['ClientDetails'] : array();

    should be

    $ClientDetailsFields = isset($DataArray['ClientDetailsFields']) ? $DataArray['ClientDetailsFields'] : array();

    -----------------------------------------------------------------------------

    Hope that helps further the development of this handy lib!

    Like I mentioned I do have some questions (I would normally head over to a forum or stack overflow but hope you might have more guidance). I'm helping out building a crowd funding type platform and I was wondering if you had any suggestions - api call wise - in what is the correct process to carryout such a project. I honestly could find and good help on PayPal's forums or their code samples (not much for adaptive). I kinda have to narrowed down to this, but I could be extremely off.

    1) I know i need to perform a Preapproval request (good example in your plugin)
    -- save the Preapproval Key in the db
    2) Get some details on the Preapproval request via PreapprovalDetails to verify data
    3) when time comes and if the goal was met run a chained pay action and listen for ipn

    Is this correct or are there other steps/precautions I should be taking?

    Thank you for your library and your help!
    -- Jerry

    PS. any thoughts on opening a Github?
    • Andrew Angell Developer 10 months ago
      Thanks for the feedback. I think I've gotten most of those things fixed in my local copy. Been meaning to add a few more features and get the next version posted.

      Sounds like you've got a good handle on things. I think the flow you've outlined is exactly what you should be doing.

      I do plan on releasing this on Github. If not with this next version, probably the one after that.
  • ClementBoudon 1 year ago
    Hi,

    I notice one little mistake in your paypal.class.php file :

    On line 3615, function Preapproval($DataArray), if $DataArray['ClientDetailsFields'] is set, you don't use 'ClientDetailsFields' but 'ClientDetails' as value of $ClientDetailsFields. Just by replacing $DataArray['ClientDetails'] by $DataArray['ClientDetailsFields'], everything's going fine.

    By the way, thanks for your work, it's so helpfull.
    • Andrew Angell Developer 1 year ago
      Thanks, nice catch. I've got it fixed so it'll be on the next release, which will most likely be a Github repo.

      Glad you've found it useful!
    • ClementBoudon 1 year ago
      Hi,

      I notice one more mistake : in paypal.class.php, on line 3019, If $PreapprovalKey != '', you don't use $PreapprovalKey as value for xml parameter "preapprovalKey", nut $Pin. By replacing $Pin by $PreapprovalKey, everything works fine.

      The error I used to have was : "Invalid request parameter: preapprovalKey with value".

      Regards,
      Clement.
    • Andrew Angell Developer 1 year ago
      Ah, yes, thanks again. I can't believe nobody, including myself, has run into that yet.
You must be logged-in to vote. Log-in to your account or register now.