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


Python transaction.Transaction类代码示例

本文整理汇总了Python中braintree.transaction.Transaction的典型用法代码示例。如果您正苦于以下问题:Python Transaction类的具体用法?Python Transaction怎么用?Python Transaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: tr_data_for_credit

 def tr_data_for_credit(self, tr_data, redirect_url):
     if "transaction" not in tr_data:
         tr_data["transaction"] = {}
     tr_data["transaction"]["type"] = Transaction.Type.Credit
     Resource.verify_keys(tr_data, [{"transaction": Transaction.create_signature()}])
     tr_data["kind"] = TransparentRedirect.Kind.CreateTransaction
     return self.gateway.transparent_redirect.tr_data(tr_data, redirect_url)
开发者ID:SalesSeek,项目名称:braintree_python,代码行数:7,代码来源:transaction_gateway.py

示例2: update_details

 def update_details(self, transaction_id, params={}):
     Resource.verify_keys(params, Transaction.update_details_signature())
     response = self.config.http().put(self.config.base_merchant_path() + "/transactions/" + transaction_id + "/update_details",
             {"transaction": params})
     if "transaction" in response:
         return SuccessfulResult({"transaction": Transaction(self.gateway, response["transaction"])})
     elif "api_error_response" in response:
         return ErrorResult(self.gateway, response["api_error_response"])
开发者ID:OVRLab,项目名称:AWSLambda,代码行数:8,代码来源:transaction_gateway.py

示例3: submit_for_settlement

 def submit_for_settlement(self, transaction_id, amount=None, params={}):
     Resource.verify_keys(params, Transaction.submit_for_settlement_signature())
     transaction_params = {"amount": amount}
     transaction_params.update(params)
     response = self.config.http().put(self.config.base_merchant_path() + "/transactions/" + transaction_id + "/submit_for_settlement",
             {"transaction": transaction_params})
     if "transaction" in response:
         return SuccessfulResult({"transaction": Transaction(self.gateway, response["transaction"])})
     elif "api_error_response" in response:
         return ErrorResult(self.gateway, response["api_error_response"])
开发者ID:LikeALocal,项目名称:braintree_python,代码行数:10,代码来源:transaction_gateway.py

示例4: refund

    def refund(self, transaction_id, amount_or_options=None):
        """
        Refunds an existing transaction. It expects a transaction_id. ::

            result = braintree.Transaction.refund("my_transaction_id")
        """
        if isinstance(amount_or_options, dict):
            options = amount_or_options
        else:
            options = {
                "amount": amount_or_options
            }
        Resource.verify_keys(options, Transaction.refund_signature())
        response = self.config.http().post(self.config.base_merchant_path() + "/transactions/" + transaction_id + "/refund", {"transaction": options})
        if "transaction" in response:
            return SuccessfulResult({"transaction": Transaction(self.gateway, response["transaction"])})
        elif "api_error_response" in response:
            return ErrorResult(self.gateway, response["api_error_response"])
开发者ID:OVRLab,项目名称:AWSLambda,代码行数:18,代码来源:transaction_gateway.py

示例5: create

 def create(self, params):
     Resource.verify_keys(params, Transaction.create_signature())
     return self._post("/transactions", {"transaction": params})
开发者ID:SalesSeek,项目名称:braintree_python,代码行数:3,代码来源:transaction_gateway.py

示例6: clone_transaction

 def clone_transaction(self, transaction_id, params):
     Resource.verify_keys(params, Transaction.clone_signature())
     return self._post("/transactions/" + transaction_id + "/clone", {"transaction-clone": params})
开发者ID:SalesSeek,项目名称:braintree_python,代码行数:3,代码来源:transaction_gateway.py


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