コード例 #1
0
ファイル: SoapClient.php プロジェクト: jayveloper/fcontrol
 /**
  * Send an order transaction to be analyzed by FControl.
  * @param Order $order Order to be publish.
  * @return PublishResponse Service response success true when adds on queue your transaction.
  */
 public function publish(Order $order)
 {
     $order->setAuthentication(Authentication::createFromConfiguration($this->getConfiguration()));
     $order->setTest($this->getConfiguration()->isTest());
     $response = $this->__soapCall('enfileirarTransacao9', array(array('pedido' => $order->toArray())));
     return new PublishResponse($response);
 }
コード例 #2
0
ファイル: ClientMock.php プロジェクト: jayveloper/fcontrol
 /**
  * It will simulate a send order transaction to be analyzed by FControl.
  * @param Order $order Order to be publish.
  * @return PublishResponse For Success Response, try to send Order EVEN Grand Total otherwise ODD Grand Total
  */
 public function publish(Order $order)
 {
     $serviceResponse = new PublishFailed($order);
     if ($order->getGrandTotal() % 2 == 0) {
         $serviceResponse = new PublishSuccessful($order);
     }
     return new PublishResponse($serviceResponse);
 }
コード例 #3
0
ファイル: Order.php プロジェクト: jayveloper/fcontrol
 public function __construct()
 {
     $products = ProductCollection::createRandomProducts(1);
     parent::__construct(rand(1, 9999), new \DateTime('now'), $products->getGrandTotal(), new Buyer(), new Delivery(), PaymentCollection::createCreditCardPayment($products->getGrandTotal()), $products, new Status(Status::PENDING), true, Order::INTEGRATOR_CODE_UNKNOWN);
     $this->addExtraData(null);
     $this->addExtraData(null);
     $this->addExtraData(null);
     $this->addExtraData(null);
     $this->setSalesChannel('Internet');
     $this->setFreightTotal(0);
     $this->setDeliveryType('Sedex');
     $this->setDeliveryDate(new \DateTime('2013-08-29 00:00:00'));
 }