views:

81

answers:

2

I am trying to implement paypal payment in as3. But the return variable conflicts with an as3 keyword. So how to set return variable for returning from paypal to merchant site.

A: 

This will be difficult to answer since you've not stated the type of API that you are using with Paypal but I'll just answer with the most used system atm.

The return variable may be defined as a string so you should be able to assign it's value to any variable name of your choice. For example, if you are getting a responce from the API as a url encoded string such as:

accepted=true&redirect=newpage.htm&class=test

This entire thing is simply a string, so you could split the string and/or manipulate it however you desire, when using AS3, you might be storing them as a VO, you can itterate the VO objects and reassign their variable names since the way that AS3 stores these is within a dynamic class.

If you need more help, you will need to explain your particular issue more thoroughly or post some of your code so I get get a better idea of what you are trying to do :)

RipX

Gary Paluk
A: 

Just because a property name conflicts with compiler keywords, does not make it impossible to use it:

 object["return"] = value;
 object["void"] = value;

Basically you can use any reserved keyword as property name. I think that should solve your problem.

amn