Ejemplo n.º 1
0
 def test_9_confirm_application(self):
     admin_client = AcrosureClient(token=TEST_SECRET_KEY, api_url=API_URL)
     application = admin_client.application
     resp = application.confirm(self.__class__.APP_ID)
     confirmed_application = resp["data"]
     self.assertTrue(confirmed_application)
     self.assertTrue(confirmed_application["id"])
     self.assertEqual(confirmed_application["status"], "CONFIRMING")
Ejemplo n.º 2
0
class ClientTestCase(unittest.TestCase):
    def setUp(self):
        self.client = AcrosureClient(TEST_SECRET_KEY, API_URL)

    def test_verify_webhook_signature(self):
        is_valid = self.client.verify_signature(
            "1b0a6f0c0986671819cd19c38e201719b0531e72dfba312ca121190ea662a97b",
            "{\"data\":\"อโครชัว!\"}")
        self.assertTrue(is_valid)
Ejemplo n.º 3
0
 def setUp(self):
     self.client = AcrosureClient(TEST_SECRET_KEY, API_URL)
Ejemplo n.º 4
0
 def setUp( self ):
     self.client = AcrosureClient(TEST_PUBLIC_KEY, API_URL)
     self.data = self.client.data
Ejemplo n.º 5
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from acrosure_sdk import AcrosureClient

client = AcrosureClient("token1", "app1", "product1")
client.verify_signature(
    'f84c04fbe06d1d1bd96cf99a00a3e304ae5185097be1c5a949587ed3a131814f',
    'data ป')
import pdb

pdb.set_trace()
# client.application.call_api("fail")
# import pdb; pdb.set_trace()

print("END")
print("END")
print("END")
 def setUp(self):
     self.client = AcrosureClient(TEST_PUBLIC_KEY, API_URL)
     self.application = self.client.application
Ejemplo n.º 7
0
 def setUp(self):
     self.client = AcrosureClient(TEST_PUBLIC_KEY, API_URL)
     self.product = self.client.product
Ejemplo n.º 8
0
import tornado.ioloop
import tornado.web
from acrosure_sdk import AcrosureClient
import os
import json

from data import APP_DATA

acrosure_client = AcrosureClient(token=os.environ.get('TEST_SECRET_TOKEN'),
                                 api_url=os.environ.get('TEST_API_URL'))


class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("<a href=\"/test-sdk\"><button>Test</button></a>")


class SdkHandler(tornado.web.RequestHandler):
    def get(self):
        print("start")
        print("-------------------------------")
        resp = acrosure_client.application.create(
            product_id=APP_DATA["product_id"],
            basic_data=APP_DATA["basic_data"])
        print("create:")
        print(resp)
        print("-------------------------------")
        application_id = resp["data"]["id"]

        resp = acrosure_client.application.get_packages(application_id)
        print("get-packages:")