本文整理汇总了Python中PythonNetBanxSDK.OptimalApiClient.OptimalApiClient.to_dictionary方法的典型用法代码示例。如果您正苦于以下问题:Python OptimalApiClient.to_dictionary方法的具体用法?Python OptimalApiClient.to_dictionary怎么用?Python OptimalApiClient.to_dictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonNetBanxSDK.OptimalApiClient.OptimalApiClient
的用法示例。
在下文中一共展示了OptimalApiClient.to_dictionary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SampleTest_Hosted
# 需要导入模块: from PythonNetBanxSDK.OptimalApiClient import OptimalApiClient [as 别名]
# 或者: from PythonNetBanxSDK.OptimalApiClient.OptimalApiClient import to_dictionary [as 别名]
#.........这里部分代码省略.........
print ("Create Order Response: ")
print (response_object.__dict__)
def process_order_with_payment_token(self):
'''
Process order with payment token
'''
order_obj = Order(None)
order_obj.customerIp("14.140.42.67")
order_obj.merchantRefNum(RandomTokenGenerator().generateToken())
order_obj.currencyCode("USD")
order_obj.totalAmount("2006")
order_obj.customerNotificationEmail("[email protected]")
profile_obj = Profile(None)
profile_obj.id("ee2c3dc6-022c-4d7e-a1ab-685cf28c7aad")
profile_obj.paymentToken("Pff1PwG5LFuiq5q")
order_obj.profile(profile_obj)
# eo_list = []
# eo = ExtendedOptions(None)
# eo.key("silentPost")
# eo.value("true")
# eo_list.append(eo)
# order_obj.extendedOptions(eo_list)
self._optimal_obj = OptimalApiClient(api_key=self._api_key,
api_password=self._api_password,
env="TEST",
account_number=self._account_number)
print("===", self._optimal_obj.to_dictionary(order_obj))
response_object = self._optimal_obj.hosted_payment_service_handler(
).create_order(order_obj)
print ("Create Order Response: ")
print (response_object.__dict__)
print (response_object.id)
def process_order_with_profile_id(self):
'''
Process an order with profile Id
'''
order_obj = Order(None)
order_obj.customerIp("14.140.42.67")
order_obj.merchantRefNum(str(RandomTokenGenerator().generateToken()))
order_obj.currencyCode("USD")
order_obj.totalAmount("3000")
order_obj.customerNotificationEmail("[email protected]")
profile_obj = Profile(None)
profile_obj.id("fe141eb8-00a3-4725-83f2-b1e5cbe8b817")
order_obj.profile(profile_obj)
self._optimal_obj = OptimalApiClient(api_key=self._api_key,
api_password=self._api_password, env="TEST",
account_number=self._account_number)
response_object = self._optimal_obj.hosted_payment_service_handler(
).create_order(order_obj)
print ("Create Order Response: ")