Giter Club home page Giter Club logo

paypal-codeigniter's Introduction

PayPal CodeIgniter Library

Introduction

This PHP class library for PayPal makes it easy to integrate nearly every PayPal API they provide.

All of the web services included in PayPal's NVP documentation are included, as well as Adaptive Accounts, Adaptive Payments, Permissions, Invoicing, PayFlow, and more.

Server Requirements

  • PHP version 5.2.4 or newer.
  • CodeIgniter 2.0+

Installation

Merge the /application directory into your CodeIgniter /application directory.

Open /application/config/paypal-sample.php and adjust the value with your own Sandbox and Production API credentials. Then save-as paypal.php.

There are detailed comments inside the config file to help you fill it out correctly.

How to Make PayPal API Calls

Open /application/controllers/paypal/templates/Controller_name.php depending on which PayPal API you're going to be using.

Example: If we want to make a call to the RefundTransaction API we open Payments_pro.php and then seek out the Refund_transaction() function.

You can build directly into the template functions if you want to, however, I recommend you setup your own controller and copy the functions there. This keeps the templates clean for future reference. Just remember to load the PayPal config file and library in your constructor the same way the samples and templates do.

Each template controller file includes functions with PHP arrays for every parameter available to that particular API. Simply fill in the array parameters with your own dynamic (or static) data. This data may come from...

  • Session Variables
  • PHP Variables
  • Database Recordsets
  • Static Values
  • Etc.

When you run the function you will get a $PayPalResult array that consists of all the response parameters from PayPal, original request parameters sent to PayPal, and raw request/response info for troubleshooting.

If errors occur they will be available in $PayPalResult['ERRORS'].

Samples

After installing the library into CodeIgniter, the demo can be loaded at {base_url}/paypal/samples/demo/. This allows you to run the fully functional samples that are included with the library.

The samples that the demo loads can be found at /application/controllers/paypal/samples/.

The Payments Pro sample controller has two methods ready for demo purposes after you update your config file.

  • Do_direct_payment()
  • Get_balance()

The Adaptive Payments controller has one sample ready for demo.

  • Convert_currency()

The PayFlow controller has one sample ready for demo.

  • Process_transaction()

Notice

Our standard class library is now compatible with Composer which allows you to autoload the library and make it available in CodeIgniter.

We will still maintain this library for those of you who are not using Composer, but if you are you should probably look at the other library.

Resources

paypal-codeigniter's People

Contributors

decoxon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paypal-codeigniter's Issues

Complex scenario for paypal

I am using paypal adaptive payments with Preapproval request.
Buyer "A" buy 2 items from Seller '1' and 3 items from Seller '2'. Obviously, our app take commission from each seller. But this will be the preapproval request, buyer approve payments and after some days i.e. 20 we make an pay call and payments deducts.........

but the problem is, in this request there is two transactions

  1. Between app and seller 1
  2. between app and seller 2

how to handle this in one transaction?

How to make chained payment ?

Hello,

I am using parallel payment using Paypal_adaptive.php library but parallel payment showing recievers info while checkout so i want to hide receiver info while payment so paypal team has suggest me to use chained payment instead of parallel, so can you help me using this library or code how i can use chained payment ? please reply me as soon as.

Thanks

Sample adaptive payments API call return error: 520002

I'm trying to install the adaptive payments in my application when i try the sample code it give error bellow:
Array
(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 520002
[ExceptionID] =>
[Message] => Internal Error
[Parameter] =>
[Severity] => Error
[Subdomain] => Application
)

)

Send payment to single receiver in Adaptive payment

Hi!
I am using Pay function to send payment to single receiver. I modified the function pay_chained in sample and set only one receiver but it throwing error.
'ErrorID' => string '520002' 'Message' => string 'Internal Error'

Please help me solve this issue as i don't know whats wrong with it.

Thanks

Restructure samples.

Need to restructure samples so they are on their own, and prepare the library for the demo kits.

I Want A Code For Parallel Payment

Hello,
I m trying to configure 'paypal adaptive payment gateway' with 'parallel payment' method, so anybody can help me for that.
I configured all the basic things.
there is no demo function available for parallel payment in this sample code, only available for 'chained payment'.
#,http://elh.khasrabrothers.in/paypal/samples/Adaptive_payments
It is working fine as demo But i want to pay payment to two person 25% for one and 75% for another person, that's why i thing so it is possible with parallel method.

The URL /paypal/adaptive_payments/pay_cancel is malformed

I keep getting that the CancelURL is malformed. I have tried multiple URL's with no success. What could I be doing wrong here?

Array
(
    [0] => Array
        (
            [Receiver] => 
            [Category] => Application
            [Domain] => PLATFORM
            [ErrorID] => 580028
            [ExceptionID] => 
            [Message] => The URL /paypal/adaptive_payments/pay_cancel is malformed
            [Parameter] => /paypal/adaptive_payments/pay_cancel
            [Severity] => Error
            [Subdomain] => Application
        )

)

These do work from the demos.

  • Payments Pro - GetBalance
  • Adaptive Payments - ConvertCurrency

Undefined index: Ack

facing the following error, kindly help.

A PHP Error was encountered

Severity: Notice

Message: Undefined index: Ack

Filename: samples/Payments_pro.php

Line Number: 148

Backtrace:

File: /var/www/html/public/CodeIgniter/application/controllers/paypal/samples/Payments_pro.php
Line: 148
Function: _error_handler

File: /var/www/html/public/CodeIgniter/index.php
Line: 315
Function: require_once

Controller names need to be fixed.

I ran into an issue on my live server with the latest version of CI where my controllers weren't working because the file names did not start with a capital letter.

I fixed that in my local structure, but when I push the changes to GitHub the file remains with a lowercase letter, even though it does get changes made within the file.

Need to get the GitHub repo fixed to use a capital letter at the beginning of controller names.

After ExpressCheckout no IPN received

After do a sandbox pay with Set_express_checkout() it ignores 'notifyurl' and never is received, the sandbox account is configured to get IPN request.

License

Under what license is this library released MIT, GPL ...?

Save Data In DB

Hello Sir,
After successful of adaptive payment (parallel payment), how to save data in my DB?
please reply me as soon as possible.
thanks

Message: Undefined index: surveyquestion - Paypal_pro.php

I just updated to version 3.0.0 of Paypal_pro but still get this message:

A PHP Error was encountered
Severity: Notice
Message: Undefined index: surveyquestion
Filename: paypal/Paypal_pro.php
Line Number: 1385

I can fix this by doing this on line 1385:
if(isset($SECFields['surveyquestion']) && $SECFields['surveyquestion'] != '')

I did some Googling but could not find a previous report on this issue.
Thank you

Update documentation.

With the updates we did in #3 we need to update our Instructrions.html, README.rst, as well as any other documentation we have on the website.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.