PayPal Adaptive Payments Pro PayFlow CodeIgniter Library

PayPal Adaptive Payments Pro PayFlow CodeIgniter Library

A custom library for CodeIgniter that provides access to all PayPal NVP, Authentication, Permissions, Invoicing, Adaptive Payments, and PayFlow API's.

  • Language: PHP
    Framework: CodeIgniter
  • Released: Feb 21, 2011
    Last Update: Jan 19, 2014

Now Available on GitHub!

Important Notice

This CodeIgniter specific version of this class library is no longer being maintained. It will remain here in its current state, but all future updates and maintenance will be focused on our standard library.

The standard library is now fully compatible with Composer and available on Packagist so you may use it in CodeIgniter or any other framework you wish.

This library includes all of the PayPal NVP API calls as well as Adaptive Payments, Invoicing, Adaptive Accounts, Permissions, and PayFlow.

The controller includes "template" methods for every call that includes all of the possible parameters that can be passed into that particular call. 

All you have to do is fill in the blank parameters in the array templates and pass that into the library method.  An array will be returned with all of the response fields from PayPal as well as a few extra fields for troubleshooting purposes.

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
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.


Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

License » GNU GPL Download
or Get a quote

for customization or integration services

  • From what I have seen this seems to be a good library but there is major lack of support. For a beginner, it is very hard to integrate this library. It would be wise to do a full course, from the point of creating the paypal buy now button, to the point of the final step in the purchase, because many people do not understand how to implement and how to use this tools.
    VC Victor C
    2 years ago, 0 comments
    Was this helpful?
    Flag 4 of 4 people found this review helpful
  • Great overall library. Well built and documented. I am concerned with this setting in your cURL method, however:

    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

    SSL Verify Peer, and Verify Host should absolutely be turned on when shipping CC numbers over the internet. This is neither secure, compliant, or best practice. You basically are not confirming that the receiving host is paypal, or that the receiving cert is up to date. Although this setting makes it easier to integrate, it is setting up devs to implement PayPal quickly without proper security. This is partially PayPal's fault, as they do the same thing in their sample code. (Likely to avoid support headaches on their side) The library should really have the more secure settings, and force developers to do the extra security setup of choosing and including a cacert file to use with cURL:

    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($curl, CURLOPT_CAINFO, "/path/to/cacert.pem");

    It's really not that much extra work, and helps make the interwebs safer for all :).

    See these articles for a proper explanation of using cURL securely to communicate with secure sites:
    OH Oliver Holmberg
    9 months ago, 0 comments
    Was this helpful?
    Flag 1 of 1 people found this review helpful
  • Good
    VS Victor Sokolov
    2 years ago, 0 comments
    Was this helpful?
    Flag 0 of 1 people found this review helpful
Post a comment

Or enter your name and Email
  • K kiran 2 months ago
    hiiiiii..I am getting following error while testing Convert currency in sandbox mode.. Array ( [0] => Array ( [Receiver] => [Category] => Application [Domain] => PLATFORM [ErrorID] => 520003 [ExceptionID] => [Message] => Authentication failed. API credentials are incorrect. [Parameter] => [Severity] => Error [Subdomain] => Application ) ) Thanx
    • Andrew Angell Developer 2 months ago
      The error is pretty straight forward. My guess is you either have one of the values entered incorrectly, or you don't have the config file setup correctly. Do you have $sandbox evaluating the way you want?
    • K kiran 2 months ago
      yes..i have set config value as following. $config['Sandbox'] = TRUE; $config['APIVersion'] = '98.0'; $config['APIUsername'] = $config['Sandbox'] ? '' : 'PRODUCTION_USERNAME_GOES_HERE'; $config['APIPassword'] = $config['Sandbox'] ? 'VD7HHCUT2B7S5WTA' : 'PRODUCTION_PASSWORD_GOES_HERE'; $config['APISignature'] = $config['Sandbox'] ? 'AvTc38yc0CcfD38Fprt-eVptqODoA.3cFMtWBydNC5f6qXbm0Q0tlRRN' : 'PRODUCTION_SIGNATURE_GOES_HERE';
    • Andrew Angell Developer 2 months ago
      ConverCurrency uses the Adaptive Payments API, so you need to make sure $application_id is correctly set in the config file as well. If you still have trouble you can submit a ticket here: Please attach your files there for me to review and I'll see if I can find the problem for you.
  • EJ Ebenezer Jolaoso 4 months ago
    Hi Andrew, I have been trying to set this up for quite a bit but am getting a blank page. I have modified the config files to reflect the correct values. Any help in the right direction would be greatly appreciated. Regards Eb
    • Andrew Angell Developer 4 months ago
      A blank page means you have a PHP error of some sort happening but you must not have PHP errors enabled for display on your server. Adjust that in your php.ini or with ini_set() and then you should get a better error to lead you where the problem is. Alternatively, you could check out your raw web server logs and they should show you the same info.
    • EJ Ebenezer Jolaoso 4 months ago
      Thanks Andrew for your quick response. I really appreciate it. I managed to fix that. It has to do with the config file. The sample request displays now but i have this massive error as below. [ERRORS] => Array ( [0] => Array ( [L_ERRORCODE] => 10501 [L_SHORTMESSAGE] => Invalid Configuration [L_LONGMESSAGE] => This transaction cannot be processed due to an invalid merchant configuration. [L_SEVERITYCODE] => Error ) ) I have actually google quite a fair bit for the error code returned. And my account config credential is correct. I do have a premium pro account and the accept payment has been enable on the paypal development website. Please advice on what to do. Thanks. Eb
    • Andrew Angell Developer 4 months ago
      Invalid Merchant Configuration means you don't have DoDirectPayment enabled on the PayPal account you're working with. Have you applied for and been approved for Payments Pro? If so, it could be that you need to be using PayFlow instead of DoDirectPayment. That just depends on which version of Pro they put you into.
  • UC umesh c 6 months ago
    Fatal error: Cannot redeclare PayPal_Pro::GetBillingAgreementCustomerDetails() ..I m facing this issue what could i do?
    • Andrew Angell Developer 6 months ago
      Which version of the library are you using? The 2.42 version resolved this issue. All you need to do is open up /application/libraries/paypal/Paypal_pro.php and do a search for the GetBillingAgreementCustomerDetails function. You'll find two of them. Just remove one of those and that problem will go away.