7 Replies Latest reply on Nov 2, 2015 10:48 AM by kglad

    PayPal payment

    lorenzom5479603

      Hello guys. I've made a Flash store in which, if you click a specific button, I would like the customer to proceed to checkout through PayPal. This is my code for the "Proceed transaction" button so far.

       

        var url:String = "https://www.sandbox.paypal.com/cgi-bin/webscr";

        var payPal:URLRequest = new URLRequest(url);

       

        variables.cmd = "_xclick";

        variables.business = "....."; // your merchant email at paypal

        variables.item_name = itemName; // Name of the product

        variables.item_number = ""; // Leave blank if item has no number

        variables.amount = removeNonNumericChars(totalPrice.text) + ".00";

        variables.paymentaction = "authorization";

        variables.no_shipping = "2";

        variables.no_note = "1";

        variables.currency_code = "USD";

        variables.lc = "US";

        variables.bn = "PP-BuyNowBF";

       

        payPal.data = variables;

        payPal.method = URLRequestMethod.POST;

       

        navigateToURL(payPal, "_blank");

       

      I would like the customer to be brought back to the initial page after checkout. So, after he's paid, the PayPal page must close and there has to be a function, in my .swf file, that's called and that lets me edit something in the stage - like a "Transaction completed!" popup message - and let the user know his transaction has completed successfully.

       

      Any ideas?

      thank you.