latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Custom Form Requires Creation of Paypal Acct

Home Forums Community Forum Custom Form Requires Creation of Paypal Acct

This topic contains 4 replies, has 2 voices. Last updated by  Hamid 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 22nd, 2013 at 4:41 pm #39002
Hamid
Username: zawiyaprojects

Hello Support,

A while back you guys helped me create a custom form that would calculate the prorated amount a paid member would have to pay to upgrade to a higher level membership.

Here is what I ended up with and it seem to work fine as far as calculating the prorated fee to upgrade and passing that amount to Paypal.

<?php
$PlusFee = 49.95; // Enter subscription fee for Level 1 membership 
$PremFee = 79.95; // Enter subscription fee for Level 2 membership
$PlusDailyRate = .13685; // Enter daily rate based on level 1 subscription fee divided by 365
$PlusCredit = ((365 - S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS) * $PlusDailyRate);
$PremCharges = $PremFee - $PlusCredit; 
$PremCharges = round($PremCharges,2); //round off number to 2 decimal points
?>

<?php
if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 1){ ?>
	<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 0){ ?>
<a href="[s2Member-PayPal-Button level="2" ccaps="" desc="Prorated Upgrade from Plus to Premier membership for one year for $<?php echo esc_attr($PremCharges); ?>" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.domain.com" ta="0" tp="0" tt="D" ra="<?php echo esc_attr($PremCharges); ?>" rp="1" rt="Y" rr="0" rrt="" rra="1" accept="paypal,visa,mastercard" accept_via_paypal="paypal" image="default" output="url" /]"><center><img src="/images/upgrade_now_v2.gif" border="0" width="250px" height="160px"></center><div class="upgrade">for only $<?php echo esc_attr($PremCharges); ?></div></a><br>
	<?php } ?>
<?php } ?>

The problem that I would like to resolve is that although I have upgraded my Paypal account to Pro, it still requires one to create an Paypal account with their credit card payment when using the above code.

Please note that the s2member generated forms do NOT require a customer to create a Paypal account with their payment.

So what do I need to change in the above code to avoid having to create of a Paypal account with the credit card payment?

Thanks guys!

Just thought to add what it says on the Paypal page

You need a PayPal account for this purchase. 

I already have a PayPal account.
I need to create a PayPal account (where available). Learn more
  • This topic was modified 3 years, 11 months ago by  Hamid.

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday Jan 23rd, 2013 at 7:36 pm #39258
Bruce
Username: Bruce
Staff Member

Thank-you for reporting this important issue.

It appears that this is caused by what you have set up within your accept and accept_via_paypal attributes. When you are using the output=”url” value, your users are always sent to PayPal, and so the accept parameter is not used.

Try instead using this:

<?php
$PlusFee = 49.95; // Enter subscription fee for Level 1 membership 
$PremFee = 79.95; // Enter subscription fee for Level 2 membership
$PlusDailyRate = .13685; // Enter daily rate based on level 1 subscription fee divided by 365
$PlusCredit = ((365 - S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS) * $PlusDailyRate);
$PremCharges = $PremFee - $PlusCredit; 
$PremCharges = round($PremCharges,2); //round off number to 2 decimal points
?>

<?php
if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 1){ ?>
	<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 0){ ?>
<a href="&#91;&#91;s2Member-PayPal-Button level="2" ccaps="" desc="Prorated Upgrade from Plus to Premier membership for one year for $<?php echo esc_attr($PremCharges); ?>" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.domain.com" ta="0" tp="0" tt="D" ra="<?php echo esc_attr($PremCharges); ?>" rp="1" rt="Y" rr="0" rrt="" rra="1" accept="paypal" accept_via_paypal="paypal,visa,mastercard" image="default" output="url" /]]"><center><img src="/images/upgrade_now_v2.gif" border="0" width="250px" height="160px"></center><div class="upgrade">for only $<?php echo esc_attr($PremCharges); ?></div></a><br>
	<?php } ?>
<?php } ?>
Posted: Thursday Jan 24th, 2013 at 4:50 am #39330
Hamid
Username: zawiyaprojects

Thanks Bruce,

I tried the modified code but I still get the same results. I have some screen shots but didn’t see a place to add them.

Basically, a user get redirected to Paypal where it say “Log in to complete your checkout.” There are two option available: 1.) Pay fast with Paypal 2.) No Paypal account? Pay using your debit or credit card.

If you select option 2, you are then presented with page with two options: 1.) I already have a Paypal account. 2.) I need to create a Paypal account (where available). Option 2 provides the fields for the credit card information but one must also create a Paypal account :(

Any other suggestions?

Thanks

Posted: Friday Jan 25th, 2013 at 2:20 pm #39528
Bruce
Username: Bruce
Staff Member

Thanks for the follow-up.

Looking at your shortcode, I realize now that you are using a recurring subscription.

The reason this is now happening is because PayPal requires a PayPal account for recurring subscriptions (except for a few exclusions that I’ll explain below).

What I’d recommend doing here is instead use a s2Member Pro Form instead of a link from a PayPal Button. Because you already have PayPal Pro, there really is not any reason that you could not use the Pro Forms here just as well.

Updated code to work with a Pro Form would look like this:

<?php
$PlusFee = 49.95; // Enter subscription fee for Level 1 membership 
$PremFee = 79.95; // Enter subscription fee for Level 2 membership
$PlusDailyRate = .13685; // Enter daily rate based on level 1 subscription fee divided by 365
$PlusCredit = ((365 - S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS) * $PlusDailyRate);
$PremCharges = $PremFee - $PlusCredit; 
$PremCharges = round($PremCharges,2); //round off number to 2 decimal points
?>

<?php
if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 1){ ?>
	<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 0){ ?>
[s2Member-Pro-PayPal-Form level="2" modify="1" ccaps="" desc="Prorated Upgrade from Plus to Premier membership for one year for $<?php echo esc_attr($PremCharges); ?>" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.domain.com" ta="0" tp="0" tt="D" ra="<?php echo esc_attr($PremCharges); ?>" rp="1" rt="Y" rr="0" rrt="" rra="1" accept="paypal,visa,mastercard" accept_via_paypal="paypal" /]
	<?php } ?>
<?php } ?>

If, however, you’re set on using a link like you had set up in your original post, you will need to do one of two things.

The first is that you can continue using your code as-is, and have PayPal enable Enhanced Recurring Processing (ERP), which is another $20 a month. This is something that we really do not like recommending, except in this specific circumstance. This is because ERP has a couple flaws that can cause more issues after the fact.

The biggest problem with ERP is that enabling this makes it so that your customers have no way to cancel their subscription with you other than writing in or calling you, to have you cancel their subscription for you. s2Member’s cancellation forms do not work with ERP, which is a limitation on PayPal’s part.


Alternatively, you could change your PayPal button to be a Buy Now button, for 1 year, non-renewing. To do this you’d change your rr attribute to BN:

<?php
$PlusFee = 49.95; // Enter subscription fee for Level 1 membership 
$PremFee = 79.95; // Enter subscription fee for Level 2 membership
$PlusDailyRate = .13685; // Enter daily rate based on level 1 subscription fee divided by 365
$PlusCredit = ((365 - S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS) * $PlusDailyRate);
$PremCharges = $PremFee - $PlusCredit; 
$PremCharges = round($PremCharges,2); //round off number to 2 decimal points
?>

<?php
if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 1){ ?>
	<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 0){ ?>
<a href="&#91;&#91;s2Member-PayPal-Button level="2" ccaps="" desc="Prorated Upgrade from Plus to Premier membership for one year for $<?php echo esc_attr($PremCharges); ?>" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.domain.com" ta="0" tp="0" tt="D" ra="<?php echo esc_attr($PremCharges); ?>" rp="1" rt="Y" rr="BN" rrt="" rra="1" accept="paypal" accept_via_paypal="paypal,visa,mastercard" image="default" output="url" /]]"><center><img src="/images/upgrade_now_v2.gif" border="0" width="250px" height="160px"></center><div class="upgrade">for only $<?php echo esc_attr($PremCharges); ?></div></a><br>
	<?php } ?>
<?php } ?>

Your users should then be able to pay with a credit card through PayPal as you’d like, but they will need to renew manually when they are revoked access.


This being said, I would strongly recommend using the s2Member Pro Forms with PayPal Pro, as you already have it set up.

Please let us know if problems persist. :-)

  • This reply was modified 3 years, 11 months ago by  Bruce. Reason: Escaping URL in last example
Posted: Friday Jan 25th, 2013 at 3:20 pm #39541
Hamid
Username: zawiyaprojects

Bruce, you rock… thanks so much for your multi-option solution.

I ended up going with the last option because I want to use our custom image AND I don’t want “prorated upgrades” to be recurring.

Thanks again, I can finally let this rest and move on to other tweaks :)
Hamid

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.