I'm still trying to skin the same cat: Controlling order of javascript execution PayPal Objects
In short, I have a database of digital songs for purchase. I would like to have an ever changing list of, say 50 songs for purchase.
The docs Paypal has are pretty crummy IMO. And the examples -everyone- seems to use require hard coding the ID of the element (button) you want to sell because you need a script in the footer of your page to actually 'trigger' the call to PayPal
<script type="text/javascript">
var embeddedPPFlow1 = new PAYPAL.apps.DGFlow( {trigger : 'buysong_1'});
</script>
...so if you have 50 'Buy' buttons, you would need to declare 50 PAYPAL.apps.DGFlow objects in the footer at load time and they have to, of course, have the correct IDs. This makes pulling different items from a database a bit tricky (not to mention making for very heavy pages.)
PayPal docs indicate one should be able to get around this by using a single object but with a URL and the startFlow method instead of the trigger, but there is no example on their site and I can find no working examples on the interweb.
embeddedPPFlow = new PAYPAL.apps.DGFlow();
// url = (paypal url?)
this.embeddedPPFlow.startFlow(url);
But I don't get what the URL should be... Is it the Token one gets from PayPal? If so, how does one get the token -before- calling PayPal NVP?
In short: does -someone- have a working example of this, or know how to use startFlow with a dynamically assigned buy button? I've tried posting on the X developer forum and got no responses.