2017 © Pedro Peláez
 

library coinpayments-ipn

Simple and straight forward Coinpayments IPN

image

ronmelkhior/coinpayments-ipn

Simple and straight forward Coinpayments IPN

  • Wednesday, March 8, 2017
  • by RonMelkhior
  • Repository
  • 1 Watchers
  • 4 Stars
  • 638 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

Introduction

Coinpayments-IPN is a simple PHP package that lets you easily handle IPN requests from Coinpayments, without any hassle., (*1)

Disclaimer

At the moment, this package only supports the HTTP Auth IPN method in Coinpayments., (*2)

Usage

First of all, install the package via Composer:, (*3)

composer require ronmelkhior/coinpayments-ipn

Then add in the IPN to your code like so:, (*4)

<?php

use RonMelkhior\CoinpaymentsIPN\IPN;

$ipn = new IPN();

Once you initialize the IPN class, you need to setup the merchant ID & IPN secret with the setMerchantID and setIPNSecret methods., (*5)

<?php

use RonMelkhior\CoinpaymentsIPN\IPN;

$ipn = new IPN();
$ipn->setMerchantID('your-id-here')
    ->setIPNSecret('your-secret-here');

Then, you can validate the IPN with the validate method, which you need to provide your $_POST and $_SERVER arrays to., (*6)

<?php

use RonMelkhior\CoinpaymentsIPN\IPN;

$ipn = new IPN();
$ipn->setMerchantID('your-id-here')
    ->setIPNSecret('your-secret-here');

try {
    if ($ipn->validate($_POST, $_SERVER)) {
        // Payment was successful, verify vars such as the transaction ID/email and process it.
    } else {
        // IPN worked, but the payment is pending.
    }
} catch (RonMelkhior\CoinpaymentsIPN\Exceptions\InvalidRequestException $e) {
    // The IPN data was not valid to begin with (missing data, invalid IPN method).
} catch (RonMelkhior\CoinpaymentsIPN\Exceptions\InsufficientDataException $e) {
    // Sufficient data provided, but either the merchant ID or the IPN secret didn't match.
} catch (RonMelkhior\CoinpaymentsIPN\Exceptions\FailedPaymentException $e) {
    // IPN worked, but the payment has failed (PayPal refund/cancelled/timed out).
}

The Versions

08/03 2017

dev-master

9999999-dev

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

08/03 2017

v1.0.5

1.0.5.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

12/02 2017

1.0.4

1.0.4.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

17/01 2017

1.0.3

1.0.3.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

04/01 2017

1.0.2

1.0.2.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

21/10 2016

1.0.1

1.0.1.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

21/10 2016

1.0.0

1.0.0.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior

21/10 2016

1.0

1.0.0.0

Simple and straight forward Coinpayments IPN

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ron Melkhior