Passed
Push — main ( 2798bc...c9aa15 )
by Acho
04:27 queued 02:13
created

stubs.RefundResponse   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package stubs
2
3
// RefundInvalidClientResponse is the response when refunding with an invalid client
4
func RefundInvalidClientResponse() []byte {
5
	return []byte(`{"error":"invalid_client"}`)
6
}
7
8
// RefundResponse is the response when refunding a transaction
9
func RefundResponse() []byte {
10
	return []byte(`
11
{
12
    "MD5OfMessageBody": "4b55cf6629b5f0ee3c8ac91435a2eb35",
13
    "MD5OfMessageAttributes": "896f665ac83c778c88943113ee0ccd55",
14
    "MessageId": "993764f9-6b1f-41bd-a7ca-97b8b2167ed7",
15
    "ResponseMetadata": {
16
        "RequestId": "e7b09b6d-0d11-5111-8dc9-c4ab56e3cf7c",
17
        "HTTPStatusCode": 200,
18
        "HTTPHeaders": {
19
            "x-amzn-requestid": "e7b09b6d-0d11-5111-8dc9-c4ab56e3cf7c",
20
            "date": "Sun, 01 Dec 2024 12:42:26 GMT",
21
            "content-type": "application/x-amz-json-1.0",
22
            "content-length": "166",
23
            "connection": "keep-alive"
24
        },
25
        "RetryAttempts": 0
26
    }
27
}
28
`)
29
}
30
31
// RefundStatusResponse is the response when checking the status of a refund transaction
32
func RefundStatusResponse() []byte {
33
	return []byte(`
34
{
35
    "result": {
36
        "message": "Cash in performed successfully",
37
        "data": {
38
            "createtime": "1733056973",
39
            "subscriberMsisdn": "695xxxxxx",
40
            "amount": 98,
41
            "payToken": "CI24120168FBF65A909F588B4480",
42
            "txnid": "CI241201.1342.C36820",
43
            "txnmode": "rembourse",
44
            "txnstatus": "200",
45
            "orderId": "rembourse",
46
            "status": "SUCCESSFULL",
47
            "channelUserMsisdn": "695xxxxxx",
48
            "description": "Remboursement"
49
        }
50
    },
51
    "parameters": {
52
        "amount": "98",
53
        "xauth": "WU5PVEVIRUFEOllOT1RFSEVBRDIwMjA=",
54
        "channel_user_msisdn": "69xxxxxx",
55
        "customer_key": "2fBAAq_xxxxxxx",
56
        "customer_secret": "34nFkKxxxxxx",
57
        "final_customer_name": "Arnold",
58
        "final_customer_phone": "69xxxxxx",
59
        "final_customer_name_accuracy": "0"
60
    },
61
    "CreateAt": "12-01-2024 12:43:00",
62
    "MessageId": "993764f9-6b1f-41bd-a7ca-97b8b2167ed7",
63
    "RefundStep": "2"
64
}
65
`)
66
}
67