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


Python VisaAPIClient.do_x_pay_request方法代码示例

本文整理汇总了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
开发者ID:AravindaM,项目名称:SampleCode,代码行数:35,代码来源:test_update_payment_information.py

示例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
开发者ID:KrishnaNellutla,项目名称:SampleCode,代码行数:27,代码来源:test_cybersource_payment.py

示例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
开发者ID:AravindaM,项目名称:SampleCode,代码行数:19,代码来源:test_get_payment_data.py


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