本文整理匯總了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: ")