本文整理汇总了Python中visa.helpers.visa_api_client.VisaAPIClient.do_x_pay_request方法的典型用法代码示例。如果您正苦于以下问题:Python VisaAPIClient.do_x_pay_request方法的具体用法?Python VisaAPIClient.do_x_pay_request怎么用?Python VisaAPIClient.do_x_pay_request使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类visa.helpers.visa_api_client.VisaAPIClient
的用法示例。
在下文中一共展示了VisaAPIClient.do_x_pay_request方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestUpdatePaymentInformation
# 需要导入模块: from visa.helpers.visa_api_client import VisaAPIClient [as 别名]
# 或者: from visa.helpers.visa_api_client.VisaAPIClient import do_x_pay_request [as 别名]
class TestUpdatePaymentInformation(unittest.TestCase):
config = parser.ConfigParser()
config_path = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)),'..','configuration.ini'))
config.read(config_path)
def setUp(self):
self.visa_api_client = VisaAPIClient()
self.update_payment_info_request = json.loads('''{
"orderInfo": {
"currencyCode": "USD",
"discount": "5.25",
"eventType": "Confirm",
"giftWrap": "10.1",
"misc": "3.2",
"orderId": "testorderID",
"promoCode": "testPromoCode",
"reason": "Order Successfully Created",
"shippingHandling": "5.1",
"subtotal": "80.1",
"tax": "7.1",
"total": "101"
}
}''')
def test_update_payment_info(self):
base_uri = 'wallet-services-web/'
resource_path = 'payment/info/{callId}'
resource_path = resource_path.replace('{callId}', self.config.get('VDP','checkoutCallId'))
query_string = 'apikey=' + self.config.get('VDP','apiKey')
response = self.visa_api_client.do_x_pay_request(base_uri, resource_path , query_string, self.update_payment_info_request, 'Update Payment Information Test', 'put')
self.assertEqual(str(response.status_code) ,"200" ,"Update Payment Information test failed")
pass
示例2: TestCybersourcePayment
# 需要导入模块: from visa.helpers.visa_api_client import VisaAPIClient [as 别名]
# 或者: from visa.helpers.visa_api_client.VisaAPIClient import do_x_pay_request [as 别名]
class TestCybersourcePayment(unittest.TestCase):
config = parser.ConfigParser()
config_path = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)),'..','configuration.ini'))
config.read(config_path)
def setUp(self):
self.visa_api_client = VisaAPIClient()
self.payment_authorization_request = json.loads('''{
"amount": "0",
"currency": "USD",
"payment": {
"cardNumber": "4111111111111111",
"cardExpirationMonth": "10",
"cardExpirationYear": "2016"
}
}''')
def test_cybersource_payment_authorization(self):
base_uri = 'cybersource/'
resource_path = 'payments/v1/authorizations'
query_string = 'apikey=' + self.config.get('VDP','apiKey')
response = self.visa_api_client.do_x_pay_request(base_uri, resource_path , query_string, self.payment_authorization_request, 'Cybersource Payments Test', 'post')
self.assertEqual(str(response.status_code) ,"201" ,"Cybersource payments test failed")
pass
示例3: TestGetPaymentData
# 需要导入模块: from visa.helpers.visa_api_client import VisaAPIClient [as 别名]
# 或者: from visa.helpers.visa_api_client.VisaAPIClient import do_x_pay_request [as 别名]
class TestGetPaymentData(unittest.TestCase):
config = parser.ConfigParser()
config_path = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)),'..','configuration.ini'))
config.read(config_path)
def setUp(self):
self.visa_api_client = VisaAPIClient()
def test_get_payment_info(self):
base_uri = 'wallet-services-web/'
resource_path = 'payment/data/{callId}'
resource_path = resource_path.replace('{callId}', self.config.get('VDP','checkoutCallId'))
query_string = 'apikey=' + self.config.get('VDP','apiKey')
response = self.visa_api_client.do_x_pay_request(base_uri, resource_path , query_string, '', 'Get Payments Information Test', 'get')
self.assertEqual(str(response.status_code) ,"200" ,"Get Payments Information test failed")
pass