Hey, I finished a paypal script and I am trying to add a coupon code to give the buyer a 10% discount with the right code. This will take 10% off the price before reached to paypal.
This is what I have:
<?php
$EmailAddress = "";
$EmailSubject = "";
$ReplyBoolean = "Yes";
$SenderName = "";
$SenderEmailAddress = "";
$SenderEmailSubject = "";
$SenderBody = "";
$InvoiceReplyBoolean = "";
//The Name in which you would like to use as the sender of the invoice
$InvoiceSenderName = "";
$InvoiceSenderEmailAddress = "";
$InvoiceSenderEmailSubject = "Game Server Invoice";
$PaypalEmail = "";
$PaypalSubscription = "Yes";
list ($productname, $productprice, $extra) = split('/',$txtproduct);
mail( "$EmailAddress", "$EmailSubject: $txtsubject",
"Purchaser: $txtfirstname $txtmiddlename $txtlastname ($txtemail) \nItem: $productname at $$productprice per unit. \n\nName: $txtfirstname $txtmiddlename $txtlastname\nAddress: $txtaddress\nCity: $txtcity\nState: $txtstate\nZip Code: $txtzip\nCountry: $txtcountry\nPhone: $txtphone\nEmail: $txtemail\nAdmin Password: $txtadmin \nUsername: $txtusername\nPassword: $txtpassword\nPayment Method: $txtpayment\nGame Type: $txtgame\nProduct: $txtproduct\n\nComments: $txtmessage", "From: $txtemail" );
$ReplyBoolean = strtolower($ReplyBoolean);
if($ReplyBoolean == "yes") {
mail( "$txtemail", "$SenderEmailSubject", "Dear $txtfirstname, \n\n$SenderBody \n\n$SenderName", "From: $SenderName <$SenderEmailAddress>" );
}
$InvoiceReplyBoolean = strtolower($InvoiceReplyBoolean);
if($InvoiceReplyBoolean == "yes") {
mail( "$txtemail", "$InvoiceSenderEmailSubject",
"=====================\n Invoice\n=====================\n\nPurchaser: $txtfirstname ($txtemail) \nWeb Hosting Package: $productname at $$productprice per month. \n\nName: $txtname\nAddress: $txtaddress\nCity: $txtcity\nState: $txtstate\nZip Code: $txtzip\nCountry: $txtcountry\nPhone: $txtphone\nEmail: $txtemail\nAdmin Password: $txtadmin \nUsername: $txtusername\nPassword: $txtpassword\nPayment Method: $txtpayment\nGame Type: $txtgame\nProduct: $txtproduct\n\nRemarks: $txtmessage\n\n$InvoiceSenderName", "From: $InvoiceSenderName <$InvoiceSenderEmailAddress>" );
}
if(strtolower($txtpayment) == "pp") {
if(strtolower($PaypalSubscription) == "yes") {
header ("Location: https://www.paypal.com/subscriptions/business=$PaypalEmail&undefined_quantity=1&item_name=$productname&a3=$productprice&p3=1&t3=M&src=1&sra=1&no_shipp//ing=1" );
}
elseif(strtolower($PaypalSubscription) == "no") {
header ("Location: https://www.paypal.com/xclick/business=$PaypalEmail&undefined_quantity=1&item_name=$productname&amount=$productprice&no_shipp//ing=1" );
}
}
elseif (strtolower($txtpayment) == "cc") {
header ("" );
}
?>
send.php