撤销订单
        :param order_id:
        :return:
335334
def cancel_order(self, order_id):
        
        params = {}
        path = f'/v1/order/orders/{order_id}/submitcancel'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_post(params, path))

            return handle

        return _wrapper
1110393
def get_event_orders(self, id, **data):
        
        
        return self.get("/events/{0}/orders/".format(id), data=data)
1030488
public function trigger( $order_id ) {
		$order = wc_get_order( $order_id );
		if ( ! $order || ! $this->is_enabled() ) {
			return;
		}
		$reason = get_post_meta( $order->id, '_hametwoo_cancel_reason', true );
		if ( ! $reason ) {
			// Don't send with no reason.
			return;
		}
		$this->object = $order;
		$this->recipient = $this->object->billing_email;
		// Is html?
		foreach ( [
			'order_number' => $order->get_order_number(),
		    'order_date'   => date_i18n( get_option( 'date_format' ) ),
		] as $find => $result ) {
			$this->find[ $find ] = "{{$find}}";
			$this->replace[ $find ] = $result;
		}
		$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
	}
1310466
def status_for_order(self, order_id, stock):
        
        url_fragment = 'venues/{venue}/stocks/{stock}/orders/{order_id}'.format(
            venue=self.venue,
            stock=stock,
            order_id=order_id,
        )
        url = urljoin(self.base_url, url_fragment)
        return self.session.get(url).json()
560743
public function eventOrderUpdate($order_id)
    {
        $source = $this->container->getSource(Source::Order, $order_id);
        $this->container->getInvoiceManager()->sourceStatusChange($source);
    }
427253
def cancel_order(self, order_param):
        
        order_id = order_param
        if isinstance(order_param, zipline.protocol.Order):
            order_id = order_param.id

        self.blotter.cancel(order_id)
100735
def order_stop(backend, order_run_id):
    
    if order_run_id is None:
        raise click.ClickException('invalid order id %s' % order_run_id)

    click.secho('%s - Stop order id %s' % (get_datetime(), order_run_id), fg='green')
    check_and_print(DKCloudCommandRunner.stop_orderrun(backend.dki, order_run_id.strip()))
671935
def query_order(self, transaction_id=None, out_trade_no=None):
        
        if not transaction_id and not out_trade_no:
            raise ValueError("transaction_id and out_trade_no must be a choice.")
        data = {
            "appid": self.appid,
            "mch_id": self.mch_id,
            "transaction_id": transaction_id,
            "out_trade_no": out_trade_no,
        }
        return self._post("pay/paporderquery", data=data)
1300455
def cancel_order(self, order_id: str) -> str:
        """"""
        self.log.debug(f'Canceling order id={order_id} on {self.name}')

        if self.dry_run:  # Don't cancel if dry run
            self.log.warning(f'DRY RUN: Order cancelled on {self.name}: id={order_id}')
            return order_id

        try:  # Cancel order
            self._cancel_order(order_id)
        except Exception as e:
            raise self.exception(OrderNotFound, f'Failed to cancel order: id={order_id}', e) from e

        self.log.info(f'Order cancelled on {self.name}: id={order_id}')
        return order_id
557694
protected function getOrder($orderId)
    {
        if (null == $order = OrderQuery::create()->findPk($orderId)) {
            $this->getLog()->addError(
                $this->getTranslator()->trans("Unknown order ID:  %id", array('%id' => $orderId))
            );
        }

        return $order;
    }
661253
public function payGetOrder($order_id)
    {
        $url = "https://api.weixin.qq.com/card/pay/getorder?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['order_id' => $order_id]);
    }
598296
def cancel(self,order_id):
        ''' 
        '''
        url= 'https://coincheck.com/api/exchange/orders/' + order_id
        headers = make_header(url,access_key=self.access_key,secret_key=self.secret_key)
        r = requests.delete(url,headers=headers)
        return json.loads(r.text)
797440
def get_order_info(self, order_id, _async=False):
        
        params = {}
        path = f'/v1/order/orders/{order_id}'
        return api_key_get(params, path, _async=_async)
1283675
def create_order(self, order):
        
        url = "{0}/{1}/accounts/{2}/orders".format(
            self.domain,
            self.API_VERSION,
            self.account_id
        )
        try:
            return self._Client__call(
                uri=url,
                params=order.__dict__,
                method="post"
            )
        except RequestException:
            return False
        except AssertionError:
            return False
606155
public function getPaymentSuccessPageUrl($order_id)
    {
        $frontOfficeRouter = $this->getContainer()->get('router.front');

        return URL::getInstance()->absoluteUrl(
            $frontOfficeRouter->generate(
                "order.placed",
                array("order_id" => $order_id),
                Router::ABSOLUTE_URL
            )
        );
    }
43757
def cancel_order(self, order_id, _async=False):
        
        params = {}
        path = f'/v1/order/orders/{order_id}/submitcancel'
        return api_key_post(params, path, _async=_async)
637980
public function generateAction(Request $request, $order_id)
    {
        $manager = $this->getDoctrine()->getManager();
        $repo = $manager->getRepository('LibrinfoEcommerceBundle:Order');

        $order = $repo->find($order_id);
        if (!$order) {
            throw $this->createNotFoundException(sprintf('Unable to find the order with id : %s', $order_id));
        }

        $this->admin->checkAccess('create');

        if ($order->getCheckoutState() != 'completed') {
            throw new \Exception('Checkout is not completed');
        }

        if (count($order->getInvoices()) > 0) {
            throw new \Exception('Invoice has already been generated');
        }

        $invoiceFactory = $this->container->get('librinfo_ecommerce.factory.invoice');
        $invoice = $invoiceFactory->createForOrder($order);
        $manager->persist($invoice);
        $manager->flush();

        $order->addInvoice($invoice);

        $html = $this->renderView('LibrinfoEcommerceBundle:OrderAdmin/Show:_invoices_inner.html.twig', ['object' => $order]);

        return new JsonResponse(['html' => $html]);
    }