Пример #1
0
 def test_oauth_parameters(self):
     uri = "https://sandbox.api.mastercard.com/fraud/merchant/v1/termination-inquiry?Format=XML&PageOffset=0"
     method = "POST"
     parameters = OAuth().get_oauth_parameters(uri, method, 'payload',
                                               'dummy',
                                               OAuthTest.signing_key)
     consumer_key = parameters.get_oauth_consumer_key()
     self.assertEqual("dummy", consumer_key)
Пример #2
0
 def test_oauth_parameters(self):
     uri = "https://sandbox.api.mastercard.com/fraud/merchant/v1/termination-inquiry?Format=XML&PageOffset=0"
     method = "POST"
     parameters = OAuth().get_oauth_parameters(uri, method, "payload",
                                               self.consumer_key,
                                               self.signing_key)
     # print(parameters)
     consumer_key = parameters.get_oauth_consumer_key()
Пример #3
0
    def test_oauth_parameters(self):
        if os.path.exists('./test_key_container.p12'):
            signing_key = authenticationutils.load_signing_key(
                "./test_key_container.p12", "Password1")
            consumer_key = OAuthSigner("YOUR CONSUMER KEY", signing_key)

            uri = "https://sandbox.api.mastercard.com/fraud/merchant/v1/termination-inquiry?Format=XML&PageOffset=0"
            method = "POST"
            parameters = OAuth().get_oauth_parameters(uri, method, "payload",
                                                      consumer_key,
                                                      signing_key)
            # print(parameters)
            consumer_key = parameters.get_oauth_consumer_key()
        else:
            print(
                "Please add a ./test_key_container.p12 file to enable key tests"
            )