Some recommended exercises for furthering your knowledge of Adaptive Payments include:
Use a tool such as diff
to compare the baseline
Tweet Relevance project to the modified project from this chapter.
On a Linux system, for example, the following options for
diff
produce a convenient side-by-side display on a
terminal with 237 columns when executed from the root of the source
tree:
$ diff --recursive --side-by-side
--suppress-common-lines --width=237 --exclude=*.pyc appa
ch04
As always, read the man
page or documentation for
the utility you’re using to ensure that you’re taking advantage of
all of the features that you have available to you.
Modify the example code to implement a parallel payment such
that a portion of every payment is donated to a list of prepopulated
charities. Why is a parallel payment arguably a more appropriate
choice for this situation than a simple or chained payment?
(Implementation hint: recall that donating money to a charity with
PayPal is as simple as sending money to an email address, so this is
essentially as easy as specifying a receiver from a simple HTML
control such as a SELECT
box.)
Modify the example code to implement an embedded adaptive payment, mimicking the payment flow as implemented with Express Checkout for Digital Goods.
All sample code for this book is available online at GitHub and is conveniently organized by chapter. Although much of the code is included in the text of this book so that it’s as instructional as possible, always reference the latest bug-fixed code on GitHub as the definitive reference for sample code. Bug tickets and patches are welcome!