Fix references to PP form and add different options

This commit is contained in:
Eric Reed 2014-08-31 18:20:38 -04:00
parent 9fbe7ce690
commit 2d48323943

View File

@ -1,28 +1,29 @@
(function () { (function () {
function addRecurringFields(page) { function addRecurringFields(period, page) {
// Add recurring fields to form // Add recurring fields to form
$("<input type='hidden' name='a3' class='pprecurring' />") $("<input type='hidden' name='a3' class='pprecurring' />")
.attr('value', $('#donateAmt', page).val()) .attr('value', $('#donateAmt', page).val())
.appendTo("#payPalForm", page); .appendTo("#payPalSupporterForm", page);
$("<input type='hidden' name='p3' value='1' class='pprecurring' />") $("<input type='hidden' name='p3' value='1' class='pprecurring' />")
.appendTo("#payPalForm", page); .appendTo("#payPalSupporterForm", page);
$("<input type='hidden' name='t3' value='M' class='pprecurring' />") $("<input type='hidden' name='t3' value='"+period+"' class='pprecurring' />")
.appendTo("#payPalForm", page); .appendTo("#payPalSupporterForm", page);
$("<input type='hidden' name='src' value='1' class='pprecurring' />") $("<input type='hidden' name='src' value='1' class='pprecurring' />")
.appendTo("#payPalForm", page); .appendTo("#payPalSupporterForm", page);
$("<input type='hidden' name='sra' value='1' class='pprecurring' />") $("<input type='hidden' name='sra' value='1' class='pprecurring' />")
.appendTo("#payPalForm", page); .appendTo("#payPalSupporterForm", page);
//change command for subscriptions //change command for subscriptions
$('#ppCmd', page).val('_xclick-subscriptions'); $('#ppCmd', page).val('_xclick-subscriptions');
$('#payPalForm', page).trigger('create'); $('#payPalSupporterForm', page).trigger('create');
console.log($('#payPalSupporterForm', page).html());
} }
function removeRecurringFields(page) { function removeRecurringFields(page) {
@ -141,14 +142,14 @@
else if (donationType == 'yearly') { else if (donationType == 'yearly') {
$('.fldOneTimeDonationAmount', page).hide(); $('.fldOneTimeDonationAmount', page).hide();
addRecurringFields(page); addRecurringFields('Y', page);
setItemNumber(page, 'MBSClubYearly'); setItemNumber(page, 'MBSClubYearly');
$('#oneTimeDescription').hide(); $('#oneTimeDescription').hide();
} }
else if (donationType == 'monthly') { else if (donationType == 'monthly') {
$('.fldOneTimeDonationAmount', page).hide(); $('.fldOneTimeDonationAmount', page).hide();
addRecurringFields(page); addRecurringFields('M', page);
setItemNumber(page, 'MBSClubMonthly'); setItemNumber(page, 'MBSClubMonthly');
$('#oneTimeDescription').hide(); $('#oneTimeDescription').hide();
} }