当前位置: 首页>>代码示例>>PHP>>正文


PHP SoapClient::CreateOrder方法代码示例

本文整理汇总了PHP中SoapClient::CreateOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::CreateOrder方法的具体用法?PHP SoapClient::CreateOrder怎么用?PHP SoapClient::CreateOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SoapClient的用法示例。


在下文中一共展示了SoapClient::CreateOrder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSoapClientExample

 public function testSoapClientExample()
 {
     try {
         $oSoap = new SoapClient(null, array('location' => 'http://fintech-fab.dev', 'uri' => 'soap'));
         /**
          * @var VanguardOrder $oSoap
          */
         $oSoap->CreateOrder();
     } catch (Exception $oException) {
         //dd($oException);
     }
 }
开发者ID:PopovDmitry,项目名称:fintech-fab.ru,代码行数:12,代码来源:SoapTest.php

示例2: createOrderBasico

 public function createOrderBasico($id)
 {
     $pedido = Pedido::findOrFail($id);
     $cliente = Auth::user();
     if ($pedido->usuario->id != $cliente->id) {
         return false;
     }
     $valor_centavos = $pedido->total * 100;
     $input = Input::all();
     if ($input['parcelas'] < 1 || $input['parcelas'] > 6) {
         return false;
     }
     $client = new SoapClient('https://transaction.mundipaggone.com/MundiPaggService.svc?wsdl', array('trace' => true, 'exceptions' => true, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL, 'encoding' => 'UTF-8'));
     $createOrderRequest = new stdClass();
     $createOrderRequest->createOrderRequest = new stdClass();
     //$createOrderRequest->createOrderRequest->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->AmountInCents = $valor_centavos;
     $createOrderRequest->createOrderRequest->CurrencyIsoEnum = 'BRL';
     $createOrderRequest->createOrderRequest->MerchantKey = self::MerchantKey;
     $createOrderRequest->createOrderRequest->OrderReference = $pedido->id;
     $createOrderRequest->createOrderRequest->Buyer = new stdClass();
     $createOrderRequest->createOrderRequest->Buyer->Email = $cliente->email;
     $createOrderRequest->createOrderRequest->Buyer->HomePhone = '(11) 12345678';
     $createOrderRequest->createOrderRequest->Buyer->Name = $cliente->nome;
     $createOrderRequest->createOrderRequest->Buyer->PersonTypeEnum = 'Person';
     $createOrderRequest->createOrderRequest->Buyer->TaxDocumentNumber = $cliente->cpf;
     $createOrderRequest->createOrderRequest->Buyer->TaxDocumentTypeEnum = 'CPF';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection = [];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0] = new stdClass();
     //$createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = $valor_centavos;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CaptureDelayInMinutes = 0;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardBrandEnum = $input['cartao_marca'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardNumber = $input['cartao_num'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpMonth = $input['mes_exp'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpYear = $input['ano_exp'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->HolderName = $input['nome_titular'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->InstallmentCount = $input['parcelas'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->PaymentMethodCode = 1;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->SecurityCode = $input['cod_seguranca'];
     try {
         $auth = $client->CreateOrder($createOrderRequest);
         $result = $auth->CreateOrderResult;
         $cctResult = $result->CreditCardTransactionResultCollection->CreditCardTransactionResult;
         printf("Exemplo de integração Mundipagg com PHP - CreateOrder\n\n");
         printf("\t[%s -> %s] %s\n\n", $result->OrderStatusEnum, $cctResult->CreditCardTransactionStatusEnum, $cctResult->AcquirerMessage);
     } catch (SoapFault $e) {
         printf("Erro[%s]: %s\n%s\n\n", $e->getCode(), $e->getMessage(), $e->getTraceAsString());
     }
 }
开发者ID:WillyMaciel,项目名称:fwt,代码行数:50,代码来源:MundipaggController.php

示例3: createOrderBasico

 public function createOrderBasico($input, $pedido)
 {
     $cliente = Auth::user();
     $valor_centavos = $pedido->total * 100;
     $client = new SoapClient('https://transaction.mundipaggone.com/MundiPaggService.svc?wsdl', array('trace' => true, 'exceptions' => true, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL, 'encoding' => 'UTF-8'));
     $createOrderRequest = new stdClass();
     $createOrderRequest->createOrderRequest = new stdClass();
     //$createOrderRequest->createOrderRequest->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->AmountInCents = $valor_centavos;
     $createOrderRequest->createOrderRequest->CurrencyIsoEnum = 'BRL';
     $createOrderRequest->createOrderRequest->MerchantKey = self::MerchantKey;
     $createOrderRequest->createOrderRequest->OrderReference = $pedido->id;
     $createOrderRequest->createOrderRequest->Buyer = new stdClass();
     $createOrderRequest->createOrderRequest->Buyer->Email = $cliente->email;
     $createOrderRequest->createOrderRequest->Buyer->BuyerReference = $cliente->id;
     if ($cliente->sexo) {
         $createOrderRequest->createOrderRequest->Buyer->GenderEnum = $cliente->sexo;
     }
     if (isset($input['cpftitular']) && !empty($input['cpftitular'])) {
         $createOrderRequest->createOrderRequest->Buyer->TaxDocumentNumber = $input['cpftitular'];
         $createOrderRequest->createOrderRequest->Buyer->TaxDocumentTypeEnum = 'CPF';
     } else {
         $createOrderRequest->createOrderRequest->Buyer->TaxDocumentNumber = '00000000000';
         $createOrderRequest->createOrderRequest->Buyer->TaxDocumentTypeEnum = 'CPF';
     }
     $createOrderRequest->createOrderRequest->Buyer->HomePhone = $input['telefonetitular'];
     $createOrderRequest->createOrderRequest->Buyer->Name = $cliente->nome;
     $createOrderRequest->createOrderRequest->Buyer->PersonTypeEnum = 'Person';
     // $createOrderRequest->createOrderRequest->Buyer->TaxDocumentNumber = $cliente->cpf;
     // $createOrderRequest->createOrderRequest->Buyer->TaxDocumentTypeEnum = 'CPF';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection = [];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0] = new stdClass();
     //$createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = $valor_centavos;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CaptureDelayInMinutes = 0;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardBrandEnum = $input['card_brand'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardNumber = $input['card_number'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpMonth = $input['mes_cartao'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpYear = $input['ano_cartao'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->HolderName = $input['nometitular'];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->InstallmentCount = isset($input['parcelas']) ? $input['parcelas'] : 1;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->PaymentMethodCode = 0;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->SecurityCode = $input['cvv'];
     // try {
     $auth = $client->CreateOrder($createOrderRequest);
     $result = $auth->CreateOrderResult;
     // $cctResult = $result->CreditCardTransactionResultCollection->CreditCardTransactionResult;
     return $result;
     // printf("Exemplo de integração Mundipagg com PHP - CreateOrder\n\n");
     // printf("\t[%s -> %s] %s\n\n", $result->OrderStatusEnum,
     // $cctResult->CreditCardTransactionStatusEnum,
     // $cctResult->AcquirerMessage);
     // } catch (SoapFault $e) {
     // printf("Erro[%s]: %s\n%s\n\n", $e->getCode(), $e->getMessage(), $e->getTraceAsString());
     // }
 }
开发者ID:WillyMaciel,项目名称:fwt,代码行数:56,代码来源:Mundipagg.php

示例4: getPag

 public function getPag()
 {
     $client = new SoapClient('https://transaction.mundipaggone.com/MundiPaggService.svc?wsdl', array('trace' => true, 'exceptions' => true, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL, 'encoding' => 'UTF-8'));
     $createOrderRequest = new stdClass();
     $createOrderRequest->createOrderRequest = new stdClass();
     //$createOrderRequest->createOrderRequest->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->AmountInCents = 10000;
     $createOrderRequest->createOrderRequest->CurrencyIsoEnum = 'BRL';
     $createOrderRequest->createOrderRequest->MerchantKey = '0a31c3dc-f2f1-4327-841b-4feaf7db147d';
     $createOrderRequest->createOrderRequest->OrderReference = 'novoteste2';
     $createOrderRequest->createOrderRequest->Buyer = new stdClass();
     $createOrderRequest->createOrderRequest->Buyer->Email = 'comprador@email.com';
     $createOrderRequest->createOrderRequest->Buyer->HomePhone = '(11) 12345678';
     $createOrderRequest->createOrderRequest->Buyer->Name = 'Fulano de Tal';
     $createOrderRequest->createOrderRequest->Buyer->PersonTypeEnum = 'Person';
     $createOrderRequest->createOrderRequest->Buyer->TaxDocumentNumber = '000.000.000-00';
     $createOrderRequest->createOrderRequest->Buyer->TaxDocumentTypeEnum = 'CPF';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection = [];
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0] = new stdClass();
     //$createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = 105172;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->AmountInCents = 10000;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CaptureDelayInMinutes = 0;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardBrandEnum = 'Mastercard';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->CreditCardNumber = '5555666677778884';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpMonth = '1';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->ExpYear = '2018';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->HolderName = 'Fulano de Tal';
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->InstallmentCount = 1;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->PaymentMethodCode = 1;
     $createOrderRequest->createOrderRequest->CreditCardTransactionCollection[0]->SecurityCode = '123';
     try {
         $auth = $client->CreateOrder($createOrderRequest);
         $result = $auth->CreateOrderResult;
         $cctResult = $result->CreditCardTransactionResultCollection->CreditCardTransactionResult;
         printf("Exemplo de integração Mundipagg com PHP - CreateOrder\n\n");
         printf("\t[%s -> %s] %s\n\n", $result->OrderStatusEnum, $cctResult->CreditCardTransactionStatusEnum, $cctResult->AcquirerMessage);
     } catch (SoapFault $e) {
         printf("Erro[%s]: %s\n%s\n\n", $e->getCode(), $e->getMessage(), $e->getTraceAsString());
     }
 }
开发者ID:WillyMaciel,项目名称:fwt,代码行数:40,代码来源:CarrinhoController.php


注:本文中的SoapClient::CreateOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。