/** * @param string $orderId * @param int $amount The amount in cents * @param string $currency A ISO-3166 code * @param string $country A ISO-4217 code * @param string $language A ISO-639-1 code * @param string $endUserIP * @param string|null $paymentMethod * @param string|null $paymentIssuer */ public function __construct($orderId, $amount, $currency, $country, $language, $endUserIP, $paymentMethod = null, $paymentIssuer = null) { $orderId = (string) $orderId; Assert::lazy()->that($orderId, 'orderId')->notEmpty()->maxLength(10)->that($amount, 'amount')->integer()->range(30, 1000000)->that($currency, 'currency')->string()->length(3)->that($country, 'country')->string()->length(2)->that($language, 'language')->string()->length(2)->that($endUserIP, 'endUserIP')->ip()->verifyNow(); $this->OrderID = $orderId; $this->Amount = $amount; $this->Country = $country; $this->Currency = $currency; $this->EndUserIP = $endUserIP; $this->Language = $language; $this->setPaymentMethod($paymentMethod); $this->setIssuer($paymentIssuer); }
public function resolveFromPost() { Assert::that($_SERVER, null, '$_SERVER')->choicesNotEmpty(['REQUEST_METHOD', 'REMOTE_ADDR']); Assert::lazy()->that($_SERVER['REQUEST_METHOD'], '$_SERVER["REQUEST_METHOD"]')->eq('POST')->that($_SERVER['REMOTE_ADDR'], '$_SERVER["REMOTE_ADDR"]')->ipv4()->ipv4InSubnetMask(['194.30.175.0/24', '194.126.241.128/26'])->verifyNow(); return $this->resolve($_POST); }
private function soapCall($method, BaseTypeType $request) { Assert::lazy()->that($request->getMerchantID(), 'MerchantID')->notEmpty()->that($request->getTimestamp(), 'Timestamp')->notEmpty()->that($request->getChecksum(), 'Checksum')->notEmpty()->verifyNow(); return $this->__soapCall($method, [(object) ['request' => $request]]); }
/** * @param string $paymentMethod * @param string $orderID * @param string $status * @param string $paymentID * @param string|null $statusCode * @param string|null $transactionID * @param string|null $reference * @param string|null $amount * @param string|null $currency * @param string|null $duration * @param string|null $consumerName * @param string|null $consumerAccountNumber * @param string|null $consumerAddress * @param string|null $consumerHouseNumber * @param string|null $consumerCity * @param string|null $consumerCountry * @param string|null $consumerEmail * @param string|null $consumerPhoneNumber * @param string|null $consumerIPAddress */ public function __construct($paymentMethod, $orderID, $status, $paymentID, $statusCode = null, $transactionID = null, $reference = null, $amount = null, $currency = null, $duration = null, $consumerName = null, $consumerAccountNumber = null, $consumerAddress = null, $consumerHouseNumber = null, $consumerCity = null, $consumerCountry = null, $consumerEmail = null, $consumerPhoneNumber = null, $consumerIPAddress = null) { Assert::lazy()->that($paymentMethod, 'paymentMethod')->notEmpty()->maxLength(20)->that($orderID, 'orderID')->notEmpty()->maxLength(10)->that($status, 'status')->inArray([self::STATE_OPEN, self::STATE_AUTHORIZED, self::STATE_ERROR, self::STATE_SUCCESS, self::STATE_REFUND, self::STATE_CHARGE_BACK])->that($paymentID, 'paymentID')->numeric()->that($statusCode, 'statusCode')->nullOr()->string()->maxLength(100)->that($transactionID, 'transactionID')->nullOr()->string()->maxLength(50)->that($reference, 'reference')->nullOr()->string()->maxLength(50)->that($amount, 'amount')->nullOr()->numeric()->that($currency, 'currency')->nullOr()->string()->length(3)->that($duration, 'duration')->nullOr()->numeric()->that($consumerName, 'consumerName')->nullOr()->string()->maxLength(100)->that($consumerAccountNumber, 'consumerAccountNumber')->nullOr()->string()->maxLength(100)->that($consumerAddress, 'consumerAddress')->nullOr()->string()->maxLength(100)->that($consumerHouseNumber, 'consumerHouseNumber')->nullOr()->string()->maxLength(10)->that($consumerCity, 'consumerCity')->nullOr()->string()->maxLength(100)->that($consumerCountry, 'consumerCountry')->nullOr()->string()->maxLength(100)->that($consumerEmail, 'consumerEmail')->nullOr()->string()->maxLength(200)->that($consumerPhoneNumber, 'consumerPhoneNumber')->nullOr()->string()->maxLength(50)->that($consumerIPAddress, 'consumerIPAddress')->nullOr()->ip()->verifyNow(); $this->paymentMethod = $paymentMethod; $this->orderID = $orderID; $this->status = $status; $this->paymentID = $paymentID; $this->statusCode = $statusCode; $this->transactionID = $transactionID; $this->reference = $reference; $this->amount = $amount; $this->currency = $currency; $this->duration = $duration; $this->consumerName = $consumerName; $this->consumerAccountNumber = $consumerAccountNumber; $this->consumerAddress = $consumerAddress; $this->consumerHouseNumber = $consumerHouseNumber; $this->consumerCity = $consumerCity; $this->consumerCountry = $consumerCountry; $this->consumerEmail = $consumerEmail; $this->consumerPhoneNumber = $consumerPhoneNumber; $this->consumerIPAddress = $consumerIPAddress; }
/** * @param string $merchantId * @param string $secretCode */ public function __construct($merchantId, $secretCode) { Assert::lazy()->that($merchantId, 'merchantId')->notEmpty()->string()->that($secretCode, 'secretCode')->notEmpty()->string()->verifyNow(); $this->merchantId = $merchantId; $this->secretCode = $secretCode; }
/** * @inheritdoc * @param string $consumerId */ public function __construct($consumerId, $orderId, $amount, $currency, $country, $language, $endUserIP, $paymentMethod, $paymentIssuer) { parent::__construct($orderId, $amount, $currency, $country, $language, $endUserIP, $paymentMethod, $paymentIssuer); Assert::lazy()->that($consumerId, 'consumerId')->notEmpty()->that($paymentMethod, 'paymentMethod')->notEmpty()->that($paymentIssuer, 'paymentIssuer')->notEmpty()->verifyNow(); $this->ConsumerID = $consumerId; }