Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.05 KB

fastspring-how-to-create-a-license-key-with-a-specific-expiry-date-in-fastspring.md

File metadata and controls

24 lines (19 loc) · 1.05 KB

FastSpring - How to create a license key with a specific Expiry Date in FastSpring

The procedure below describes how to order a product via FastSpring with a specific expiry date. In this example, the expiry date is set to one year from the date of order but you can change the value in the script.

  • Create a product in FastSpring.
  • Asd a fulfillment action:
    • Select the "Generate a License" option.
    • Select Script (PHP or JavaScript).
    • Set the Output Format to: Single-Line License (Quantity Based).
    • Set the License Name to: Person Name.
    • Set the Script Type to: JavaScript
    • Click Create.
    • Copy paste the attached script.
    • Click Save.
  • Test your order from FastSpring

In the script, you can change the duration of the expiry date by modifying this line:

//
// Set the expiry to one year from today
//
endDate.setMonth(endDate.getMonth()+12);