Developer's Guide

Table Of Contents
Adaptive Payments Developer Guide August 7, 2012 255
Adaptive Payment Commands and Redirects
Embedded Payment Flow Redirect
JavaScript Functions for Embedded Payments
You must include https://www.paypalobjects.com/js/external/dg.js for a
lightbox or https://www.paypalobjects.com/js/external/apdg.js for a
minibrowser on any page that invokes or terminates the embedded payment flow. The
JavaScript functions in dg.js and apdg.js set up and control the PayPal login and payment
experience.
Function and Signature Description
PAYPAL.apps.D GFlow = function
(trigger: null, expType: null)
Sets up the embedded payment flow, where trigger is one or more
HTML ids of events that trigger the flow and expType is one of the
following experience type requests:
light requests that the embedded payment flow displays in a
lightbox (default)
mini requests that the embedded payment flow displays in a
minibrowser
PayPal handles other values, including misspellings, as light.
Opening a minibrowser in a lightbox causes errors during the flow.
NOTE: PayPal does not honor the lightbox experience request if the
sender is required to log into PayPal.
setTrigger: function (
id) Add a trigger for the flow, where id is the HTML id of the event that
triggers the flow. The flow must first be set up by calling
PAYPAL.apps.DGFlow.
startFlow: function (
url) Explicitly start the embedded payment flow, where url is the URL
that triggers the flow.
NOTE: You are only required to explicitly start the flow when there
is no triggering event; for example, when you want to
associate the embedded payment flow with playing a Flash
movie.
closeFlow: function () Close the minibrowser or lightbox associated with the flow. Use this
function after the sender completes or cancels the payment.
NOTE: In addition to calling this function, you must explicitly close
the PayPal window using the close() JavaScript function.
isOpen: function () Determine whether the minibrowser or lightbox is still open.