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.

PayPal Recurring Billing on 1st of Month

Home Forums Community Forum PayPal Recurring Billing on 1st of Month

This topic contains 5 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years ago.

Topic Author Topic
Posted: Wednesday Jan 2nd, 2013 at 6:03 am #35960

Dear Support,

Our membership is by calendar month.

Is there a way to have PayPal Pro recurring billing occur on the 1st of each month?

Also, the 1st month’s payment depends on the day they sign up. I’ve written some PHP code to calculate the first month’s fee (partial month depending on number of days remaining in the signup month) and insert it into the shortcode, but if I make the trial period X number of dollars for X number of days, Paypal is charging payments daily instead of one lump sum. I can make the initial trial period a month for that partial month fee, but the monthy recurring day is the anniversary of their signup.

How do I get this to work?

Thanks.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Thursday Jan 3rd, 2013 at 3:03 am #36062

Hi Carl.

The initial term would be for the remaining days in the month, like you say, that if it’s charging daily you may have used the regular term set to 1 day…

Could you post the shortocde with your PHP too? Put it inside HTML [hilite mono]<[/hilite][hilite mono]code>[/hilite] tags, please.

Posted: Thursday Jan 3rd, 2013 at 8:52 am #36105

Hi Cristian,

Thanks for your response. Here is the PHP and shortcode I am currently testing. PayPal charges the 1st month’s prorated payment, but I think the next payment date is on the anniversary of the day the member signed up (a month has not gone by, so I can’t test the next billing cycle).

This PHP:

date_default_timezone_set('America/New_York');
$days_in_month = date("t");
$price_per_day = round(10/$days_in_month, 2);
$days_left = date('t') - date('j');
$prorated_payment = round($days_left * $price_per_day, 2);
echo do_shortcode('[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="1A Membership: This month prorated @ $' . number_format($prorated_payment,2) . ', then $10.00/Month (recurring charge, for ongoing access)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.healthsuccesscenter.com" ta="' . number_format($prorated_payment,2) . '" tp="1" tt="M" ra="10.00" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="clean" /]');

Generates this shortcode:

[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="1A Membership: This month prorated @ $8.96, then $10.00/Month (recurring charge, for ongoing access)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.healthsuccesscenter.com" ta="8.96" tp="1" tt="M" ra="10.00" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="clean" /]

…….
The next shortcode has us charging a fee per day for the remaining days in the month, which will get us to the monthly billing on the 1st of the next month, but PayPal is making charges DAILY to the member’s card (which will be annoying to the member and VERY expensive for me).

[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="1A Membership: 28 Days @ $0.32 / then $10.00 USD / Monthly ( recurring charge, for ongoing access )" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.healthsuccesscenter.com" ta="0.32" tp="28" tt="D" ra="10.00" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]

I need the best of both versions for it to work for me: charge a flat fee for the remaining number of days in the month, then start the regular monthly billing cycle on the 1st of the months going forward.

What I need is for PayPal to charge a flat fee today, then start the regular monthly billing cycle on the 1st of the next month.

Posted: Saturday Jan 5th, 2013 at 6:51 am #36245

Got it.

The trial term and period were wrong in your shortcode, you have it as 1 month, when it should be the the days left in the month: [hilite code]tp="' . $days_left . '" tt="D"[/hilite].

You can try this:

[hilite pre_code]
date_default_timezone_set('America/New_York');
$days_in_month = date('t');
$days_left = $days_in_month - date('j');
$prorated_payment = number_format((10 / $days_in_month * $days_left), 2);
echo do_shortcode('[[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="1A Membership: This month prorated @ $' . $prorated_payment . ', then $10.00/Month (recurring charge, for ongoing access)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.healthsuccesscenter.com" ta="' . $prorated_payment . '" tp="' . $days_left . '" tt="D" ra="10.00" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="clean" /]]');
[/hilite]
Posted: Sunday Jan 6th, 2013 at 11:00 am #36383

Brilliant, Cristian! I works! Thank you!

Thank you for streamlining my PHP, too.

Posted: Monday Jan 7th, 2013 at 9:21 pm #36530

Cool! Glad I could help. :)

Viewing 5 replies - 1 through 5 (of 5 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.