Jump to content
  • 0

Setting up donation


Rain408

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   0
  • Joined:  05/23/15
  • Last Seen:  

I was wondering how to combine these two to make my donation set up work.

<?php
if (!defined('FLUX_ROOT')) exit;

if (empty($amount)) {
	return false;
}

$session            = Flux::$sessionData;
$customDataArray    = array('server_name' => $session->loginAthenaGroup->serverName, 'account_id' => $session->account->account_id);
$customDataEscaped  = htmlspecialchars(base64_encode(serialize($customDataArray)));
$businessEmail      = htmlspecialchars(Flux::config('PayPalBusinessEmail'));
$donationCurrency   = htmlspecialchars(Flux::config('DonationCurrency'));
$creditExchangeRate = Flux::config('CreditExchangeRate');
$donationCredits    = floor($amount / $creditExchangeRate);
$itemName           = htmlspecialchars(sprintf('Donation Credits: %s CREDIT(s)', number_format($donationCredits)));
?>
<form action="https://<?php echo Flux::config('PayPalIpnUrl') ?>/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="notify_url" value="<?php echo $this->url('donate', 'notify', array('_host' => true)) ?>" />
<input type="hidden" name="return" value="<?php echo $this->url('main', 'index', array('_host' => true)) ?>" />
<input type="hidden" name="custom" value="<?php echo $customDataEscaped ?>" />
<input type="hidden" name="business" value="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSXUSRCTJASRA" />
<input type="hidden" name="item_name" value="<?php echo $itemName ?>" />
<input type="hidden" name="amount" value="<?php echo (float)$amount ?>" />
<input type="hidden" name="no_shipping" value="0" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="<?php echo $donationCurrency ?>" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="bn" value="PP-DonationsBF" />
<p style="text-align: center"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
	name="submit" alt="PayPal - The safer, easier way to pay online!" /></p>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>

This is the email provide to me by paypals:

 

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSXUSRCTJASRA

 

But i realize that that link is not what i wanted... because im sure it doesnt change the donation into the credits.

 

so im looking at this code, provide to me by paypals:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="BSXUSRCTJASRA">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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>

and wondering how to combine the two

Edited by Rain408
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

×
×
  • Create New...