GNU GPL FREE

The GNU GPL is an
open-source license.
Read full license

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

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

(22 ratings)

PHP PayPal Pro Adaptive PayFlow API Class

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

Share and win up to $15k in prizes each month!Learn more

Share

Description

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
Read all 37 comments »

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
  • perera malinda said:

    3 weeks ago
    Thanks..how to use this code digital download website.
    • Andrew Angell Author said:

      3 weeks ago
      I'm not sure I understand what you're asking. Are you talking about Express Checkout for Digital Goods?
  • Jerry Harrison said:

    9 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 Author said:

      9 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 said:

    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 Author said:

      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 said:

      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 Author said:

      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.
View all 7 reviews »

User Reviews