def createRefundObject()

in src/main/scala/com/gu/invoicing/refundErroneousPayment/Impl.scala [24:44]


  def createRefundObject(amount: BigDecimal, paymentId: String, comment: String): String = {
    Http(s"$zuoraApiHost/v1/object/refund")
      .header("Authorization", s"Bearer $accessToken")
      .header("Content-Type", "application/json")
      .postData(s"""
           |{
           |  "Amount": $amount,
           |  "Comment": "$comment",
           |  "PaymentId": "$paymentId",
           |  "Type": "Electronic"
           |}
           |""".stripMargin)
      .method("POST")
      .asString
      .body
      .pipe { body =>
        System.out.println(s"RefundResult Body was $body")
        read[RefundResult](body)
      }
      .Id
  }