A Flash Developer Resource Site

Page 4 of 6 FirstFirst 123456 LastLast
Results 61 to 80 of 118

Thread: Flash and Paypal?

  1. #61
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    its no problem..and really not hard... a 'key' piece of sending & loading data (like text or variables for example)..is using a loadVar Object. there is a link in my footer that explains how to create & use a loadVar Object (the link is called varObject)..

    its only a few lines of code..and once you read it it will be clear on hwo to use it.

    3 basic steps.

    1.) create/define the new varObject (name it)
    2.) tell it what to do ONCE the data 'is' loaded...
    3.) finally make the call to the 'data'..(so if it loads correctly..do #2 above)

    once you understand that..you use it for PayPal..

  2. #62
    Banned
    Join Date
    Jul 2006
    Posts
    8

    Flash and PayPal

    Check out my Flash Shopping Cart and PayPal system.

    This URL has been considered spam.

    Enjoy.

    Last edited by gerbick; 07-26-2006 at 03:34 PM. Reason: Spammy spam spam...

  3. #63
    Junior Member
    Join Date
    Jun 2006
    Posts
    23
    Wow. Superb!
    I don't suppose you feel like sharing the source do you?

  4. #64
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    you have all the resources here do make your own...

    granted I didnt really check it out in depth...but I dont see could be unique to any other one.

    And hes trying to sell it... (so I doubt source code will be free)

  5. #65
    Junior Member
    Join Date
    Jun 2006
    Posts
    23
    Wait, I thought this was a "flash help" forum, not free advertising space...
    Well then, that's the sort of "flash help" I'd rather do without

    And resources are only beneficial to people who have the tools to make use of them.
    (Like a knowledge of actionscript, which I myself do not possess :P )

  6. #66
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    you can download my flash-paypal shopping cart from my library..hope it helps..
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  7. #67
    Junior Member
    Join Date
    Jun 2006
    Posts
    23
    Dude zain, dog's bollocks! Thank you a thousand times for your contribution to the flash community. It really gives me something to get my hands into, and see how the mechanics of the whole process work. Of course, I'm going to be modifying it quite a bit, but I'll be sure to give credit where credit is due.

    Cheers
    Last edited by relicpro; 07-13-2006 at 11:36 AM.

  8. #68
    Banned
    Join Date
    Jul 2006
    Posts
    8
    We're going to provide screenshots, video f.a.q., and a user forum up in the next two weeks.

    FYI: You only have to change the variables "price, product name, and an image" to begin selling/using this FlashCart.

    BTW: Nice drag n drop FlashMatics.

  9. #69
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    yw guys glad i could help
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  10. #70
    Member
    Join Date
    Oct 2005
    Posts
    84
    Hey, I have been trying to create a flash cart now for a few weeks, it is so hard! I tried to download your one silentweed from your library, but it wont open in my flash!

    Is there something wrong with the link?

  11. #71

  12. #72
    Member
    Join Date
    Oct 2005
    Posts
    84
    It says something like this:

    Failed to open document.MacintoshHDesktop:Shoppingcart

    I am using Flash MX 6.0

  13. #73

  14. #74
    Member
    Join Date
    Oct 2005
    Posts
    84
    Yes

  15. #75
    Member
    Join Date
    Oct 2005
    Posts
    84
    Is the file corrupt? Can anyone email it to me? candy@candyxcarousel dot com

  16. #76
    knyce6b
    Join Date
    Apr 2007
    Location
    NY
    Posts
    2
    Quote Originally Posted by marshdabeachy
    Okay, here's the function I have. Bear in mind that this is being handled the way I'm storing records internally within Flash; you'll very likely have to loop through your cart differently.

    Code:
    function checkout() {
    	checkMC = new LoadVars();
    	checkMC.rand = random(99999);
    	checkMC.cmd = "_cart";
    	checkMC.upload = "1";
    	checkMC.business = "sendto@email.com";
    	checkMC.currency_code = "USD";
    	checkMC.amount = total.text.substr(1, total.text.length-1); //amount in decimal (eg 32.45)
    	for (var i = 0; i<cartRef.records.length; i++) {
    		var num = i+1;
    		checkMC["item_name_"+num] = cartRef.records[ i].part; // part name
    		checkMC["quantity_"+num] = cartRef.records[ i].quantity; // part quantity
    		checkMC["amount_"+num] = cartRef.records[ i].price; // part price
    		checkMC["on0_"+num] = "Unit price: $"+cartRef.records[ i].price; // optional field 1
    		checkMC["on1_"+num] = "Count: "+cartRef.records[ i].count; // optional field 2
    	}
    	checkMC.send("https://www.paypal.com/cgi-bin/webscr", "_blank", "POST");
    }
    Basically, item_name_X, quantity_X, and amount_X are the important things for each item. X must start at 1 and increase sequentially.
    I appreciate the code below. Helped alot. But now I have a question. While the customer is on my website and adding products to the cart, I am obviously saving the data. Once the customer clicks on "CheckOut", I have the data sent to Paypal (no problem), however, I want to know when and how do I ClearOut the cart Locally on my website? The only way I would want to clear my Local Cart, is if the customer successfully purchased my product. Is there a return code that Paypal sends back to my site stating that the customer successful purchased my product, which in turn, I would clear the cart on my site?

    I don't want to clear the customers cart unless they went through all the motions of buying the product. Any ideas?? Thanks!

  17. #77
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Are you using the regular PayPal option? Or are you using the PayPal Pro that is now available?

    if you want a return, or check out without leaving yoru site..you need to use Pro.. otherwise.. I believe in standard mode you can give a return URL to go to after check out.. however I doubt you'll be able to keep the users data locally and clear this way.

  18. #78
    knyce6b
    Join Date
    Apr 2007
    Location
    NY
    Posts
    2
    I don't know yet since I have not upgraded my account to a business account. I haven't purchased a domain yet... therefore everything is being done locally on my PC. In any case, how would I specify the code for the return URL?

    would it be something like...

    checkMC.return = "http://www.mywebsite.com/successCOut.html"

    and send this to PayPal along with all my other LoadVars?

    Thanks!

  19. #79
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    you'll have to check paypal site and go over the parameters you can send.. one of the is the return URL.. Im not sure what it is off the top of my head.

  20. #80
    Member
    Join Date
    Apr 2007
    Posts
    73
    I've read this whole thread and checked out a ton of sites only to discover this is NOT an easy thing for the newbie. There are really no simple tutorials out there.

    Nevertheless, I downloaded silentweed's fla from his site entitled "Flash/Paypal Shopping Cart". Here's the URL: http://www.experiments.flashmatics.co.uk/#


    It's very easy to plug into my own site and change images and such, but I want to change some of the functionality. Rather than drag the product icon onto the basket I want users to click a "buy now" button of my own creation and have the same effect. (Table is populated with info.) I'm guessing this is quite easy for someone who knows their way aroung actionscript. He's made it pretty clear as to what parts are for the drag function, but after removing those I don't know what to ADD to create the desired functionality. Take a look at his file- here's the script:



    //------------------------------------- CUSTOMISE THE FOLLOWING -------------------------//

    var lvSend:LoadVars = new LoadVars();//do not change
    lvSend.business = "email@email.com"; //your paypal email address here
    lvSend.currency_code = "USD"; //the currency you would like to use



    //define items, their prices, quantity in basket and there associated movieclips
    var aItem:Array = new Array();
    aItem["book"] = {instance:mcBook, price:15, quantity:0};
    aItem["clapper"] = {instance:mcClapper, price:58, quantity:0};
    aItem["drum"] = {instance:mcDrum, price:22, quantity:0};
    aItem["shield"] = {instance:mcShield, price:13, quantity:0};
    aItem["feather"] = {instance:mcFeather, price:2, quantity:0};


    //-----------------------DO NOT CHANGE UNLESS FAMILIAR WITH ACTIONSCRIPT--------------------//


    var totalPrice:Number;

    //define drag and drop functionality
    for (var i in aItem) {
    var currentProduct:String = i;
    aItem[i].instance.id = currentProduct;

    aItem[i].instance.onPress = function() {
    this.swapDepths(_root.getNextHighestDepth());
    this.origX = this._x;
    this.origY = this._y;
    this.startDrag();
    };

    aItem[i].instance.onRelease = function() {
    this.stopDrag();
    if (checkDropLocation(this)) {
    //it has been added to basket so increase quantity in basket
    aItem[this.id].quantity++;

    //update datagrid
    updateDatagrid();

    //also send it back to its original position and fade it in
    this._alpha = 0;
    reposition(this);
    fadeIn(this);

    //let user know it has been added to basket

    } else {
    //not in basket so send it back to its original position
    reposition(this);
    }
    };

    aItem[i].instance.onReleaseOutside = aItem[i].instance.onRelease;
    }


    mcPaypal.onRelease = function():Void{
    //send variables to paypal

    //CONSTANTS
    lvSend.cmd = "_cart";
    lvSend.upload = "1";

    var j:Number = 1;
    for (var i in aItem) {
    if(aItem[i].quantity > 0){
    lvSend["item_name_"+j] = aItem[i].instance.id;
    lvSend["amount_"+j] = aItem[i].price;
    lvSend["quantity_"+j] = aItem[i].quantity;
    j++;
    }

    }
    lvSend.send("https://www.paypal.com/cgi-bin/webscr", "_self", "POST");
    }


    //--------------------------------------- functions ----------------------------------------------//

    function checkDropLocation(movie:MovieClip):Boolean {
    if (movie.hitTest(mcBasket)) {
    return true;
    }
    return false;
    }

    function reposition(movie:MovieClip):Void{
    movie._x = movie.origX;
    movie._y = movie.origY;
    }

    function fadeIn(movie:MovieClip):Void{
    movie.onEnterFrame = function():Void{
    this._alpha +=10 ;
    if(this._alpha == 100){
    delete this.onEnterFrame;
    }
    }
    }

    function updateDatagrid():Void{
    totalPrice = 0;
    var aBasket:Array = new Array();
    for (var i in aItem) {
    if(aItem[i].quantity > 0 ){
    aBasket.push({Product: aItem[i].instance.id, Quantity: aItem[i].quantity, Price: aItem[i].price * aItem[i].quantity });
    totalPrice += aItem[i].quantity * aItem[i].price;
    }
    }

    basketInfo.dataProvider = aBasket;
    basketInfo.vScrollPolicy = "auto";
    tTotal.text = totalPrice;
    }


    THANKS!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center