i'd like to integrate PayPal's DigitalGoods flow for my micropayments. I've already managed to integrate the standard flow for Adaptive Payments with opening a new window, but now I have to integrate the embedded flow using the lightbox.
I haven't worked with JavaScript yet, so I have some troubles with it. Paypal integration guide says:
I've done it that way:
1 created a FormPanel with two "Hidden" widgets and one SubmitButton
public class PayPalLightbox extends FormPanel{
VerticalPanel vert = new VerticalPanel();
public PayPalLightbox(String authUrl, String payKey){
super("PPDGFrame");
setAction(authUrl + "?paykey=" + payKey);
setWidget(vert);
Hidden expTypeField = new Hidden("expType", "light");
vert.add(expTypeField);
Hidden payKeyField = new Hidden("paykey", payKey);
vert.add(payKeyField);
SubmitButton submitBtn = new SubmitButton("submitBtn");
submitBtn.setVisible(false);
vert.add(submitBtn);
}
2. Added <script src="https://www.paypalobjects.com/js/external/dg.js" </script> to my project.html
3. Created in PayPalLightbox class the method: private native void showLightbox() /*-{
var dgFlow = new $wnd.PAYPAL.apps.DGFlow({
trigger: "submitBtn"
});
}-*/;
and called it:
(...) ppLB= new PaypalLightBox(...)
ppLB.showLightbox()
that causes following error when calling showLightbox:
com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(37782), JavaScript object(37674), JavaScript object(37785)]): Cannot read property 'apps' of undefined
I've searched groups how to deal with it the whole day, but didn't found a soulution yet. Any help would be greatly appreciated.
Thanks in advance!
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment