iamport / iamport-ios

MIT License
23 stars 7 forks source link

`IamportResponseStruct` decode 에러 #41

Open funct7 opened 7 months ago

funct7 commented 7 months ago

응답

{
  "success": false,
  "imp_uid": "imp_594738060424",
  "merchant_uid": "180",
  "pay_method": "payco",
  "pg_provider": "payco",
  "pg_type": "payment",
  "error_msg": "사용자가 결제를 취소하셨습니다"
}

변환 결과

(iamport_ios.IamportResponseStruct) $R1 = {
  success = true
  imp_uid = "imp_594738060424"
  merchant_uid = "180"
  error_msg = "사용자가 결제를 취소하셨습니다"
  error_code = nil
}

https://github.com/iamport/iamport-ios/blob/e9374724a36d28ba6c3150bff16e33183cee37d9/Sources/iamport-ios/Classes/Data/IamportResponse.swift#L92-L95

해당 코드에서 String으로 변환 실패 후 error_msg를 안 봐서 true 처리 되고 있는 것 같네요.