Additional Form Variables

Sometimes, you may find that you need to add additional Html Form Variables that needs to be passed to PayPal but no existing Properties of the control create those html form variables. For example, say you were told by PayPal that

If a credit card is already linked to a PayPal account, the user will have to log in to his account to proceed for security requirements. Then you can add / edit these blocks in the source code of your buttons to get the tab "pay by card" unfolded by default

<input type="hidden" name="solution_type" value="Sole" />
<input type="hidden" name="landing_page" value="Billing" />

Now, the question is, how would you tell the control to add these form variables ? There are no Properties in this control that create these html form variables. In order to support such scenario, the control comes with a Collection Type property named AdditionalFormVariables which can be edited both in Design Time (Web Form Scenario) Collection Editor and Run Time (programmatically).

Here is the screenshot of that collection editor that creates these 2 extra variables.


Once you have done so on a BuyNow Button, the generated HTML will contain these new variables as shown below:


This feature can be utilized when PayPal add some new variables for more features but say we did not encapsulate the new feature in our latest version. In that case, you may not need to wait to use those new feature until the time we release a new version, rather you can use this AdditionalFormVariables property to add the new variables and keep using our control as usual.

Last updated on Jun 25, 2014