0

If anyone can help me I would be thankful. I am getting this error.

<b>Warning</b>:  Missing argument 1 for DonationSession::GetPaymentURL(), called in /home/desolutionrp/public_html/web/payment.php on line 18 and defined in <b>/public_html/web/inc/donate.class.php</b> on line <b>95</b><br />

<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/desolutionrp/public_html/web/inc/donate.class.php:95) in <b>/public_html/web/payment.php</b> on line <b>18</b><br />

I checked out what's on those lines and for the first error this is the line:

function GetPaymentURL($email) {
   return "https://www." . (config_Sandbox ? "sandbox." : "") . "paypal.com/cgi-bin/webscr?on0=donationid&os0=" .$this->index . "&on1=steamid&os1=" . $this->steamid . "&cmd=_xclick&business=" . config_PayPalEmail . "&no_shipping=1&currency_code=USD&lc=EN&item_name=" . config_ProductName . "&amount=" . $this->value;
}

And for the second error the line says:

header("Location:" . $donation->GetPaymentURL());
Kypros
  • 2,997
  • 5
  • 21
  • 27
AlexG
  • 5
  • 1

2 Answers2

0

The GetPaymentUrl() function expects one parameter - $email. Make sure that you're passing an email address when you call that function. The second error - "cannot modify header information" - is because the first error message has been printed to the screen. Once the first error is fixed, the second will disappear.

danmullen
  • 2,556
  • 3
  • 20
  • 28
0

Your function GetPaymentURL requires you to pass an argument in for $email

You can handle this in 3 ways:

1) Give a default value to $email

function GetPaymentURL($email = '') {
    // return your data
}

2) remove the $email param since it doesn't seem to be used

function GetPaymentURL() {
    // return your data
}

3) Provide the data in the function call

header("Location:" . $donation->GetPaymentURL('emaiAddress@emailDomain.com'));

Your second issue is likely caused by your script printing out data to the screen and can be handled by using output buffering:

Cannot modify header information - headers already sent by... Wordpress Issue

More info on this error:

How to fix "Headers already sent" error in PHP

Community
  • 1
  • 1
Jonathan Crowe
  • 5,793
  • 1
  • 18
  • 28