Bulat Maskurov
11/28/2024, 11:36 AMContent-Type: application/x-www-form-urlencoded
. In request service A sends a certain param (I'll come back to it later on)
2. Stub is supposed to respond with a json, which contains operationId
(generated UUID).
3. Lastly, our stub should also send a callback, which should be application/x-www-form-urlencoded
and contain two specific params. A param from initial request (from step 1) and the same operationId
from response (from step 2)
I tried to write a mapping for this task, but callback just doesn't work
I'll attach json mapping in threadBulat Maskurov
11/28/2024, 11:37 AM{
"uuid": "236238ca-df12-41d6-8d88-882606e889ae",
"name": "POST /api/merchantapi/paymentOrderCardId.do",
"request": {
"url": "/api/merchantapi/paymentOrderCardId.do",
"method": "POST"
},
"response": {
"status": 200,
"jsonBody": {
"errorCode": 0,
"errorMessage": "",
"info": "test",
"operationId": "{{randomValue type='UUID'}}",
"redirect": "test"
},
"headers": {
"Content-Type": "application/json",
"Connection": "close"
}
},
"serveEventListeners": [
{
"name": "webhook",
"parameters": {
"method": "POST",
"url": "<http://i.deleted.the.host.for.privacy.sake/api/v1/redbox/callback>",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"body": "currency=860&error_code=0&is_3ds=false&operation_status=success&operation_type=deposit&amount=15000000&order_number=2ad86d13-6e6b-4ced-853d-6553f8127f80&order_id={{formData request.body 'form' urlDecode=true}}{{form.orderId}}&merchant_order_params=%7B%22account_to_card%22%3Anull%2C%22recurrent%22%3Anull%2C%22split_p2p%22%3Afalse%2C%22debit_only_p2p%22%3Afalse%2C%22bdp%22%3Anull%2C%22case%22%3Anull%2C%22phoneNumber%22%3Anull%2C%22epos_cash_advance%22%3Afalse%2C%22cpg%22%3Anull%2C%22ali_params%22%3Anull%2C%22ali%22%3Anull%2C%22p2p%22%3A%7B%22flow_type%22%3A%22p2p_debit%22%2C%22sender_name%22%3A%22UNKNOWN%22%2C%22sender_address%22%3A%22UNKNOWN%2C%20UNKNOWN%22%2C%22sender_city%22%3A%22UNKNOWN%22%2C%22sender_country_code%22%3A%22RUS%22%2C%22sender_postal_code%22%3A%22UNKNOWN%22%2C%22sender_account%22%3Anull%2C%22receiver_account%22%3Anull%2C%22receiver_name%22%3Anull%2C%22transfer_id%22%3Anull%2C%22rates%22%3A%5B%5D%7D%2C%22installment%22%3Anull%2C%22uzum%22%3Anull%2C%22avia%22%3Anull%7D&terminal_id=136&operation_id=8a2c2ae0-8049-496e-af9e-b790ccb34c4e&blank_amount=15000000&action_code=500&attributes=%5B%5D&fee_amount=50000&blank_amount=15000000"
}
}
]
}
Tom
11/28/2024, 11:50 AMBulat Maskurov
11/28/2024, 11:50 AMBulat Maskurov
11/28/2024, 11:51 AMBulat Maskurov
11/28/2024, 11:51 AMorder_id={{formData request.body 'form' urlDecode=true}}{{form.orderId}}
this partTom
11/28/2024, 11:51 AMBulat Maskurov
11/28/2024, 11:53 AMBulat Maskurov
11/28/2024, 12:29 PMLee Turner
11/28/2024, 1:25 PMLee Turner
11/28/2024, 1:27 PMrequest
you need to use originalRequest
rather than request
- https://wiremock.org/docs/webhooks-and-callbacks/#using-data-from-the-original-requestLee Turner
11/28/2024, 1:28 PMBulat Maskurov
11/28/2024, 1:28 PMBulat Maskurov
11/28/2024, 1:28 PMBulat Maskurov
11/28/2024, 1:29 PMTom
11/28/2024, 1:30 PMrequest
which is null in a webhook contextBulat Maskurov
11/29/2024, 10:25 AMx-www-form-urlencoded
Content-Type in request and using it in response?