amasty/paypal-nvp-api

Simple paypal nvp api integration

1.0.0 2018-08-14 13:00 UTC

This package is not auto-updated.

Last update: 2024-12-22 06:32:02 UTC


README

Simple paypal nvp api integration

Build Status Travis

Requirements:

  • PHP >= 7.1.3
  • ext-curl

Installation:

composer require amasty/paypal-nvp-api

Example

<?php
// @see https://developer.paypal.com/docs/classic/api/
use PaypalNvpApi\Client;

$client = new Client(
    'paypal username',
    'paypal password',
    'paypal signature',
    true // use sandbox
);

// If something is wrong, Exception will be thrown
$client->call('ManageRecurringPaymentsProfileStatus', [
    'PROFILEID' => 'I-PB2SG17EAY4N',
    'ACTION' => 'Cancel',
]);
<?php
// @see https://developer.paypal.com/docs/classic/products/instant-payment-notification/
use PaypalNvpApi\IpnVerifier;

$ipnVerifier = new IpnVerifier($_POST);
// If something is wrong, Exception will be thrown
$ipnVerifier->validate();