Git Product home page Git Product logo

paypal-php-library's People

Contributors

choxnox avatar deepakmaurya avatar drewangell avatar kcppdevelopers avatar mrfiregore avatar rtconner avatar tejasm-itpath avatar tejasmht avatar tyxla 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paypal-php-library's Issues

Add UseSessionPaymentDetails to Express Checkout

Added in version 112.0.

"Added the optional field UseSessionPaymentDetails to the DoExpressCheckoutPayment (NVP | SOAP) API operation. This flag allows merchants to specify if the payment details information passed in SetExpressCheckoutDetails should be used instead of the payment details passed in DoExpressCheckoutPayment."

Apparently this will allow you to keep from having to repeat all the same details in DECP that you include in SEC, which is nice.

That can already be used with the library. I just need to add it to the template with notes.

Samples - Express Checkout - Line Items

Create a sample that expands on #32 and adds line items to the Express Checkout flow.

The line items should just be static values stored in an array for easy updating. Should include at least 2 items on the sample.

$order_items = array();
$item = array(
    'name' => 'Widget 456',                             // Item name. 127 char max.
    'desc' => 'Widget 456',                             // Item description. 127 char max.
    'amt' => '40.00',                               // Cost of item.
    'number' => '456',                          // Item number.  127 char max.
    'qty' => '1',                               // Item qty on order.  Any positive integer.
    'taxamt' => '',                             // Item sales tax
    'itemurl' => '',                            // URL for the item.
    'itemcategory' => '',                       // One of the following values:  Digital, Physical
    'itemweightvalue' => '',                    // The weight value of the item.
    'itemweightunit' => '',                     // The weight unit of the item.
    'itemheightvalue' => '',                    // The height value of the item.
    'itemheightunit' => '',                     // The height unit of the item.
    'itemwidthvalue' => '',                     // The width value of the item.
    'itemwidthunit' => '',                  // The width unit of the item.
    'itemlengthvalue' => '',                    // The length value of the item.
    'itemlengthunit' => '',                     // The length unit of the item.
    'ebayitemnumber' => '',                     // Auction item number.  
    'ebayitemauctiontxnid' => '',           // Auction transaction ID number.  
    'ebayitemorderid' => '',                // Auction order ID number.
    'ebayitemcartid' => ''                  // The unique identifier provided by eBay for this order from the buyer. These parameters must be ordered sequentially beginning with 0 (for example L_EBAYITEMCARTID0, L_EBAYITEMCARTID1). Character length: 255 single-byte characters
);
array_push($order_items, $item);

WarningsReturned() Needs Adjustment

Right now the WarningsReturned() method is only checking for SUCCESSWITHWARNING. Need to check for FAILUREWITHWARNING, too.

Should probably just use something like strpos() to check for any "failure" at all.

PayFlow mask api credentials.

Need to create a mask function to be used when saving API logs for PayFlow.

Would need to always mask the user, password, vendor, partner, cc number, exp date, security code.

PayFlow Express Checkout

Need to get templates setup for PayFlow gateway Express Checkout flow.

We can use our own PayFlow template, of course, and we'll just need to setup all the calls necessary to complete the Express Checkout flow outlined in this documentation: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pfp_expresscheckout_pp.pdf

Our template / sample names can be PayFlow_SetExpressCheckout.php, PayFlow_GetExpressCheckoutDetails.php, PayFlow_DoExpressCheckoutPayment.php, etc.

X-PAYPAL-AUTHORIZATION not being used at all

I have a use-case where merchant needs to give me certain permissions for me to call APIs on their behalf. RequestPermissions and GetAccessToken APIs are working fine, and I can get access token + secret, but there is no way for me to actually utilize this access token within this library.

For example, I can't get merchants personal data (using GetBasicPersonalData and GetAdvancedPersonalData) even though I have valid permissions because X-PAYPAL-AUTHORIZATION header is not being used at all.

Basically what's needed to be added to the library is function to generate value for X-PAYPAL-AUTHORIZATION, and then to simply adjust CURLRequest() functions in both PayPal and PayPal_Adaptive classes.

regarding webhooks

Sir ,
I really appreciate your work.
I just want to you to please make available webhook PHP file . So that it will be helpful for everyone who wants to implement webhook using API.

Add IPN Listener

Add IPN template/listener to the class library.

  • Ability to forward IPN data to one or more 3rd party listeners (daisy chain)
  • Option to create db tables and log all IPN's

SSLv3 - POODLE Vulnerability

How is the code suited for the new SSLv3 Vulnerability that came out? That being said Paypal just sent out emails stating that on Dec. 3rd they will no longer support SSLv3, only TLS.

Does the curl of the Code connect through SSL or TLS? If SSL when do you expect new code to be made and pushed that supports TLS?

Samples - Express Checkout - Basic

Basic checkout flow with Express Checkout for demonstration purposes.

Use Bootstrap for the pages so that they have a basic responsive design.

This initial sample can be a bare bones sample for Express Checkout with only the required details to get it working. No need to do line items or any un-required details, although it might make sense to still include line items on the checkout page so it looks like a shopping cart.

Sample flow...

  • Page to display a static shopping cart / checkout screen with a button to pay with Express Checkout.
  • Clicking the button should trigger the SetExpressCheckout request and redirect to PayPal.
  • ReturnURL should come back to the sample that runs GetExpressCheckoutDetails, stores all the data in sessions, and then continues to DECP.
  • DoExpressCheckoutPayment should run to finalize the payment, response data stored in session vars, and redirect to a final receipt page.
  • Receipt page should mimic the original shopping cart / checkout screen but will now show that it's been paid and display the PayPal transaction ID accordingly.

GetVerifiedStatus missing AccountType in response

On line 2494 of Adaptive.php $AccountType is set, however the var is not added to the $ResponseDataArray. Simply inserting 'AccountType' => $AccountType, on line 2512, for example, fixes the problem.

Samples - Express Checkout - Parallel Payments

Expand on #39 to create a single checkout with multiple receivers.

Our shopping cart page in this case should show that 1 item is being purchased from "source A" and another item is being purchased from "source B".

Then the EC API calls will include 2 separate $Payments on the same checkout.

Update to Version 119.0

Need to go through documentation and check for any new features added to API's, get them applied to the library, and then update the default version to 119.0.

Samples - Pay

Need to add specific Pay samples for different types of checkout flows.

  • Pay
  • Pay-Chained
  • Pay-Implicit
  • Pay-Parallel
  • Pay-Chained-Delayed

Need to make sure the Pay samples use the PayWithOptions() method so that the BN code is included.

Button Manager API Completion

Right now I have the BMButtonSearch call included, but nothing else in regard to the BM API. Need to go ahead and add in the rest of the API calls.

  • BMButtonSearch // DONE //
  • BMCreateButton // DONE //
  • BMGetButtonDetails // DONE //
  • BMGetInventory // DONE //
  • BMManageButtonStatus // DONE //
  • BMSetInventory // Done //
  • BMUpdateButton // Done //

Set CURLOPT_VERBOSE based on $this->Sandbox.

Right now the verbose option in cURL is hard-coded to 1/true. Need to set this based on $this->Sandbox instead so that it will be true for test mode and false for production.

Add Payments Standard

Need to add some methods for creating simple Payments Standard HTML forms/buttons.

Adaptive Payments - Print Headers Option

The option to print headers is already included in the BuildHeaders function, but it's not passable from the script using the class. Need to make this an option that the developer can use easily.

Missing Invoicing API's

Need to add the following.

  • DeleteInvoice
  • GenerateInvoiceNumber
  • RemindInvoice
  • MarkInvoiceAsRefunded
  • MarkInvoiceAsUnpaid
  • RemindInvoice

Sample Create Recurring Profile Missing Array

$PayPalRequestData = array(
'ActivationDetails' => $ActivationDetails, // This array is missing in the sample for CreateRecurringPaymentsProfile.php
'ProfileDetails' => $ProfileDetails,
'ScheduleDetails' => $ScheduleDetails,
'BillingPeriod' => $BillingPeriod,
'CCDetails' => $CCDetails,
'PayerInfo' => $PayerInfo,
'PayerName' => $PayerName,
'BillingAddress' => $BillingAddress
);

PHP Notices

Refer to #48

This change caused our app to start launching "Undefined index: Account Id" messages. It would have been better to check those variables with empty() instead of comparing with != '' to avoid non desired notices when the Account Id wasn't sent, specially in this case that it was added in a minor version change

Invalid ACK response in MassPay

I test MassPay in sandbox but returned array have ACK = Failure and raw response have ACK = Success. And MassPay is sent on account, so returned array have bad data.

Array
(
    [TIMESTAMP] => 2014-10-05T17:45:11Z
    [CORRELATIONID] => f1606e20d0b1e
    [ACK] => Failure
    [VERSION] => 112.0
    [BUILD] => 13154493
    [ERRORS] => Array
        (
        )

    [REQUESTDATA] => Array
        (
            [USER] => xxx
            [PWD] => xxx
            [VERSION] => 112.0
            [BUTTONSOURCE] => AngellEYE_PHPClass
            [SIGNATURE] => xxx
            [METHOD] => MassPay
            [EMAILSUBJECT] => API Test payment
            [CURRENCYCODE] => USD
            [RECEIVERTYPE] => EmailAddress
            [L_EMAIL0] => [email protected]
            [L_AMT0] => 1.23
            [L_EMAIL1] => [email protected]
            [L_AMT1] => 1.45
        )

    [RAWREQUEST] => USER=xxx&PWD=xxx&VERSION=112.0&BUTTONSOURCE=AngellEYE_PHPClass&SIGNATURE=xxx&METHOD=MassPay&EMAILSUBJECT=API+Test+payment&CURRENCYCODE=USD&RECEIVERTYPE=EmailAddress&L_EMAIL0=user%40domain.com&L_AMT0=1.23&L_EMAIL1=user2%40domain.com&L_AMT1=1.45
    [RAWRESPONSE] => TIMESTAMP=2014%2d10%2d05T17%3a45%3a11Z&CORRELATIONID=f1606e20d0b1e&ACK=Success&VERSION=112%2e0&BUILD=13154493
)

Add PayPal doc notes for each API to comments in class files.

I've got inline comments for parameters in the template files, but I don't really have any notes about what exactly each API does in the class files. Need to add that from the PayPal docs for each.

I have done this for UpdateAuthorization already if I need to refer back to a sample of what I mean.

Payments Advanced

Need to add Payments Advanced. The WooCommerce plugin has good examples of the API requests necessary to get this done, so I just need to replicate that functionality within this library.

Missing Classes

When I first use the Library, I receive errors about the following files being missing;

paypal.access.class.php
paypal.here.class.php

Commenting out the includes in paypal.class.php lets the library (seemingly) work correctly.

Code improvements.

Hi Andrew,

Congratulations on the new class, I am using it on codeigniter and works perfectly.

I would like to suggest a small change

Replace (end of function MaskAPIResult($api_result))

    $api_result = '';
    foreach($api_result_array as $var => $val)
    {
        $api_result .= $var.'='.$val.'&';    
    }

    $api_result_length = strlen($api_result);
    $api_result = substr($api_result,0,$api_result_length-1);

for

$api_result = http_build_query($api_result_array);

I do believe that you could replace many of the foreach loops that you have on this class with the http_build_query, as the foreach usage is to create the url to send to paypal.

I used to use the same method until I found this php function.

All the best,
Hortênsio

REST API

Need to figure out the best way to implement the REST API into this library.

Samples / Templates - Config File

When I moved /includes/config-sample.php to /samples I forgot to adjust all of the template files. They're still pointing to /includes/config.php, which no longer exists.

Need to add a separate config file for the samples and templates to use. In fact, in the templates I should probably add them as something like...

include_once('/path/to/config/file.php');

Express Checkout - Funding Failure Recovery

https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec_fundingfailure10486/

Need to build this into the Express Checkout flow. It would go in DoExpressCheckoutPayment. Just need to check for the 10486 error, and if that's what we get simply redirect back to the original RedirectURL that was used after calling SetExpressCheckout.

SEC is already returning a RedirectURL for the developer to use. Need to make this available in DECP one way or another.

Improved Logging

Right now I have a Logger() method that is using a hard-coded file path. Need to enable the ability to set your own file path as well as enable/disable logging altogether.

Need to add Logger() to each API call method. The Logger() method can check $this->EnableLogging (which needs to be passed in to the constructor with the other config data) within it so that it only logs if it is enabled.

Add a filter in Angelleye_PayPal constructor's constructor

Hi,

Will it be possible to add a filter in the first line of the Angelleye_PayPal constructor that's in /plugins/paypal-for-woocommerce/classes/lib/angelleye/paypal-php-library/includes/paypal.class.php ?
You can make it all lowercase if you want.

$DataArray = apply_filters( 'Angelleye_PayPal_Construct_Params', $DataArray );

I am working on a client project and I need to switch between different paypal accounts based on certain conditions.

class Angelleye_PayPal
{

    var $APIUsername = '';
    var $APIPassword = '';
    var $APISignature = '';
    var $APISubject = '';
    var $APIVersion = '';
    var $APIButtonSource = '';
    var $APIMode = '';
    var $EndPointURL = '';
    var $Sandbox = '';
    var $PathToCertKeyPEM = '';
    var $SSL = '';

    /**
     * Constructor
     *
     * @access  public
     * @param   array   config preferences
     * @return  void
     */
    function __construct($DataArray)
    {
        $DataArray = apply_filters( 'Angelleye_PayPal_Construct_Params', $DataArray );

            ................................

Missing RequireInstantFundingSource in Adaptive::Preapproval

This may be a recent addition by PayPal, but Adaptive Payments now includes the option to require the user to have an instant funding source on account, per documentation at: https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/Preapproval_API_Operation/. This can be implemented by adding the following:

Adaptive line 1372:

$RequireInstantFundingSource = isset($PreapprovalFields['RequireInstantFundingSource']) ? $PreapprovalFields['RequireInstantFundingSource'] : '';

Adaptive (altered) line 1415:

$XMLRequest .= $RequireInstantFundingSource != '' ? '<requireInstantFundingSource xmlns="">' . $RequireInstantFundingSource . '</requireInstantFundingSource>' : '';

Thanks!

CURL Configuration in PayPal.php

I ran into a CURL configuration problem while running on centos:
http://bugs.centos.org/view.php?id=5620

I changed line 617 to:
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, "rsa_rc4_128_sha");

The CURL call started working again afterward - but I don't know if this is what you want in your source. Thank you so much for your work!

BetaSandbox Removal

I thought I had these all removed but somebody pointed out I missed some in the Adaptive class. Need to double check everything and get these all out of there.

RemindInvoice Comments

The comments next to the request params were copied from the CancelInvoice template and weren't updated, so they still say "cancelation" instead of "reminder".

Simple fix, just need to adjust the comments.

Documentation (phpDocumentor)

Need to add doc blocks and comment everything so that phpDocumentor can work with it nicely.

Once that's done, install and run phpDocumentor to generate the docs for the library.

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.