Hi Mark,
To make the subscription works, you should log as a Host (SuperUser) and then go to Host > SQL. Paste the following code (with the required changes, see below my explanations) in the text box, select 'Run as Script' and click 'Execute'.
THE SCRIPT CODE:
insert into {databaseOwner}{objectQualifier}PortalSettings ( PortalID, SettingName, SettingValue )
values (n, 'paypalsubscriptionreturn', 'return_url_after_payment');
insert into {databaseOwner}{objectQualifier}PortalSettings ( PortalID, SettingName, SettingValue )
values (n, 'paypalsubscriptioncancelreturn', 'cancel_return_url');
insert into {databaseOwner}{objectQualifier}PortalSettings ( PortalID, SettingName, SettingValue )
values (n, 'paypalsubscriptionnotifyurl', '');
You HAVE to replace the red parts before to paste this script in the text box! Following explanations:
- n: number of the concerned Portal
- return_url_after_payment: URL of the page on which the user must be redirected after payment.
- cancel_return_url: URL of the page on which the user should be referred if clicked Cancel on the PayPal website.
URL parameters have to be fully qualified, like: http://www.yourdomain.tld/path/to/your/page.aspx. If an url parameter is empty, then the home page url is used instead.
Ideally, the return after payment url should be the access page to your services. While the return url on cancellation should be a page on which you have taken care to place a text/HTML module with a text explaining that due to the cancellation your services are not accessible.
Alternatively, you can add those settings directly to the db in the PortalsSettings table.
Last detail, you should not specify an url for the parameter 'paypalsubscriptionnotifyurl', unless you write your own PayPal IPN processing page. Look at the original page code in ...\admin\Sales\paypalipn.aspx.vb.
Finally, you can't use the PayPal sandbox without changing code in PayPalSubscription.aspx.vb in the ...\admin\Sales\ folder. Because the PayPal page url is hardcoded in the code. Use the following url to use the sandbox: https://www.sandbox.paypal.com/cgi-bin/webscr/
EDIT: You have to use the sandbox url in the PayPalIPN.aspx.vb page code too! Whitout this change, the role will be never added because the IPN can't verify and validate the payment.
Remember to log to the developer Paypal website before submit payment to the sandbox!
Gilles