php-bitpay-client/examples/tutorial
2017-05-09 16:26:25 +02:00
..
001_generateKeys.php Added refund address, improved examples, made fullNotifications=true default, symfony v3 compatibility fixes 2017-05-09 12:12:36 +02:00
002_pair.php Add IPN processor in tutorial 2017-05-09 16:22:37 +02:00
003_createInvoice.php Add IPN processor in tutorial 2017-05-09 16:22:37 +02:00
IPNlogger.php Add IPN processor in tutorial 2017-05-09 16:22:37 +02:00
README.md Merge branch 'master' into master 2017-05-09 16:26:25 +02:00

Tutorial

==========================

This tutorial contains four scripts:

Script 001 & 002 need to be executed once, to properly configure your local installation.

Actual BitPay invoice creation is done in script 003; this script can be run permanently.

The last script (IPNLogger) processes BitPay's Instant Payment Notifications.

Script 1 & 2: configuring your local installation

The following two scripts need to be executed once. These scripts will generate your private/public keys and pair them to your BitPay merchant account:

  1. 001_generateKeys.php : generates the private/public keys to sign the communication with BitPay. The private/public keys are stored in your filesystem for later usage.
  2. 002_pair.php : pairs your private/public keys to your BitPay merchant account. The result is an API token that can be used to create invoices permanently.

These first two scripts need to be executed only once.

Script 3: creating BitPay invoices

  1. 003_createInvoice.php : creates a BitPay invoice. Please make sure to fill in the API token received from 002_pair.php

Script 4: process IPNs

IPNLogger.php processes IPNs (Instant Payment Notifications). This script should be put on your server and be reachable from the internet. Your should put the URL of IPNLogger.php in your invoice creation script, e.g.:

// You will receive IPN's at this URL, should be HTTPS for security purposes!
$invoice->setNotificationUrl('https://yourserver.com/IPNlogger.php');

For more information about IPNs, please see https://bitpay.com/docs/invoice-callbacks

Testing

To begin, please visit https://test.bitpay.com and register for a test merchant account. If you are looking for a testnet wallet to test with, please visit https://bitpay.com/wallet and create a new wallet.

For more information about testing, please see https://bitpay.com/docs/testing

Examples (c) 2014-2017 BitPay