Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8596879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:47:09+00:00 2026-06-12T00:47:09+00:00

I am experiencing some really annoying issues with the PayPal Adaptive Payments API. I

  • 0

I am experiencing some really annoying issues with the PayPal Adaptive Payments API. I am trying to embed payments in a lightboxed iframe, I have implemented everything as instructions say. When I go to pay, and click on the button, the lightboxed iframe opens and I execute the payment without problems. However, if I cancel the payment or go through it and get the paymentSuccess called, the checkout page is loaded inside the iframe, which does not get closed. The paymentCanceled is not called at all, since the pino that should be alerted is not shown.

I am showing some code to you, but the fact is that it is taken from a WordPress plugin that is not yet working and I can not therefore show you a “working version” of the page. Anyway, if you needed some more details, just ask and I will try to make them available.

The PayPal javascript

 <script type="text/javascript" charset="utf-8">
            var dgFlow = new PAYPAL.apps.DGFlow({trigger: 'post_pay_counter_paypal_execute_payment'});

            function MyEmbeddedFlow(embeddedFlow) {
                  this.embeddedPPObj = embeddedFlow;
                  this.paymentSuccess = function () {
                       this.embeddedPPObj.closeFlow();
                       // handle payment success here
                       top.close();
                  };
                  this.paymentCanceled = function () {
                       alert('pippo');
                       this.embeddedPPObj.closeFlow();
                       // handle payment cancellation here
                       top.close();
                  }

            }
            var myEmbeddedPaymentFlow = new MyEmbeddedFlow(dgFlow);
   </script>

Thank you all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:47:11+00:00Added an answer on June 12, 2026 at 12:47 am

    I got my problem solved. Here’s the code:

    jQuery(document).ready(function($) {
       //Manage the closing of the iframe when payment is executed/canceled
       if (window != top) {
          top.location.replace(document.location);
       }
    }
    
    //Initialize PayPal embedded payment flow. Now loading it on document ready so that we only have it if user prepares payment, not just loads the page...
    var dgFlow = new PAYPAL.apps.DGFlow({trigger: 'post_pay_counter_paypal_execute_payment'});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experiencing some strange behaviour and I really don't have test date/ environments,
I'm experiencing some really weird object behaviours at the moment. I have this template
I'm experiencing some really weird problems in Python when trying to inherit from a
I'm experiencing something really strange: I have a NSArray category (with some methods I
I'm currently experiencing some problems with my server. I have a pool which is
I am experiencing some problem on UTF-8 Encoding. I have a CSV file and
I'm experiencing some problems while trying to read a binary file in C. This
Im experiencing some really wierd behaviour in IE7. I want to position my <body>
I'm experiencing some really frustrating problems with the asihttprequest. When I run the code
I'm taking over another team's project and am experiencing some bizarre Eclipse issues. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.