https://developers.coinbase.com/api/v2#create-checkout
491231
def create_checkout(self, **params):
        """"""
        for required in ['amount', 'currency', 'name']:
            if required not in params:
                raise ValueError("Missing required parameter: %s" % required)
        response = self._post('v2', 'checkouts', data=params)
        return self._make_api_object(response, Checkout)
711647
def checkout(self, revision, options):
        
        rev = revision.key
        self.repo.git.checkout(rev)
569698
def get_checkout_orders(self, checkout_id, **params):
        """"""
        response = self._get('v2', 'checkouts', checkout_id, 'orders', params=params)
        return self._make_api_object(response, Order)
412508
def checkout
      response = gateway.purchase(payment.price,
                                  currency: payment.currency.to_s,
                                  client_ip_addr: request.remote_ip,
                                  description: payment.description,
                                  language: payment.first_data_language)
      if response[:transaction_id]
        trx = LolitaFirstData::Transaction.add(payment, request, response)
        redirect_to gateway.redirect_url(trx.transaction_id)
      else
        if request.xhr? || !request.referer
          render text: I18n.t('fd.purchase_failed'), status: 400
        else
          flash[:error] = I18n.t('fd.purchase_failed')
          redirect_to :back
        end
      end
    ensure
      LolitaFirstData.logger.info("[#{session_id}][#{payment.id}][checkout] #{response}")
    end
1165037
def make_order(self, crypto, fiat, amount, price, type="limit"):
        
        raise NotImplementedError(
            self.name + " does not support making orders. "
            "Or rather it has no defined 'make_order' method."
        )
202290
def newAddress(self, currency='btc', label=''):
        
        request = '/v1/deposit/' + currency + '/newAddress'
        url = self.base_url + request
        params = {
            'request': request,
            'nonce': self.get_nonce()
        }

        if label != '':
            params['label'] = label

        return requests.post(url, headers=self.prepare(params))
492476
def checkout(self):
        '''
        
        '''
        tgt_ref = self.get_checkout_target()
        local_ref = 'refs/heads/' + tgt_ref
        remote_ref = 'refs/remotes/origin/' + tgt_ref
        tag_ref = 'refs/tags/' + tgt_ref

        try:
            local_head = self.repo.lookup_reference('HEAD')
        except KeyError:
            log.warning(
                'HEAD not present in %s remote \'%s\'', self.role, self.id
            )
            return None

        try:
            head_sha = self.peel(local_head).hex
        except AttributeError:
            # Shouldn't happen, but just in case a future pygit2 API change
            # breaks things, avoid a traceback and log an error.
            log.error(
                'Unable to get SHA of HEAD for %s remote \'%s\'',
                self.role, self.id
            )
            return None
        except KeyError:
            head_sha = None

        refs = self.repo.listall_references()

        def _perform_checkout(checkout_ref, branch=True):
            '''
            DRY function for checking out either a branch or a tag
            '''
            try:
                with self.gen_lock(lock_type='checkout'):
                    # Checkout the local branch corresponding to the
                    # remote ref.
                    self.repo.checkout(checkout_ref)
                    if branch:
                        self.repo.reset(oid, pygit2.GIT_RESET_HARD)
                return True
            except GitLockError as exc:
                if exc.errno == errno.EEXIST:
                    # Re-raise with a different strerror containing a
                    # more meaningful error message for the calling
                    # function.
                    raise GitLockError(
                        exc.errno,
                        'Checkout lock exists for {0} remote \'{1}\''
                        .format(self.role, self.id)
                    )
                else:
                    log.error(
                        'Error %d encountered obtaining checkout lock '
                        'for %s remote \'%s\'',
                        exc.errno,
                        self.role,
                        self.id
                    )
            return False

        try:
            if remote_ref in refs:
                # Get commit id for the remote ref
                oid = self.peel(self.repo.lookup_reference(remote_ref)).id
                if local_ref not in refs:
                    # No local branch for this remote, so create one and point
                    # it at the commit id of the remote ref
                    self.repo.create_reference(local_ref, oid)

                try:
                    target_sha = \
                        self.peel(self.repo.lookup_reference(remote_ref)).hex
                except KeyError:
                    log.error(
                        'pygit2 was unable to get SHA for %s in %s remote '
                        '\'%s\'', local_ref, self.role, self.id,
                        exc_info=True
                    )
                    return None

                # Only perform a checkout if HEAD and target are not pointing
                # at the same SHA1.
                if head_sha != target_sha:
                    # Check existence of the ref in refs/heads/ which
                    # corresponds to the local HEAD. Checking out local_ref
                    # below when no local ref for HEAD is missing will raise an
                    # exception in pygit2 >= 0.21. If this ref is not present,
                    # create it. The "head_ref != local_ref" check ensures we
                    # don't try to add this ref if it is not necessary, as it
                    # would have been added above already. head_ref would be
                    # the same as local_ref if the branch name was changed but
                    # the cachedir was not (for example if a "name" parameter
                    # was used in a git_pillar remote, or if we are using
                    # winrepo which takes the basename of the repo as the
                    # cachedir).
                    head_ref = local_head.target
                    # If head_ref is not a string, it will point to a
                    # pygit2.Oid object and we are in detached HEAD mode.
                    # Therefore, there is no need to add a local reference. If
                    # head_ref == local_ref, then the local reference for HEAD
                    # in refs/heads/ already exists and again, no need to add.
                    if isinstance(head_ref, six.string_types) \
                            and head_ref not in refs and head_ref != local_ref:
                        branch_name = head_ref.partition('refs/heads/')[-1]
                        if not branch_name:
                            # Shouldn't happen, but log an error if it does
                            log.error(
                                'pygit2 was unable to resolve branch name from '
                                'HEAD ref \'%s\' in %s remote \'%s\'',
                                head_ref, self.role, self.id
                            )
                            return None
                        remote_head = 'refs/remotes/origin/' + branch_name
                        if remote_head not in refs:
                            # No remote ref for HEAD exists. This can happen in
                            # the first-time git_pillar checkout when when the
                            # remote repo does not have a master branch. Since
                            # we need a HEAD reference to keep pygit2 from
                            # throwing an error, and none exists in
                            # refs/remotes/origin, we'll just point HEAD at the
                            # remote_ref.
                            remote_head = remote_ref
                        self.repo.create_reference(
                            head_ref,
                            self.repo.lookup_reference(remote_head).target
                        )

                    if not _perform_checkout(local_ref, branch=True):
                        return None

                # Return the relative root, if present
                return self.check_root()

            elif tag_ref in refs:
                tag_obj = self.repo.revparse_single(tag_ref)
                if not isinstance(tag_obj, pygit2.Commit):
                    log.error(
                        '%s does not correspond to pygit2.Commit object',
                        tag_ref
                    )
                else:
                    try:
                        # If no AttributeError raised, this is an annotated tag
                        tag_sha = tag_obj.target.hex
                    except AttributeError:
                        try:
                            tag_sha = tag_obj.hex
                        except AttributeError:
                            # Shouldn't happen, but could if a future pygit2
                            # API change breaks things.
                            log.error(
                                'Unable to resolve %s from %s remote \'%s\' '
                                'to either an annotated or non-annotated tag',
                                tag_ref, self.role, self.id,
                                exc_info=True
                            )
                            return None
                    log.debug('SHA of tag %s: %s', tgt_ref, tag_sha)

                    if head_sha != tag_sha:
                        if not _perform_checkout(tag_ref, branch=False):
                            return None

                    # Return the relative root, if present
                    return self.check_root()
        except GitLockError:
            raise
        except Exception as exc:
            log.error(
                'Failed to checkout %s from %s remote \'%s\': %s',
                tgt_ref, self.role, self.id, exc,
                exc_info=True
            )
            return None
        log.error(
            'Failed to checkout %s from %s remote \'%s\': remote ref '
            'does not exist', tgt_ref, self.role, self.id
        )
        return None
621785
function Orders (coinjar) {
  var self = this;
  self.coinjar = coinjar;

  var result = function() {
    if(util.isFunction(arguments[0])) {
      list.apply(self, arguments); // callback, limit, offset
    }
    else {
      get.apply(self, arguments); // id, callback
    }
  };

  result.create = function(cuurency, merchant_invoice, merchant_reference, notify_url, return_url, cancel_url, order_items_array, callback) {
    create.call(self, cuurency, merchant_invoice, merchant_reference, notify_url, return_url, cancel_url, order_items_array, callback);
  };

  return result;
}
312648
function create() {
		// Check form for errors
		if(!$("#privateKey").val() || !$("#recipient").val()) return alert('Missing parameter !');
		if(undefined === $("#amount").val() || !nem.utils.helpers.isTextAmountValid($("#amount").val())) return alert('Invalid amount !');
		if (!nem.model.address.isValid(nem.model.address.clean($("#recipient").val()))) return alert('Invalid recipent address !');

		// Set the private key in common object
		common.privateKey = $("#privateKey").val();

		// Check private key for errors
		if (common.privateKey.length !== 64 && common.privateKey.length !== 66) return alert('Invalid private key, length must be 64 or 66 characters !');
    	if (!nem.utils.helpers.isHexadecimal(common.privateKey)) return alert('Private key must be hexadecimal only !');

		// Set the cleaned amount into transfer transaction object
		transferTransaction.amount = nem.utils.helpers.cleanTextAmount($("#amount").val());

		// Recipient address must be clean (no hypens: "-")
		transferTransaction.recipient = nem.model.address.clean($("#recipient").val());

		// Set message
		transferTransaction.message = $("#message").val();

		// Prepare the updated transfer transaction object
		var transactionEntity = nem.model.transactions.prepare("transferTransaction")(common, transferTransaction, nem.model.network.data.testnet.id);

		// Create a key pair object from private key
		var kp = nem.crypto.keyPair.create(nem.utils.helpers.fixPrivateKey(common.privateKey));

		// Serialize the transaction
		var serialized = nem.utils.serialization.serializeTransaction(transactionEntity);

		// Sign the serialized transaction with keypair object
	    var signature = kp.sign(serialized);

	    // Build the object to send
	    var result = {
	        'data': nem.utils.convert.ua2hex(serialized),
	        'signature': signature.toString()
	    };

	    // Show the object to send in view
	    $("#result").val(JSON.stringify(result));
	}
1301208
def checkout(number, branch = true)
      request = server.get_request_by_number(number)
      puts 'Checking out changes to your local repository.'
      puts 'To get back to your original state, just run:'
      puts
      puts '  git checkout master'.pink
      puts
      # Ensure we are looking at the right remote.
      remote = local.remote_for_request(request)
      git_call "fetch #{remote}"
      # Checkout the right branch.
      branch_name = request.head.ref
      if branch
        if local.branch_exists?(:local, branch_name)
          if local.source_branch == branch_name
            puts "On branch #{branch_name}."
          else
            git_call "checkout #{branch_name}"
          end
        else
          git_call "checkout --track -b #{branch_name} #{remote}/#{branch_name}"
        end
      else
        git_call "checkout #{remote}/#{branch_name}"
      end
    end
420863
def coinbase_tx(cls, public_key_sec, coin_value, coinbase_bytes=b'', version=1, lock_time=0):
        """"""
        tx_in = cls.TxIn.coinbase_tx_in(script=coinbase_bytes)
        COINBASE_SCRIPT_OUT = "%s OP_CHECKSIG"
        script_text = COINBASE_SCRIPT_OUT % b2h(public_key_sec)
        script_bin = BitcoinScriptTools.compile(script_text)
        tx_out = cls.TxOut(coin_value, script_bin)
        return cls(version, [tx_in], [tx_out], lock_time)
44109
def checkout
      begin
        svn_session() do |ctx|
           ctx.checkout(@svn_repo_master, @svn_repo_working_copy)
        end
      #rescue Svn::Error::RaLocalReposOpenFailed,
      #       Svn::Error::FsAlreadyExists,
      #rescue Errno::EACCES => e
      rescue Exception => err
        raise RepoAccessError, err.message
      end
    end
662795
def checkout(self, repo_dir, shared_dir, **kwargs):
        """"""
        del kwargs
        args = []
        for checkout_fn in _CHECKOUT_ARG_BUILDERS:
            args.extend(checkout_fn(shared_dir, repo_dir, self._args))
        return args
128223
function get(uuid, callback) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var order_url = this.coinjar.merchant.orders_endpoint + '/',
    resource = this.coinjar.merchant.api_endpoint +
      '/v1/orders/' +
      uuid +
      '.json';

  request.get(resource)
    .auth(this.coinjar.merchant.uuid, this.coinjar.merchant.secret)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      // build the payment page url
      response.body.order.payment_page_url = order_url + response.body.order.uuid;
      return callback(null, response.body.order);
    });
}
1182201
function createCoincap () {
  const socket = io(baseUrl, { autoConnect: false })

  const api = {}

  // Add JSON API supported endpoints
  ;[
    {
      method: 'coins',
      url: () => '/coins'
    },
    {
      method: 'map',
      url: () => '/map'
    },
    {
      method: 'front',
      url: () => '/front'
    },
    {
      method: 'global',
      url: () => '/global'
    },
    {
      method: 'coin',
      url: coin => `/page/${coin}`
    },
    {
      method: 'coinHistory',
      url: (coin, days) => `/history/${days ? `${days}day/` : ''}${coin}`
    }
  ].forEach(function ({ method, url }) {
    api[method] = (...args) => fetch(url(...args))
  })

  // Add Socket.IO methods
  ;[
    'open',
    'close',
    'on',
    'off'
  ].forEach(function (method) {
    api[method] = socket[method].bind(socket)
  })

  return api
}
1149780
function list(callback, limit, offset) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var resource = this.coinjar.merchant.api_endpoint + '/v1/orders.json',
    order_url = this.coinjar.merchant.orders_endpoint + '/',
    query = {};

  if(limit) { query.limit = limit; }
  if(offset) { query.offset = offset; }

  request.get(resource)
    .auth(this.coinjar.merchant.uuid, this.coinjar.merchant.secret)
    .query(query)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      // build the payment page url for each order object
      var i = response.body.orders.length;
      while (i--) {
        response.body.orders[i].payment_page_url = order_url + response.body.orders[i].uuid;
      }
      return callback(null, response.body.orders);
    });
}
119691
def checkout(self, *args, **kwargs):
        """"""
        self._call_helper("Checking out", self.real.checkout, *args, **kwargs)