コード例 #1
0
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var Card $object */
     if (is_null($object)) {
         return array();
     }
     return array_filter(array('number' => $object->getNumber(), 'expdate' => $object->getExpiryDate(), 'chname' => $object->getCardHolderName(), 'type' => $object->getType(), 'issueno' => $object->getIssueNumber(), 'ref' => $object->getReference(), 'payerref' => $object->getPayerReference(), 'cvn' => $object->getCvn()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var FraudFilter $object */
     if (is_null($object)) {
         return array();
     }
     return array_filter(array('rule' => $object->getRules()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
コード例 #3
0
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var Payer $object */
     $hasComments = true;
     $comments = $object->getComments();
     if (is_null($comments) || $comments->getSize() == 0) {
         $hasComments = false;
     } else {
         $comments = $comments->getComments();
     }
     return array_filter(array('@type' => $object->getType(), '@ref' => $object->getRef(), 'title' => $object->getTitle(), 'firstname' => $object->getFirstName(), 'surname' => $object->getSurname(), 'company' => $object->getCompany(), 'address' => $object->getAddress(), 'phonenumbers' => $object->getPhoneNumbers(), 'email' => $object->getEmail(), 'comments' => $hasComments ? array('comment' => $comments) : array()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
コード例 #4
0
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var Cvn $object */
     return array_filter(array('number' => $object->getNumber(), 'presind' => $object->getPresenceIndicator()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
コード例 #5
0
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var DccInfo $object */
     return array_filter(array('ccp' => $object->getDccProcessor(), 'type' => $object->getType(), 'rate' => $object->getRate(), 'ratetype' => $object->getRateType(), 'amount' => $object->getAmount()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 private function normaliseCardIssuer(PaymentResponse $response)
 {
     $cardIssuer = $response->getCardIssuer();
     if (is_null($cardIssuer)) {
         return array();
     }
     return array_filter(array('bank' => $cardIssuer->getBank(), 'country' => $cardIssuer->getCountry(), 'countrycode' => $cardIssuer->getCountryCode(), 'region' => $cardIssuer->getRegion()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var PayerAddress $object */
     return array_filter(array('line1' => $object->getLine1(), 'line2' => $object->getLine2(), 'line3' => $object->getLine3(), 'city' => $object->getCity(), 'county' => $object->getCounty(), 'postcode' => $object->getPostcode(), 'country' => $object->getCountry()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
コード例 #8
0
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var Country $object */
     return array_filter(array('@code' => $object->getCode(), '#' => $object->getName()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var PhoneNumbers $object */
     return array_filter(array('home' => $object->getHomePhoneNumber(), 'work' => $object->getWorkPhoneNumber(), 'fax' => $object->getFaxPhoneNumber(), 'mobile' => $object->getMobilePhoneNumber()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var PaymentData $object */
     return array_filter(array('cvn' => $object->getCvnNumber()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 private function normaliseMpi(PaymentRequest $request)
 {
     $mpi = $request->getMpi();
     if (is_null($mpi) || $this->mpi_is_empty($request)) {
         return array();
     }
     return array_filter(array('cavv' => $mpi->getCavv(), 'xid' => $mpi->getXid(), 'eci' => $mpi->getEci()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var DccInfoResult $object */
     return array_filter(array('cardholdercurrency' => $object->getCardHolderCurrency(), 'cardholderamount' => $object->getCardHolderAmount(), 'cardholderrate' => $object->getCardHolderRate(), 'merchantcurrency' => $object->getMerchantCurrency(), 'merchantamount' => $object->getMerchantAmount(), 'marginratepercentage' => $object->getMarginRatePercentage(), 'exchangeratesourcename' => $object->getExchangeRateSourceName(), 'commissionpercentage' => $object->getCommissionPercentage(), 'exchangeratesourcetimestamp' => $object->getExchangeRateSourceTimestamp()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 /**
  * Normalizes an object into a set of arrays/scalars.
  *
  * @param object $object object to normalize
  * @param string $format format the normalization result will be encoded as
  * @param array $context Context options for the normalizer
  *
  * @return array|string|bool|int|float|null
  */
 public function normalize($object, $format = null, array $context = array())
 {
     /** @var ThreeDSecureRequest $object */
     $hasComments = true;
     $comments = $object->getComments();
     if (is_null($comments) || $comments->getSize() == 0) {
         $hasComments = false;
     } else {
         $comments = $comments->getComments();
     }
     return array_filter(array('@timestamp' => $object->getTimestamp(), '@type' => $object->getType(), 'merchantid' => $object->getMerchantId(), 'account' => $object->getAccount(), 'orderid' => $object->getOrderId(), 'amount' => $object->getAmount(), 'card' => $object->getCard(), 'pares' => $object->getPares(), 'sha1hash' => $object->getHash(), 'comments' => $hasComments ? array('comment' => $comments) : array(), 'payerref' => $object->getPayerRef(), 'paymentmethod' => $object->getPaymentMethod(), 'paymentdata' => $object->getPaymentData(), 'autosettle' => $object->getAutoSettle()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }
 private function normaliseThreedsecure(ThreeDSecureResponse $response)
 {
     $threeDSecure = $response->getThreeDSecure();
     if (is_null($threeDSecure)) {
         return array();
     }
     return array_filter(array('status' => $threeDSecure->getStatus(), 'eci' => $threeDSecure->getEci(), 'xid' => $threeDSecure->getXid(), 'cavv' => $threeDSecure->getCavv(), 'algorithm' => $threeDSecure->getAlgorithm()), array(NormaliserHelper::GetClassName(), "filter_data"));
 }