Jump to content
  • 0

Need help on changing paypal donate function to buy now


NoWayHome

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

<?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="<?php echo $businessEmail ?>" />
<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>

Anyone can please  help me on changing this web function?

Because it shown donation doesn't support in my country, I wish to change it to Buynow.

I have done the link at paypal but don't how to change those code such as: 

$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)));


I have tried myself but failed, im new to this...

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

On 3/8/2022 at 12:39 PM, NoWayHome said:
https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif

replace with your own image button, or go Paypal generate a new Buy Now codes instead?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/23/22
  • Last Seen:  

On 3/9/2022 at 7:58 PM, Emistry said:

replace with your own image button, or go Paypal generate a new Buy Now codes instead?

Thanks for you reply.
What I means is the after click on the button which I have changed to BuyNow but it still in donate function.

donate4.png

Link to comment
Share on other sites

×
×
  • Create New...