コード例 #1
1
 /**
  * @group integration
  */
 public function testCallMerchantAliasCreation()
 {
     return true;
     /* Creating the WebService main object */
     $test = new CreateMerchantAlias();
     /* Creating the WebService message object */
     $testArgument = new CreateMerchantAliasRequest();
     /* Setting the parameters */
     $testAlias = new Alias();
     $testAlias->setAliasName("351#911521624");
     $testAlias->setAliasTypeCde(Alias::CELLPHONE);
     $testArgument->setAlias($testAlias);
     $testMerchant = new Merchant();
     $testMerchant->setIPAddress($this->getConfig()->getMerchantIP())->setPosId($this->getConfig()->getMerchantPosId());
     $testArgument->setMerchant($testMerchant);
     $testMsgProps = new MessageProperties();
     $testMsgProps->setChannel("01");
     $testMsgProps->setChannelTypeCode("VPOS");
     $testMsgProps->setNetworkCode("MULTIB");
     $merchantTimestamp = date_create("2014-09-28");
     $testMsgProps->setTimestamp($merchantTimestamp);
     $testMsgProps->setServiceType("01");
     $testMsgProps->setApiVersion("1");
     $testArgument->setMessageProperties($testMsgProps);
     $testNewAlias = new Alias();
     $testNewAlias->setAliasName("mykubo-mbway-1234567891234");
     $testNewAlias->setAliasTypeCde(Alias::GENERIC);
     $testArgument->setNewAlias($testNewAlias);
     $test->setArg0($testArgument);
     $service = new MBWayClient($this->getConfig());
     $service->setSandbox(true);
     $response = $service->createMerchantAlias($test);
     $return = $response->getReturn();
     //Return 124 because merchant didn't make any purchase before
     $this->assertSame("124", $return->getStatusCode());
 }
コード例 #2
0
ファイル: MerchantTest.php プロジェクト: prbdias/mbway-php
 /**
  * @depends testConstructor
  *
  * @param Merchant $merchant
  */
 public function testGettersSetters(Merchant $merchant)
 {
     $merchant->setIPAddress('200.1.23.199');
     $merchant->setPosId('posid2');
     $this->assertSame($merchant->getIPAddress(), '200.1.23.199');
     $this->assertSame($merchant->getPosId(), 'posid2');
 }
コード例 #3
0
 /**
  * @group integration
  * @return array
  */
 public function requestProvider()
 {
     $request = new RequestFinancialOperationRequest();
     $alias = new Alias();
     $alias->setAliasName("351#911521624")->setAliasTypeCde(Alias::CELLPHONE);
     $merchant = new Merchant();
     $merchant->setIPAddress($this->getConfig()->getMerchantIP())->setPosId($this->getConfig()->getMerchantPosId());
     $messageProperties = new MessageProperties();
     $messageProperties->setApiVersion("1")->setChannel("01")->setChannelTypeCode("VPOS")->setNetworkCode("MULTIB")->setServiceType("01")->setTimestamp(date_create("2014-10-04"));
     $request->setAditionalData("TESTE")->setAlias($alias)->setMerchant($merchant)->setMessageProperties($messageProperties);
     return array(array($request));
 }