PROGRAMMATIC PAYPAL INTEGRATION (USING PHP) INTO ROYALTY PAYMENTS
?>
<TABLE BORDER="10" BGCOLOR="BLUE">
<TR>
<TD BGCOLOR="YELLOW">
<A HREF=”ROYALTY.PHP?ROYALTYCREDITOR=DISTRIBUTOR">
<B>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>DISTRIBUTOR</FONT>
</B>
</A>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>DISTRIBUTOR</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="RED">
<A HREF="ROYALTY.PHP?ROYALTYCREDITOR=PRODUCER">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">PRODUCER</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">PRODUCER</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=WRITER">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="GREEN">WRITER</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="GREEN">WRITER</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=ARTIST">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ARTIST</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ARTIST</FONT>
</B>
</A>
</TD>
</TR>
</TABLE>
<TABLE BORDER="10" BGCOLOR="BLUE">
<TR>
<TD BGCOLOR="YELLOW">
<A HREF=”ROYALTY.PHP?ROYALTYCREDITOR=<?php $_SESSION['ROYALTYCREDITOR']?>
&COMMAND=CALCULATE">
&COMMAND=CALCULATE">
<B>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>CALCULATE ROYALTY</FONT>
</B>
</A>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>CALCULATE ROYALTY</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="RED">
<A HREF="ROYALTY.PHP?ROYALTYCREDITOR=<?php $_SESSION['ROYALTYCREDITOR'] ?>
&COMMAND=SETUP&DESCRIPTION=ALBUM">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">ROYALTY SETUP</FONT>
</B>
</A>
&COMMAND=SETUP&DESCRIPTION=ALBUM">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">ROYALTY SETUP</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=<?php $_SESSION['ROYALTYCREDITOR']?>&COMMAND=EMAIL">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="GREEN"><EMAIL ROYALTY STATEMENT</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="GREEN"><EMAIL ROYALTY STATEMENT</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=<?php $_SESSION['ROYALTYCREDITOR'] ?>
&COMMAND=PAYMENT&ACTION=GENERATE&PAYMENTMETHOD=PAYPAL">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ROYALTY PAYMENT</FONT>
</B>
</A>
&COMMAND=PAYMENT&ACTION=GENERATE&PAYMENTMETHOD=PAYPAL">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ROYALTY PAYMENT</FONT>
</B>
</A>
</TD>
</TR>
</TABLE>
<?php
foreach ($_GET as $key => $value) {
if ($key == "ROYALTYCREDITOR") {
$_SESSION['ROYALTYCREDITOR'] = $_GET[$key];
}
if ($key == "OKBUTTON") {
$_SESSION['OKBUTTON'] = $_GET[$key];
}
if ($key == "PAYMENTMETHOD") {
$_SESSION['PAYMENTMETHOD'] = $_GET[$key];
}
if ($key == "COMMAND") {
$_SESSION['COMMAND'] = $_GET[$key];
}
if ($key == "ACTION") {
$_SESSION['ACTION'] = $_GET[$key];
}
}
<TR>
<TD BGCOLOR="YELLOW">
<A HREF=”ROYALTY.PHP?ROYALTYCREDITOR=DISTRIBUTOR">
<B>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>DISTRIBUTOR</FONT>
</B>
</A>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>DISTRIBUTOR</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="RED">
<A HREF="ROYALTY.PHP?ROYALTYCREDITOR=PRODUCER">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">PRODUCER</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="YELLOW">PRODUCER</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=WRITER">
<B>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='GREEN'><B>WRITER</FONT>
</B>
</A>
<B>
<FONT FACE='ALGERIAN' SIZE='5' COLOR='GREEN'><B>WRITER</FONT>
</B>
</A>
</TD>
<TD BGCOLOR="YELLOW">
<A HREF="ROYALTY.ASP?ROYALTYCREDITOR=ARTIST">
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ARTIST</FONT>
</B>
</A>
<B>
<FONT FACE="ALGERIAN" SIZE="5" COLOR="RED">ARTIST</FONT>
</B>
</A>
</TD>
</TR>
</TABLE>
if ( $_SESSION['COMMAND'] == "PAYMENT" ) {
if ( $_SESSION['ROYALTYCREDITOR'] == "WRITER" ) {
$SQLALBUMSINGLE = " SELECT * FROM ALBUMSINGLE ";
$FALBUMSINGLE = mysql_query( $SQLALBUMSINGLE, $CON );
while ( $ALBUMSINGLE = mysql_fetch_object($FALBUMSINGLE)) {
$CODE = $ALBUMSINGLE->CODE;
$DESCRIPTION = BUMSINGLE->DESCRIPTION;
if ($DESCRIPTION == "ALBUM" ) {
$SQLWRITER = " SELECT * FROM WRITER ";
$FWRITER = mysql_query( $SQLWRITER, $CON);
while ( $CREDITOR = mysql_fetch_object($FWRITER)) {
$ACCOUNT_NUMBER = $CREDITOR->WRITERCOD;
$ACCOUNT_NAME = $CREDITOR->WRITERNAM;
REM *****************************************************************************
Retrieving List Of Albums For Which Song Writer is due Royalty Payments
From Access Or SQL Server Database Table “ROYALTYALBUM”.
And Calculating Money owed to the Song Writer on each Album sales.
Other Royalty Creditors that Pay Pal Payments can be transferred to their
Account are: (DISTRIBUTOR, PRODUCER , ARTIST, MUSICIAN).
Account are: (DISTRIBUTOR, PRODUCER , ARTIST, MUSICIAN).
RE*******************************************************************************
$SQLROYALTY = " SELECT * FROM ROYALTYALBUM ";
$SQLROYALTY .= " WHERE ACCOUNTNO =";
$SQLROYALTY .= $ACCOUNT_NUMBER;
$SQLROYALTY .= " AND ROYALTY_CODE=";
$SQLROYALTY .= $ROYALTY_CODE;
$FROYALTYALBUM = mysql_query( $SQLROYALTY, $CON);
while ( $ROYALTY =mysql_fetch_object($FROYALTYALBUM)) {
$ALBUMCOD = $ROYALTY->ALBUMCOD;
$SQLALBUM = " SELECT * FROM ALBUM ";
$SQLALBUM .= " WHERE ALBUMCOD=";
$SQLALBUM .= $ALBUMCOD;
$FALBUM = mysql_query($SQLALBUM, $CON);
$ALBUM = mysql_fetch_object($FALBUM);
$ALBUMNAM = $ALBUM->ALBUMNAM;
$SQLLEDGER = " SELECT * FROM ROYALTYLEDGER ";
$SQLLEDGER .= " WHERE ACOUNTNO=" ;
$SQLLEDGER .= $ACCOUNT_NUMBER;
$SQLLEDGER .= " AND ALBUMCOD=" . $ALBUMCOD;
$FROYALTYLEDGER = mysql_query($SQLLEDGER, $CON);
$CURRENT_BALANCE = 0;
while ( $LEDGER = mysql_fetch_object($FROYALTYLEDGER)) {
$TRNSNO = $LEDGER->TRNSNO;
$TRNSDAT = $LEDGER->TRNSDAT;
$TRNSTYPE= $LEDGER->TRNSTYPE;
$AMOUNT = $LEDGER->AMOUNT;
if ( $TRNSTYPE == "I") {
$CURRENT_BALANCE = $CURRENT_BALANCE + $AMOUNT;
}
if ( $TRNSTYPE == "R"){
$CURRENT_BALANCE = $CURRENT_BALANCE - $AMOUNT;
}
if ( $TRNSTYPE == "C") {
$CURRENT_BALANCE = $CURRENT_BALANCE - $AMOUNT;
}
}
if ( $CURRENT_BALANCE == 0 ) {
}
else {
REM ************************************************************************************
PAY PAL HTML FORM VARIABLES TO BE USED IN INTEGRATION
PAY PAL HTML FORM VARIABLES TO BE USED IN INTEGRATION
REM variable : business = " Pay Pal Business Account
(Royalty Creditor - Producer, Writer, Distributor,Artist - Email Address - HEMAIL )"
(Royalty Creditor - Producer, Writer, Distributor,Artist - Email Address - HEMAIL )"
REM Variable : notify_url = " Website Address Of IPN SCRIPT - ROYALTYIPN_LISTENER.ASP "
REM Variable : item_name = " Product Name -
(1) Royalty Creditor :
(A) Producer ( Person Or Company Financing Recording Of Music )
(B) Distributor ( Sales Agent Of Album Or Song )
(C) Song Writer
(D) Artist( Singer , Musician )
( Who is due payments Based on Sales Orders generated from Download Of Music )
( Who is due payments Based on Sales Orders generated from Download Of Music )
(2) Royalty Creditor Account Name
(3) Album Name OR Song Title for which Royalty Revenue are earned based on ALBUM,
SONG Sales
REM variable : amount = " Payment Amount -
( Current Balance Of Royalty Creditor Account )
( Current Balance Of Royalty Creditor Account )
REM variable : PAYPALURL ( Pay Pal Website Address ) :
(1) Live Site : https://www.paypal.com/cgi-bin/webscr
(2) Testing Site : https://www.sandbox.paypal.com/cgi-bin/webscr
REM Live Site PAYPALURL = "https://www.paypal.com/cgi-bin/webscr"
REM Testing Site PAYPALURL = "https://www.sandbox.paypal.com/cgi-bin/webscr"
REM *************************************************************************************
$ROYALTYIPN_LISTENER = "ROYALTYIPN_LISTENER.PHP";
$SQLPAYMENT .= " SELECT * FROM PAYMENTMETHOD ";
$SQLPAYMENT .= " WHERE ACCOUNTNO =" . $ACCOUNT_NUMBER;
$FPAYMENTMETHOD= mysql_query ( $SQLPAYMENT, $CON );
$PAYMENTMETHOD = $RECORD->PAYMENTMETHOD")
if ( $PAYMENTMETHOD = "PAYPAL" ) {
$ITEM_NAME = "";
$ITEM_NAME .= $_SESSION['ROYALTYCREDITOR'];
$ITEM_NAME .= ",";
$ITEM_NAME .= $ACCOUNT_NAME;
$ITEM_NAME .= ",";
if ($DESCRIPTION = "ALBUM") {
$ITEM_NAME .= $ALBUMNAM;
}
if ($DESCRIPTION = "SINGLE" ) {
$ITEM_NAME .= $SONGTITLE;
}
************************************************************
PAY PAL BUTTON PROGRAMMATICALLY INTEGRATED
************************************************************
?>
************************************************************
PAY PAL BUTTON PROGRAMMATICALLY INTEGRATED
************************************************************
?>
<FORM METHOD="POST" ACTION="<?php $PAYPALURL ?>">
<INPUT TYPE="HIDDEN" NAME="business" VALUE="<?php $EMAIL ?>">
<INPUT TYPE="HIDDEN" NAME="item_name" VALUE="<?php $ITEM_NAME ?>">
<INPUT TYPE="HIDDEN" NAME="amount" VALUE="<?php $CURRENT_BALANCE ?>">
<INPUT TYPE="HIDDEN" NAME="notify_url" VALUE="<?php $ROYALTYIPN_LISTENER ?>">
<INPUT TYPE="HIDDEN" NAME="return" VALUE="<?php $PAYPAL ?>">
<TD><INPUT TYPE="SUBMIT" VALUE="PAY PAL"></TD>
</FORM>
<?php
*************************************************************
*************************************************************
}
}
}
}
}
}
if $_SESSION['ROYALTYCREDITOR'] == "PRODUCER" ) {
}
if $_SESSION['ROYALTYCREDITOR'] == "DISTRIBUTOR" ) {
}
if $_SESSION['ROYALTYLEDGER'] == "GROUP" ) {
}
if $_SESSION['ROYALTYLEDGER'] == "GROUP" ) {
}
}
No comments:
Post a Comment