Paypal - billing cycle length? - paypal

Nothing is more confusing to me than PayPal documentation..
Basically I am trying to set a recurring payment. Each month pay 400.50 Euro for 'Membership' Of course the button they provided failed, but I found some examples and came up with:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="example#example.com">
<input type="hidden" name="return" value="http://www.example.com">
<input type="hidden" name="cancel_return" value="http://www.example.com">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="Membership" />
<input type="hidden" name="src" value="1"> <!-- recurring=yes -->
<input type="hidden" name="sra" value="1"> <!-- reattempt=yes -->
<input type="hidden" name="p3" value="1"> <!-- billing cycle length -->
<input type="hidden" name="a3" value="400.50" />
<input type="hidden" name="t3" value="M">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
What value should"billing cycle length" be - now default 1?
Does this mean once the user clicks my button - a payment will be extracted every month or it will only work one time (that 1 value)?

According to this PayPal documentation p3 is the subscription duration and should be used in conjunction with the value of t3.
Here's the details from that page:
p3 - Required
Subscription duration. Specify an integer value in the allowable range for the units of duration that you specify with t3.
t3 - Required
Regular subscription units of duration.
Allowable values are:
D — for days; allowable range for p3 is 1 to 90
W — for weeks; allowable range for p3 is 1 to 52
M — for months; allowable range for p3 is 1 to 24
Y — for years; allowable range for p3 is 1 to 5
So the current configuration is a recurring payment for only 1 Month.
I hope that this helps!

Use "srt" with some values greater then 1
<input type="hidden" name="src" value="1" />
<input type="hidden" name="srt" value="12" /><!--- 12 Month, paypal allowedonly 12 Month i think--->

Related

format month of grouped news items in Typo3

I have news items, grouped by year and month. Here the code:
<f:groupedFor each="{paginatedNews}" as="groupedNews1" groupBy="yearOfDatetime" groupKey="year">
<f:groupedFor each="{groupedNews1}" as="groupedNews" groupBy="monthOfDatetime" groupKey="month">
<div style="border:1px solid blue;padding:10px;margin:10px;">
<h1>{month} {year} </h1>
<f:for each="{groupedNews}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem,settings:settings,iterator:iterator}" />
</f:for>
</div>
</f:groupedFor>
</f:groupedFor>
Unfortunately, month and year are displayed in numbers in frontend, e.g.
03 2019
..(some news items)
02 2019
...
01 2019
However, what I need is this:
March 2019
...
February 2019
...
January 2019
How can I achieve this?
On the original EXT:news this method has been used:
Look at the template EXT:news/Resources/Private/Templates/News/DateMenu.html
<f:translate key="month.{month}" />
on the EXT:news/Resources/Private/Language/locallang.xlf you will find:
<trans-unit id="month.01" xml:space="preserve">
<source>January</source>
</trans-unit>
And so forth.

How Do I Calculate Date Difference in Javascript

i want to count the date difference (days only) like if i am selecting "Date From" as 08-05-2016 and then "Date To" as 08-11-2016 ... it will calculate the days difference as "7" before submitting in leave count box the values on run time Using Javascript
Below is the text values codes.
Date From: <input type="date" name="from">
Date To: <input type="date" name="to">
Leave Count: <input type="text" name="leavecount">
<input type="submit" name="submit">

How to Write Sql Query to show total number of leaveDays per months after calculating date difference between startDate and endDate

There is Leave Table.It has two columns start-date,end-date.I need to show total Number of Leave Days Per Month. At first I have to calculate totalNumberOfLeave just like:
<table>
<tr>
<th>Person</th>
<th>startDate</th>
<th>endDate</th>
<th>totalNumberOfLeave</th>
</tr>
<tr>
<td>PersonA</td>
<td>2016-08-10</td>
<td>2016-08-12</td>
<td>3</td>
</tr>
<tr>
<td>PersonB</td>
<td>2016-08-31</td>
<td>2016-09-03</td>
<td>4</td>
</tr>
<tr>
<td>PersonC</td>
<td>2016-08-30</td>
<td>2016-09-06</td>
<td>9</td>
</tr>
</table>
After calculating TotalNumberOfLeave,Then I need to show totalNumberOfLeave Per Month just like
<table>
<tr>
<th>Month</th>
<th>NumberOfLeave</th>
</tr>
<tr>
<td>8</td>
<td>6</td>
</tr>
</table>
(Person A takes 2016-08-10,2016-08-11,2016-08-12 as Leave,Person B takes 2016-08-31 as Leave,PersonC takes 2016-08-30,2016-08-31 as Leave in August)
How should I write for showing totalNumberOfLeave Per Month?
DB I use is Postgresql9.3.
SELECT
DATE_PART('MONTH',A.ATTENDANCEDATE) AS MONTH,
SUM(CASE WHEN (A.FULLDAY = '1') THEN 1 ELSE 0.5 END ) AS DURATION
FROM
(
SELECT GENERATE_SERIES(START_DATE,END_DATE, '1 DAY'::INTERVAL) AS ATTENDANCEDATE, IS_FULLDAY AS FULLDAY
FROM LEAVE_TAKEN
) AS A
GROUP BY
DATE_PART('MONTH',A.ATTENDANCEDATE)
ORDER BY
DATE_PART('MONTH',A.ATTENDANCEDATE);

Get date based on month, year, day and week number (ColdFusion)

I found a similar answer to my question, but it was in SQL and kinda went over my head (Given year, month, day and week number how to find the date?(Sql Server 2005 Set based)).
I'm writing a schedule creation app where a user will select the month, day of week (Sun-Sat, aka 1-7), and choose optionally if this will recur throughout the month each week.
Given that, I'm trying to write a function in ColdFusion that will return the actual date if I pass in the month, day, week number, and year. Dates always confuse the heck out of me.
So I know this is an old post but here are some current options in script or tag.
Week Number<br />
<cfscript>
myDateTime = now();
WriteOutput(week(myDateTime & "<br/>"));
</cfscript>
<br />
Day of week<br />
<cfscript>
mydayofweek = (DayOfWeek(myDateTime));
WriteOutput(DayOfWeek(myDateTime & "<br/>"));
</cfscript>
<br />
Day of year<br />
<cfscript>
WriteOutput(DayOfYear(myDateTime & "<br/>"));
</cfscript>
<br />
Days in month<br />
<cfscript>
WriteOutput(DaysInMonth(myDateTime & "<br/>"));
</cfscript>
<br />
<!--- What date are we working with --->
<cfset workingdt = '2022-5-05' />
<!--- Get the week start date. --->
<cfset dtWeekStart = (workingdt - DayOfWeek( workingdt ) + 1) />
<!--- Get the week end date. --->
<cfset dtWeekEnd = (workingdt + (7 - DayOfWeek( workingdt ))) />
<!--- Get the working week --->
<cfset dtworkingweek = '#week(workingdt)#' />
<br />
<!--- Output the dates: --->
<cfoutput>
Today: #DateFormat( workingdt )#<br />
Week Start: #DateFormat( dtWeekStart )#<br />
Week End: #DateFormat( dtWeekEnd )#<br />
Week Number: #dtworkingweek#<br />
</cfoutput>
<br />

XSL Transform extracting min and max dates

I'm trying to extract min and max dates from an XML source. I'm getting a nodeset into my variables and I need the actual date value within the nodes and can't find how to get it.
Source XML:
<Info dataSource="source">
<Detail>
<StartDate>20121211</StartDate>
<EndDate>20130112</EndDate>
</Detail>
<Detail>
<StartDate>20121211</StartDate>
<EndDate>20130112</EndDate>
</Detail>
<Detail>
<StartDate>20121211</StartDate>
<EndDate>20130112</EndDate>
</Detail>
<Detail>
<StartDate>20121218</StartDate>
<EndDate>20130114</EndDate>
</Detail>
</Info>
The XSL code:
<xsl:if test="//StartDate != '' and //EndDate != ''">
<xsl:variable name ="startDate">
<xsl:for-each select="//StartDate">
<xsl:sort select="StartDate" data-type="text" order="ascending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name ="endDate">
<xsl:for-each select="//EndDate">
<xsl:sort select="EndDate" data-type="text" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
</xsl:variable>
</xsl:if>
The dates are formatted correctly to support the sorts and retrieval, the issue is once the variables are populated I can't find how to access their values:
If you're using XSLT 2.0 you have min and max functions which do the work for you. XSLT 1.0 doesn't have these functions, but you can cheat by doing this (may be rather inefficient for large inputs, but it works):
<xsl:variable name="startDate" select="string(//StartDate[not(. > //StartDate)])" />
and similarly for the endDate. The trick here is that you're looking for the StartDate d for which there is no other StartDate that d is greater than.