def SaveOrder(data):
    embeddata = json.loads(data['embeddata'])
    Order.create(apptransid=data['apptransid'],
                 zptransid=data['zptransid'],
                 channel=data['channel'],
                 timestamp=data['servertime'],
                 amount=data['amount'],
                 description=embeddata['description'])
Exemplo n.º 2
0
 def post(self):
     args = self.reqparse.parse_args()
     filtered_args = {k: v for k, v in args.items() if v is not None}
     args.clear()
     args.update(filtered_args)
     # with DB.atomic():
     order = Order.create(**args)
     return {'isSuccess': True, 'product_id': order.order_id}
Exemplo n.º 3
0
def step_2(context):
    for row in context.table:
        try:
            context.customer_id = Customer.get(
                Customer.email == '*****@*****.**')
        except Customer.DoesNotExist:
            context.customer_id = Customer.create(email='*****@*****.**')
        context.order_id = Order.create(customer_id=context.customer_id,
                                        order_status=row['order_status'],
                                        district=row['district'])