Skip to content

Commit

Permalink
Merge pull request #4 from szelpe/master
Browse files Browse the repository at this point in the history
Added currency handling to the start payment request model. Thx @szelpe!
  • Loading branch information
Attila Botz committed Nov 7, 2016
2 parents 8fde837 + a0d2395 commit 56b9d9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions library/common/Enumerations.php
Expand Up @@ -54,4 +54,17 @@ abstract class UILocale
{
const HU = "hu-HU";
const EN = "en-US";
}

abstract class Currency
{
const HUF = "HUF";
const EUR = "EUR";
const USD = "USD";

public static function isValid($name)
{
$constants = self::getConstants();
return array_key_exists($name, $constants);
}
}
4 changes: 3 additions & 1 deletion library/models/PreparePaymentRequestModel.php
Expand Up @@ -32,8 +32,9 @@ class PreparePaymentRequestModel extends BaseRequestModel
public $RecurrenceId;
public $RedirectUrl;
public $CallbackUrl;
public $Currency;

function __construct($requestId = null, $type = PaymentType::Immediate, $guestCheckoutAllowed = true, $allowedFundingSources = array(FundingSourceType::All), $window = "00:30:00", $locale = "hu-HU", $initiateRecurrence = false, $recurrenceId = null, $redirectUrl = null, $callbackUrl = null)
function __construct($requestId = null, $type = PaymentType::Immediate, $guestCheckoutAllowed = true, $allowedFundingSources = array(FundingSourceType::All), $window = "00:30:00", $locale = "hu-HU", $initiateRecurrence = false, $recurrenceId = null, $redirectUrl = null, $callbackUrl = null, $currency = Currency::HUF)
{
$this->PaymentRequestId = $requestId;
$this->PaymentType = $type;
Expand All @@ -45,6 +46,7 @@ function __construct($requestId = null, $type = PaymentType::Immediate, $guestCh
$this->RecurrenceId = $recurrenceId;
$this->RedirectUrl = $redirectUrl;
$this->CallbackUrl = $callbackUrl;
$this->Currency = $currency;
}

public function AddTransaction(PaymentTransactionModel $transaction)
Expand Down

0 comments on commit 56b9d9f

Please sign in to comment.