コード例 #1
0
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseObject->reqn;
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->invoice)) {
         $invoice = $responseObject->invoice;
         $this->invoiceId = (int) $invoice['id'];
         $this->orderId = (string) $invoice->orderid;
         $this->customerWmid = (string) $invoice->customerwmid;
         $this->purse = (string) $invoice->storepurse;
         $this->amount = (double) $invoice->amount;
         $this->description = (string) $invoice->desc;
         $this->address = (string) $invoice->address;
         $this->protectionPeriod = (int) $invoice->period;
         $this->expiration = (int) $invoice->expiration;
         $this->status = (int) $invoice->state;
         $this->createDateTime = self::createDateTime((string) $invoice->datecrt);
         //wm format Ymd H:i:s
         $this->updateDateTime = self::createDateTime((string) $invoice->dateupd);
         //wm format Ymd H:i:s
     }
 }
コード例 #2
0
ファイル: Response.php プロジェクト: penwon/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->message = new Message((string) $responseObject->message->receiverwmid, (string) $responseObject->message->msgsubj, (string) $responseObject->message->msgtext, self::createDateTime((string) $responseObject->message->datecrt));
 }
コード例 #3
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->contractId = (int) $responseObject->contractid;
 }
コード例 #4
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     foreach ($responseObject->contractinfo->row as $contract) {
         $this->acceptances[] = new Acceptance((int) $contract['contractid'], (string) $contract['wmid'], empty($contract['acceptdate']) ? null : self::createDateTime($contract['acceptdate']));
     }
 }
コード例 #5
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->returnId = (string) $responseObject->retid;
     $this->userFirstName = (string) $responseObject->userinfo->iname;
     $this->userMiddleName = (string) $responseObject->userinfo->oname;
 }
コード例 #6
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdescr;
     if ($this->returnCode == 0) {
         $this->resourceId = (int) $responseObject->resourceid;
     }
 }
コード例 #7
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->trustId = (int) $responseObject->trust['id'];
     $this->slavePurse = (string) $responseObject->trust->slavepurse;
     $this->slaveWmid = (string) $responseObject->trust->slavewmid;
     $this->userDescription = (string) $responseObject->userdesc;
     $this->smsSentState = (string) $responseObject->smssentstate;
 }
コード例 #8
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->transtoken)) {
         $this->transactionToken = (string) $responseObject->transtoken;
     }
     if (isset($responseObject->validityperiodinhours)) {
         $this->validityPeriodInHours = (string) $responseObject->validityperiodinhours;
     }
 }
コード例 #9
0
ファイル: Response.php プロジェクト: penwon/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (!empty($responseObject->testwmpurse->wmid)) {
         $this->wmid = new Wmid((string) $responseObject->testwmpurse->wmid, (int) $responseObject->testwmpurse->wmid['available'] > 0 ? (bool) $responseObject->testwmpurse->wmid['available'] : null, (int) $responseObject->testwmpurse->wmid['themselfcorrstate'] > 0 ? (int) $responseObject->testwmpurse->wmid['themselfcorrstate'] >= 8 : null, (int) $responseObject->testwmpurse->wmid['newattst'] > 0 ? (int) $responseObject->testwmpurse->wmid['newattst'] : null);
     }
     if (!empty($responseObject->testwmpurse->purse)) {
         $this->purse = new Purse((string) $responseObject->testwmpurse->purse, (int) $responseObject->testwmpurse->purse['merchant_active_mode'] > 0 ? (bool) $responseObject->testwmpurse->purse['merchant_active_mode'] : null, (int) $responseObject->testwmpurse->purse['merchant_allow_cashier'] > 0 ? (bool) $responseObject->testwmpurse->purse['merchant_allow_cashier'] : null);
     }
 }
コード例 #10
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 public function __construct($response)
 {
     parent::__construct($response);
     $responseSimpleXml = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseSimpleXml->reqn;
     $this->returnCode = (int) $responseSimpleXml->retval;
     $this->returnDescription = (string) $responseSimpleXml->retdesc;
     if (isset($responseSimpleXml->outinvoices)) {
         foreach ($responseSimpleXml->outinvoices->children() as $invoiceSimpleXml) {
             $this->invoices[] = new Invoice($this->invoiceSimpleXmlToArray($invoiceSimpleXml));
         }
     }
 }
コード例 #11
0
ファイル: Response.php プロジェクト: penwon/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseObject->reqn;
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->operations->operation)) {
         foreach ($responseObject->operations->operation as $operation) {
             $this->operations[] = new Operation($this->operationXmlToArray($operation));
         }
     }
 }
コード例 #12
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseObject->reqn;
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->purses)) {
         foreach ($responseObject->purses->children() as $purse) {
             $this->purses[] = new Purse($this->purseToArray($purse));
         }
     }
 }
コード例 #13
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseObject->reqn;
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->operation)) {
         $operation = $responseObject->operation;
         $this->transactionId = (int) $operation['id'];
         $this->status = (int) $operation->opertype;
         $this->updateDateTime = self::createDateTime((string) $operation->dateupd);
     }
 }
コード例 #14
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->datestart = self::createDateTime((string) $responseObject->datestart);
     $this->dateend = self::createDateTime((string) $responseObject->dateend);
     if (isset($responseObject->history)) {
         $this->count = (int) $responseObject->history['count'];
         foreach ($responseObject->history->children() as $payment) {
             $this->payments[] = new Payment($this->operationSimpleXmlToArray($payment));
         }
     }
 }
コード例 #15
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject['retval'];
     $this->returnDescription = (string) $responseObject['retdesc'];
     $this->hasFullAccess = (int) $responseObject->fullaccess;
     $certInfo = $responseObject->certinfo;
     $this->wmid = (string) $certInfo['wmid'];
     if (!empty($certInfo->directory)) {
         static::$legalStatuses = $this->dirtyXmlToArray($certInfo->directory->ctype);
         static::$legalPositionStatuses = $this->dirtyXmlToArray($certInfo->directory->jstatus);
         static::$passportTypes = $this->dirtyXmlToArray($certInfo->directory->tid);
     }
     if (!empty($certInfo->attestat)) {
         $passport = $this->rowAttributesXmlToArray($certInfo->attestat);
         $this->passport = new Passport(reset($passport));
     }
     if (!empty($certInfo->wmids)) {
         foreach ($this->rowAttributesXmlToArray($certInfo->wmids) as $wmid) {
             $this->wmids[] = new Wmid($wmid);
         }
     }
     if (!empty($certInfo->userinfo)) {
         if (!empty($certInfo->userinfo->value)) {
             $userInfo = $this->rowAttributesXmlToArray($certInfo->userinfo->value);
             $this->userInfo = new UserInfo(reset($userInfo));
         }
         if (!empty($certInfo->userinfo->{'check-lock'})) {
             $checkLock = $this->rowAttributesXmlToArray($certInfo->userinfo->{'check-lock'});
             $this->checkLock = new CheckLock(reset($checkLock));
         }
         if (!empty($certInfo->userinfo->weblist)) {
             $webList = $this->rowAttributesXmlToArray($certInfo->userinfo->weblist);
             if (!empty($webList)) {
                 $this->webList = new WebList(reset($webList));
             }
         }
         if (!empty($certInfo->userinfo->extendeddata)) {
             $extendedData = $this->rowAttributesXmlToArray($certInfo->userinfo->extendeddata);
             if (!empty($extendedData)) {
                 $this->extendedData = new ExtendedData(reset($extendedData));
             }
         }
     }
 }
コード例 #16
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->payment)) {
         $payment = $responseObject->payment;
         $this->currency = (string) $payment['currency'];
         $this->merchant = (int) $payment['merchant'];
         $this->status = (string) $payment['status'];
         $this->payeePurse = (string) $payment->purse;
         $this->phone = (string) $payment->phone;
         $this->price = (double) $payment->price;
         $this->amount = (double) $payment->amount;
         $this->limit = (double) $payment->limit;
     }
 }
コード例 #17
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     $this->requestId = (int) $responseObject->trust['purseid'];
     $this->realSmsType = (int) $responseObject->trust->realsmstype;
     $this->userDescription = (string) $responseObject->userdesc;
     if ($responseObject->slavepurse) {
         $this->slavePurse = (string) $responseObject->slavepurse;
     }
     if ($responseObject->slavewmid) {
         $this->slaveWmid = (int) $responseObject->slavewmid;
     }
     if ($responseObject->smssecureid) {
         $this->smsSecureId = (int) $responseObject->smssecureid;
     }
 }
コード例 #18
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc . '. ' . (string) $responseObject->description;
     if (isset($responseObject->payment)) {
         $payment = $responseObject->payment;
         $this->currency = (string) $payment['currency'];
         $this->exchange = (string) $payment['exchange'];
         $this->payeePurse = (string) $payment->purse;
         $this->upExchange = (double) $payment->upexchange;
         $this->course = (double) $payment->course;
         $this->price = (double) $payment->price;
         $this->amount = (double) $payment->amount;
         $this->rest = (double) $payment->rest;
         $this->dayLimit = (double) $payment->limit->day;
         $this->monthLimit = (double) $payment->limit->month;
     }
 }
コード例 #19
0
ファイル: Response.php プロジェクト: penwon/php-webmoney
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->requestNumber = (int) $responseObject->reqn;
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->operation)) {
         $operation = $responseObject->operation;
         $this->refundTransactionId = (int) $operation['id'];
         $this->refundTransactionInternalId = (int) $operation['ts'];
         $this->transactionId = (int) $operation->inwmtranid;
         $this->payerPurse = (string) $operation->pursesrc;
         $this->payeePurse = (string) $operation->pursdest;
         $this->amount = (double) $operation->amount;
         $this->fee = (double) $operation->comiss;
         $this->description = (string) $operation->desc;
         $this->createDateTime = self::createDateTime((string) $operation->datecrt);
         $this->updateDateTime = self::createDateTime((string) $operation->dateupd);
     }
 }
コード例 #20
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->operation)) {
         $operation = $responseObject->operation;
         $this->transactionId = (string) $operation['wmtransid'];
         $this->invoiceId = (string) $operation['wminvoiceid'];
         $this->amount = (double) $operation->amount;
         $this->dateTime = self::createDateTime((string) $operation->operdate);
         $this->description = (string) $operation->purpose;
         $this->payerPurse = (string) $operation->pursefrom;
         $this->payerWmid = (string) $operation->wmidfrom;
         $this->isCapitallerPurseUsed = (bool) $operation->capitallerflag;
         $this->isAuthorizedViaEnum = (bool) $operation->enumflag;
         $this->ip = (string) $operation->IPAddress;
         if (!empty($operation->telepat_phone)) {
             $this->paymentType = self::PAYMENT_TYPE_TELEPAT;
             $this->telepatPhone = (string) $operation->telepat_phone;
             $this->telepatPaymentType = (int) $operation->telepat_paytype;
         } elseif (!empty($operation->paymer_number)) {
             $this->paymentType = self::PAYMENT_TYPE_PAYMER;
             $this->paymerNumber = (string) $operation->paymer_number;
             $this->paymerEmail = (string) $operation->paymer_email;
             $this->paymerPaymentType = (int) $operation->paymer_type;
         } elseif (!empty($operation->cashier_number)) {
             $this->paymentType = self::PAYMENT_TYPE_CASHIER;
             $this->cashierNumber = (string) $operation->cashier_number;
             $this->cashierDateTime = self::createDateTime((string) $operation->cashier_date);
             $this->cashierAmount = (double) $operation->cashier_amount;
         } elseif (isset($operation->sdp_type)) {
             $this->paymentType = self::PAYMENT_TYPE_SDP;
             $this->sdpType = (int) $operation->sdp_type;
         } else {
             $this->paymentType = self::PAYMENT_TYPE_USUAL;
         }
     }
 }
コード例 #21
0
ファイル: Response.php プロジェクト: baibaratsky/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->payment)) {
         $payment = $responseObject->payment;
         $this->id = (int) $payment['id'];
         $this->currency = (string) $payment['currency'];
         $this->test = (int) $payment['test'];
         $this->payeePurse = (string) $payment->purse;
         $this->phone = (string) $payment->phone;
         $this->price = (double) $payment->price;
         $this->amount = (double) $payment->amount;
         $this->comiss = (double) $payment->comiss;
         $this->rest = (double) $payment->rest;
         $this->date = self::createDateTime((string) $payment->date);
         $this->point = (int) $payment->point;
         $this->wmtranid = (int) $payment->wmtranid;
         $this->dateupd = self::createDateTime((string) $payment->dateupd);
     }
 }
コード例 #22
0
ファイル: Response.php プロジェクト: penwon/php-webmoney
 /**
  * @param string $response
  */
 public function __construct($response)
 {
     parent::__construct($response);
     $responseObject = new \SimpleXMLElement($response);
     $this->returnCode = (int) $responseObject->retval;
     $this->returnDescription = (string) $responseObject->retdesc;
     if (isset($responseObject->operation)) {
         $operation = $responseObject->operation;
         $this->transactionId = (int) $operation['id'];
         $this->transactionExternalId = (string) $operation->tranid;
         $this->payerPurse = (string) $operation->pursesrc;
         $this->payeePurse = (string) $operation->pursedest;
         $this->amount = (double) $operation->amount;
         $this->fee = (double) $operation->comiss;
         $this->type = (int) $operation->opertype;
         $this->period = (int) $operation->period;
         $this->invoiceId = (int) $operation->wminvid;
         $this->orderId = (int) $operation->orderid;
         $this->description = (string) $operation->desc;
         $this->createDateTime = self::createDateTime((string) $operation->datecrt);
         $this->updateDateTime = self::createDateTime((string) $operation->dateupd);
     }
 }