Skip to content

Commit

Permalink
Merge fa58f50 into 52eb03d
Browse files Browse the repository at this point in the history
  • Loading branch information
kenji-yamazaki-paypay committed Mar 30, 2022
2 parents 52eb03d + fa58f50 commit eb3152f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions paypayopa/resources/code.py
Expand Up @@ -27,19 +27,20 @@ def create_qr_code(self, data=None, **kwargs):
if "currency" not in data["amount"]:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for currency")
for item in data["orderItems"]:
if "name" not in item:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem Name")
if "quantity" not in item:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem quantity")
if "amount" not in item["unitPrice"]:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem.amount.unitPrice")
if "currency" not in item["unitPrice"]:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem.amount.currency")
if "orderItems" in data:
for item in data["orderItems"]:
if "name" not in item:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem Name")
if "quantity" not in item:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem quantity")
if "amount" not in item["unitPrice"]:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem.amount.unitPrice")
if "currency" not in item["unitPrice"]:
raise ValueError("\x1b[31m MISSING REQUEST PARAMS"
" \x1b[0m for orderItem.amount.currency")
return self.post_url(url, data, api_id=API_NAMES.CREATE_QRCODE, **kwargs)

def get_payment_details(self, id, **kwargs):
Expand Down

0 comments on commit eb3152f

Please sign in to comment.