How to create one hour trial period in paypal - paypal

Paypal's doc says that TRIALBILLINGPERIOD can be set to : Day, Week, SemiMonth, Month, Year
If I select Day and set TRIALBILLINGFREQUENCY to 1/24 (0.041), will it give me 1 hour trial period ?

No. It can only be set to Day, Week, SemiMonth, Month. It can't be set to bill every minute or hour for example.

Related

How to calculate percent through the week / month in google sheets?

I want to calculate how far I am through the week and / or the current month in Google Sheets. What's the best way to do this?
Ideally in a single cell too. I also want to account for the difference in number of days from month to month.
see:
month progress:
=1-(EOMONTH(TODAY(), )+"23:59:59.999"-NOW())/
(EOMONTH(TODAY(), )+"23:59:59.999"-(EOMONTH(TODAY(), -1)+1))
week progress:
=1-((TODAY()+7-WEEKDAY(NOW(), 2)+"23:59:59.999")-NOW())/
((TODAY()+7-WEEKDAY(NOW(), 2)+"23:59:59.999")-(TODAY()-WEEKDAY(NOW(), 2)))
demo sheet
For weekly, I did this by taking the current timestamp (now()) and the timestamp at the beginning of the week and converting both to unix epoch times. Then, I used the difference between them and divided both by the number of seconds in a week (518400) and this gave me a decimal for the percent the now() is through the week.
=((now()-DATE(1970,1,1))*86400-((to_date(TODAY()-weekday(now(),3))
+ timevalue("00:00am"))-DATE(1970,1,1))*86400)/518400
For monthly, I did this similarly to the weekly method but, to account for the differing number of days in different months, I calculated the timestamp at the end of the month in unix epoch time and then subtracted the time at the beginning of the month from this to work out how many seconds are in the current month.
=((now()-DATE(1970,1,1))*86400-((to_date(eomonth(today(), -1)+1)
+ timevalue("00:00am")-DATE(1970,1,1))*86400))/((to_date(eomonth(today(), 0))
+ timevalue("23:59")-DATE(1970,1,1))*86400-(to_date(eomonth(today(), -1)+1)
+ timevalue("00:00am")-DATE(1970,1,1))*86400)

RRULE for every other week except last week of month

I need an RRULE for every other Saturday except the last week of the month. I tried to create one with a weekly frequency, but didn't know how to apply an exception for the last week of the month:
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA
I also tried creating a rule with a monthly frequency, which allowed me to skip the last week of the month, but I didn't know how to make it every other week:
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYSETPOS=-2,-3,-4,-5
I looked through the specification, but I'm not seeing anything that makes this possible.
The secret to the solution here is that BYMONTHDAY can be negative like BYSETPOS. This allows one to exclude the last 7 days of each month even though the number of days in the month varies. Your DTSTART should be on a SATURDAY, so one doesn't really need the BYDAY=SA
This rrule works in google calendar (if DTSTART is on Saturday and generally for any every 2nd week but not the last week rule for any day of week specified by the DTSTART):
RRULE:FREQ=WEEKLY;INTERVAL=2;BYMONTHDAY=-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31
See test calendar:
https://calendar.google.com/calendar/u/0?cid=ZXBwdWE4N2RwZm5xODVic3JydDJzaXFsY3NAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ
Spec: https://datatracker.ietf.org/doc/html/rfc2445#page-43
and
https://icalevents.com/2447-need-to-know-the-possible-combinations-for-repeating-dates-an-ical-cheatsheet/ for the expansion & contraction (limiting) rules & combinations

How to calculate the last week of every month?

I've been having a look around but I can't seem to find anything that answers this question. I want to calculate the date for the last week of every month. For example, the date for the last week of April 2021 is 26-04-2021. I want a date, not a week number.
I use Google Big Query, I do have a calendar table I could use to extract year and month.
Thanks,
Emily
Try date_trunc:
SELECT date_trunc(last_day(month1st, month), week(monday))
from unnest(GENERATE_DATE_ARRAY('2021-01-01', '2021-12-01', interval 1 month)) AS month1st;

PayMill subscription interval regularity

Simple questions, but I can't seem to find the answers in PayMill's API documentation or FAQ:
If a payment subscription is classed as monthly, does it poll for the funds every 30 days or on the anniversary of the month, i.e. set up on 15.4.2014, next payment 15.5.2014?
If it polls on the same date every month, what happens if the subscription was set up on the 31st of the month, i.e. on a date not present in February, April etc?
Thanks.
On the same date. If the interval is 1 MONTH and the first payment occurs on 15.4.2014 the next one will be on 15.5.2014. Note that you can also specify a weekday, in that case it will be the next weekday (e.g. Monday), either the 15.05.2014 (if it's a Monday) or the first Monday after 15.05.2014
It will probably be on the next day (1 March instead of the "missing 31 February". It will definitely not be skipped. If the exact behavior is crucial for your business, please contact the PAYMILL support to seek a definite answer.

Auto-renewable subscriptions: How long a month is?

I got confused about some issues:
1: The one month duration of auto-renewable subscriptions is 30 days or does it depend on a natural month?
Because I can only test in sandbox mode,so the duration is just several minutes...
Maybe Apple just simply calculates it like this: 2013\01\15 -> 2013\02\15 -> 2013\03\15. If so,the second issue comes up
2: For example: I buy a monthly auto-renewable subscriptions at 2013\03\31 ,because 2013\04 only has 30 days, then what is the expires_date of my subscriptions? 2013\04\30 or 2013\05\01 or other date ?
It's adding 1 month, not 30 days. The number of days in 1 month varies. So purchasing a subscription on 3/31 would end on 4/30.
You can use NSDate, NSCalendar, and NSDateComponents to add a month to a date and see how long it will last. More info here: Modifying NSDate to represent 1 month from today
I can confirm this from my own app's data on both iOS and Android.
If someone purchases a monthly renewing subscription on, for example, the 15th of one month, then it will renew on the 15th of the next month, irrespective of how many days were in the month.
If someone purchases the subscription on the 31st of March, then it will renew on May 1st (because April has no 31st day, the renewal date will jump to the next available day in the calendar year - this also applies to February in a leap year, etc).
Given this, and assuming your app's primary income is from subscriptions, over time you should expect to see lower than average sales on the 31st of any given month because there won't be as many renewals. But it is no cause for concern as it is counteracted by the fact that you should expect to see higher than average sales on the 1st of any month that follows a long month anyway. Don't be dissapointed if you check your stats on the 31st of any month.