Commit 48dcd97e8478564ff6f1db8889c3aa09d9ba3a08
1 parent
4f830c4851
Exists in
master
fix get response
Showing 1 changed file with 8 additions and 4 deletions Side-by-side Diff
lib/actions/buy.js
... | ... | @@ -42,7 +42,7 @@ module.exports = async (xid, transaction) => { |
42 | 42 | const callbackUrl = `${iConfig.url}:${iConfig.port}/apikey/${iConfig.apikey}/updates`; |
43 | 43 | const result = await buyToSDS( |
44 | 44 | xid, |
45 | - transaction.id, | |
45 | + `${transaction.request_id}-${transaction.id}`, | |
46 | 46 | transaction.destination, |
47 | 47 | productName, |
48 | 48 | transaction.quantity, |
... | ... | @@ -53,11 +53,15 @@ module.exports = async (xid, transaction) => { |
53 | 53 | trxId: transaction.id, |
54 | 54 | result, |
55 | 55 | }); |
56 | + let rc = 40; | |
57 | + if (result.code === '200') { | |
58 | + rc = 68; | |
59 | + } | |
56 | 60 | const params = { |
57 | - id: result.request_id, | |
58 | - rc: result.rc, | |
61 | + id: transaction.id, | |
62 | + rc, | |
59 | 63 | amount: result.amount || null, |
60 | - message: result.message, | |
64 | + message: result.text, | |
61 | 65 | sn: result.sn || null, |
62 | 66 | }; |
63 | 67 |