veritrans / veritrans.github.io

Veritrans documentation
http://veritrans.github.io
7 stars 15 forks source link

mandiri bank transfer JSON payload sample incomplete #140

Open Dimi7 opened 4 years ago

Dimi7 commented 4 years ago

the current documentation sample for calling Charge API Request, in the Mandiri tab:

# sample charge in CURL
curl -X POST \
  https://api.sandbox.midtrans.com/v2/charge \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic <YOUR SERVER KEY ENCODED in Base64>' \
  -H 'Content-Type: application/json' \
  -d '{
  "payment_type": "echannel",
  "transaction_details": {
      "order_id": "order-101",
      "gross_amount": 44000
  }
}

returns the following response:

{
    "status_code": "400",
    "status_message": "One or more parameters in the payload is invalid.",
    "id": "29267ff3-bc08-47b6-bcb8-00a9d9a9ddc3",
    "validation_messages": [
        "echannel is required"
    ]
}

perhaps the post body requires "echannel" parameter ?

Dimi7 commented 4 years ago

found the actual working sample in the API reference

{
    "payment_type": "echannel",
    "transaction_details": {
        "order_id": "1388",
        "gross_amount": 95000
        },
    "item_details": [
        {
          "id": "a1",
          "price": 50000,
          "quantity": 2,
          "name": "Apel"
        },
        {
         "id": "a2",
          "price": 45000,
          "quantity": 1,
          "name": "Jeruk"
        }
    ],
    "echannel" : {
        "bill_info1" : "Payment For:",
        "bill_info2" : "debt"
    }
}
rizdaprasetya commented 4 years ago

Hi @Dimi7 thanks for reporting, looks like the sample JSON param is incomplete/invalid. We'll fix it soon.

muhammadisa commented 3 years ago

found the actual working sample in the API reference

{
    "payment_type": "echannel",
    "transaction_details": {
        "order_id": "1388",
        "gross_amount": 95000
        },
    "item_details": [
        {
          "id": "a1",
          "price": 50000,
          "quantity": 2,
          "name": "Apel"
        },
        {
         "id": "a2",
          "price": 45000,
          "quantity": 1,
          "name": "Jeruk"
        }
    ],
    "echannel" : {
        "bill_info1" : "Payment For:",
        "bill_info2" : "debt"
    }
}

You safe my life