#3368 - Usergroup subscriptions don't work through PayPal
| Identifier | #3368 |
|---|---|
| Issue type | Trivial issue (does not break functionality) |
| Title | Usergroup subscriptions don't work through PayPal |
| Status | Closed (no changes needed) |
| Handling member | Chris Graham |
| Addon | ecommerce |
| Description | I've done some investigating, and in ECOM_SUBSCRIPTION_BUTTON_VIA_PAYPAL.tpl:
The 'CMD' variable has a value of '_xclick-subscriptions'. With the use of this value, and once redirected to PayPal's checkout, an error is given: "Things aren't working right now. Try again later." When we change the value to '_s-xclick', we get this error with PayPal: "Some required information is missing." The only way I found to fix this issue is to create a custom button through my PayPal account, and add the button ID defined by an additional variable in the input form: '<input type="hidden" name="hosted_button_id" value="myPayPalButtonID">' HOWEVER, doing this requires me to set the price and other options relating to the subscription through PayPal, including the price and subscription term. Even if these values are set for the usergroup subscription in Composr, this value is ignored and the values set through my PayPal account are favored. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
However, it may be somehow an issue with your settings. Could you attach a screenshot of the usergroup subscription edit screen.
Ideally also paste the HTML for the button (original Composr code) into a note for me to analyse.
(Click to enlarge)
(Click to enlarge)
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="charset" value="{!charset}" />
<input type="hidden" name="business" value="{PAYMENT_ADDRESS*}" />
<input type="hidden" name="notify_url" value="{$FIND_SCRIPT*,ecommerce,1}?from=paypal&type_code={TYPE_CODE*}" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="return" value="{$PAGE_LINK*,_SEARCH:purchase:finish:type_code={TYPE_CODE}:from=paypal}" />
<input type="hidden" name="cancel_return" value="{$PAGE_LINK*,_SEARCH:purchase:finish:cancel=1:from=paypal}" />
<input type="hidden" name="currency_code" value="{CURRENCY*}" />
<input type="hidden" name="custom" value="{PURCHASE_ID*}" />
<input type="hidden" name="a3" value="{AMOUNT*}" />
<input type="hidden" name="p3" value="{LENGTH*}" />
<input type="hidden" name="t3" value="{$UCASE*,{LENGTH_UNITS}}" />
<input type="hidden" name="src" value="1" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" value="1" name="no_note" />
<input type="hidden" value="{!SUBSCRIPTION_FOR,{$USERNAME*},{ITEM_NAME*}}" name="item_name" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="bn" value="ocproducts_SP" />
<div class="purchase_button">
<input style="border: 0px" type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</div>
</form>
(Click to enlarge)
I need to actually hook it up to a test file with the generated data of your site and try and tweak it until it works.
Your details have been stored in our database. Now you may make your payment.
<form title="Make payment" class="left" action="https://www.paypal.com/cgi-bin/webscr" method="post" autocomplete="off">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="business" value="[email protected]" />
<input type="hidden" name="notify_url" value="https://bosslife.org/data/ecommerce.php?from=paypal&type_code=USERGROUP1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="return" value="https://bosslife.org/site/index.php?page=purchase&type=finish&type_code=USERGROUP1&from=paypal" />
<input type="hidden" name="cancel_return" value="https://bosslife.org/site/index.php?page=purchase&type=finish&cancel=1&from=paypal" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="custom" value="1" />
<input type="hidden" name="a3" value="1.99" />
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="t3" value="M" />
<input type="hidden" name="src" value="1" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" value="1" name="no_note" />
<input type="hidden" value="Subscription for jmbronson (Pro Membership)" name="item_name" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="bn" value="ocproducts_SP" />
<div class="purchase_button">
<input style="border: 0px" type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</div>
</form>
</div>
Do you have PayPal set to only accept encrypted forms?
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/encryptedwebpayments/#id08A3I0R00ZJ
This must NOT be enabled.
Also, is it a business account? Subscriptions only work on the PayPal business accounts.
Thanks much!
When viewing the 'subscriptions' module, clicking the 'Cancel subscription' button uses possible outdated variable strings in the URL.
Currently, the variables are:
?cmd=_subscr-details&search_trans_id=
This gave me an error on Paypal:
"Invalid or missing transaction ID. Please select again."
When I pull up the transaction details directly from within PayPal, these are the variables used:
?cmd=_profile-recurring-payments&encrypted_profile_id=
Using the transaction ID for 'encrypted_profile_id' does in fact retrieve the transaction details
Probably it would work if I fixed it to pass the transaction ID instead, but we don't necessarily store that.
So I'll trust your fix.
I'll attach a fixed template to this issue.