예제 #1
0
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     $values = ['TYPE' => '00001', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'REFERENCE' => $this->reference, 'PORTEUR' => $this->card->getNumber(), 'DATEVAL' => $this->card->getValidity(), 'CVV' => $this->card->getCvv()];
     if ($this->id3d !== null) {
         $values['ID3D'] = $this->id3d;
     }
     return $values;
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     $values = ['TYPE' => '00051', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'REFERENCE' => $this->paymentReference, 'REFABONNE' => $this->subscriberReference, 'PORTEUR' => $this->token, 'DATEVAL' => $this->validity];
     if ($this->cvv !== null) {
         $values['CVV'] = $this->cvv;
     }
     return $values;
 }
예제 #3
0
 /**
  * @param Money    $money
  * @param Currency $currency
  *
  * @return Money
  *
  * @throws CurrencyConversionException If the exchange rate is not available.
  * @throws RoundingNecessaryException  If rounding was necessary but this converter uses RoundingMode::UNNECESSARY.
  */
 public function convert(Money $money, Currency $currency)
 {
     if ($money->getCurrency()->is($currency)) {
         $exchangeRate = 1;
     } else {
         $exchangeRate = $this->exchangeRateProvider->getExchangeRate($money->getCurrency()->getCode(), $currency->getCode());
     }
     return $money->convertedTo($currency, $exchangeRate, $this->context);
 }
예제 #4
0
 /**
  * Returns an array of POST parameters to use to redirect the customer to the 3D Secure authentication page.
  *
  * These parameters can be used to build a web form to post in the user's browser.
  *
  * @param Card  $card       The payment card.
  * @param Money $amount     The amount of the transaction.
  * @param string $sessionId A unique session ID of up to 250 chars.
  *                          This session ID will be returned in the callback,
  *                          and used to identify this 3D Secure authentication.
  *
  * @return array
  */
 public function getPostParameters(Card $card, Money $amount, $sessionId)
 {
     $parameters = ['Amount' => $amount->getAmount()->unscaledValue(), 'Currency' => $amount->getCurrency()->getNumericCode(), 'CCNumber' => $card->getNumber(), 'CCExpDate' => $card->getValidity(), 'CVVCode' => $card->getCvv(), 'IdMerchant' => $this->paybox->getIdentifier(), 'IdSession' => $sessionId];
     if ($this->callbackUrl !== null) {
         $parameters['URLHttpDirect'] = $this->callbackUrl;
     }
     if ($this->returnUrl !== null) {
         $parameters['URLRetour'] = $this->returnUrl;
     }
     return $parameters;
 }
예제 #5
0
 /**
  * Compares the given monies.
  *
  * The amount is not rounded before comparison, so the results are more relevant than when using
  * `convert($a, $b->getCurrency())->compareTo($b)`.
  *
  * Note that the comparison is performed by converting A into B's currency.
  * This order is important if the exchange rate provider uses different exchange rates
  * when converting back and forth two currencies.
  *
  * @param Money $a
  * @param Money $b
  *
  * @return int -1, 0 or 1.
  *
  * @throws CurrencyConversionException If the exchange rate is not available.
  */
 public function compare(Money $a, Money $b)
 {
     $aCurrencyCode = $a->getCurrency()->getCode();
     $bCurrencyCode = $b->getCurrency()->getCode();
     if ($aCurrencyCode === $bCurrencyCode) {
         return $a->compareTo($b);
     }
     $aAmount = $a->getAmount();
     $bAmount = $b->getAmount();
     $exchangeRate = $this->exchangeRateProvider->getExchangeRate($aCurrencyCode, $bCurrencyCode);
     $aAmount = $aAmount->toBigRational()->multipliedBy($exchangeRate);
     return $aAmount->compareTo($bAmount);
 }
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     return ['TYPE' => '00012', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'REFERENCE' => $this->reference, 'PORTEUR' => $this->card->getNumber(), 'DATEVAL' => $this->card->getValidity(), 'CVV' => $this->card->getCvv()];
 }
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     return ['TYPE' => '00061', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'REFERENCE' => $this->reference, 'REFABONNE' => $this->refabonne, 'PORTEUR' => $this->token, 'DATEVAL' => $this->validity];
 }
예제 #8
0
파일: Capture.php 프로젝트: benmorel/paybox
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     return ['TYPE' => '00002', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'NUMAPPEL' => $this->numappel, 'NUMTRANS' => $this->numtrans, 'REFERENCE' => $this->reference];
 }
예제 #9
0
 /**
  * PayboxSystemRequest constructor.
  *
  * @param Money  $amount
  * @param string $reference
  * @param string $email
  */
 public function __construct(Money $amount, $reference, $email)
 {
     $this->values = ['PBX_TOTAL' => $amount->getAmount()->unscaledValue(), 'PBX_DEVISE' => $amount->getCurrency()->getNumericCode(), 'PBX_CMD' => $reference, 'PBX_PORTEUR' => $email, 'PBX_RETOUR' => 'M:M;R:R;T:T;A:A;B:B;C:C;D:D;E:E;F:F;G:G;H:H;I:I;J:J;N:N;O:O;P:P;Q:Q;S:S;U:U;W:W;Y:Y;K:K', 'PBX_HASH' => 'SHA512', 'PBX_TIME' => gmdate('c')];
 }
예제 #10
0
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     return ['TYPE' => '00011', 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'REFERENCE' => $this->reference];
 }
예제 #11
0
 /**
  * @inheritdoc
  */
 public function getValues()
 {
     return ['TYPE' => '00055', 'REFABONNE' => $this->subscriberReference, 'REFERENCE' => $this->paymentReference, 'MONTANT' => $this->amount->getAmount()->unscaledValue(), 'DEVISE' => $this->amount->getCurrency()->getNumericCode(), 'NUMAPPEL' => $this->numappel, 'NUMTRANS' => $this->numtrans, 'PORTEUR' => $this->token, 'DATEVAL' => $this->validity];
 }