iOS
14. Point Transaction History
You can use Goodie.listHistory() function to track your issuing point history and Redeemed point history.
Here is the example code:
1. orderBy : 2. 1 = ascending 3. 2 = descending 4. 5. orderType : 6. 1 = reward 7. 2 = product 8. 3 = point 9. 4 = expired date 10. 11. trxType : 12. 0 = Itβs mean all data will retrieve (Issuing and Redeemed) 13. 1 = It will retrieve only Issuing data history 14. 2 = It will retrieve only Redeemed data history 15. 16. nRecord = jumlah record dalam string 17. 18. GoodieCore.listHistory(authToken: "authToken", deviceUniqueId: "deviceUniqueId", memberId: "memberId", merchantId: "merchantId", trxType: "1", orderBy: "1", orderType: "1", nRecord: "10", page: "0", completion: { (ListPointTransactionResponse) in 19. if ListPointTransactionResponse.abstractResponse?.responseStatus == "TRX018" { 20. //success, do something 21. }else{ 22. //failed 23. } 24. }) { (Error) in 25. //error 26. }
Where :
Param | Type | Description |
---|---|---|
authToken | String | authToken is used as for header authentication purpose |
deviceUniqueId | String | deviceUniqueId is identify android device |
memberId | String | memberId is identifier that will be used to identity a member |
merchantId | String | merchantId is identifier that will be used to identity a merchant |
trxType | integer | It is used to filtering data by trxType trxType = 0, Itβs mean all data will retrieve (Issuing and Redeemed) trxType = 1, It will retrieve only Issuing data history trxType = 2, It will retrieve only Redeemed data history |
orderBy | integer | It used for filtering data by Date It must filled with β1β in integer |
orderType | integer | It used for filtering data by name in alphabet. Sample : 1 = Ascending, 2 = Descending |
nRecords | integer | It is used to limit data displayed in one page |
page | integer | It is used to pagination, starts from 0 |
Response Point Transaction History :
1. { 2. "listPointTransaction": [ 3. { 4. "trxType": 1, 5. "issuing": { 6. "date": "2019-06-21", 7. "promotionName": "Promo123", 8. "ruleType": "Basic Rule", 9. "ruleName": "BNI New Basic Rule", 10. "description": "Point from transaction: INV001TESTFIT", 11. "reff": "INV001TESTFIT", 12. "amount": 100000, 13. "point": 100 14. }, 15. "redeem": null 16. }, 17. { 18. "trxType": 1, 19. "issuing": { 20. "date": "2019-06-21", 21. "promotionName": "Promotion BNI", 22. "ruleType": "Basic Rule", 23. "ruleName": "Basic Rule BNI", 24. "description": "Point from transaction: INV001TESTFIT", 25. "reff": "INV001TESTFIT", 26. "amount": 100000, 27. "point": 1 28. }, 29. "redeem": null 30. }, 31. { 32. "trxType": 1, 33. "issuing": { 34. "date": "2019-06-21", 35. "promotionName": "Promotion BNI", 36. "ruleType": "Basic Rule", 37. "ruleName": "Basic Rule BNI", 38. "description": "Point from transaction: INV001TESTFIT", 39. "reff": "INV001TESTFIT", 40. "amount": 200000, 41. "point": 2 42. }, 43. "redeem": null 44. }, 45. { 46. "trxType": 1, 47. "issuing": { 48. "date": "2019-06-21", 49. "promotionName": "Promo123", 50. "ruleType": "Basic Rule", 51. "ruleName": "BNI New Basic Rule", 52. "description": "Point from transaction: INV001TESTFIT", 53. "reff": "INV001TESTFIT", 54. "amount": 200000, 55. "point": 100 56. }, 57. "redeem": null 58. }, 59. { 60. "trxType": 1, 61. "issuing": { 62. "date": "2019-06-21", 63. "promotionName": "Promo123", 64. "ruleType": "Basic Rule", 65. "ruleName": "BNI New Basic Rule", 66. "description": "Point from transaction: INV001TESTFIT", 67. "reff": "INV001TESTFIT", 68. "amount": 200000, 69. "point": 100 70. }, 71. "redeem": null 72. }, 73. { 74. "trxType": 1, 75. "issuing": { 76. "date": "2019-06-21", 77. "promotionName": "Promotion BNI", 78. "ruleType": "Basic Rule", 79. "ruleName": "Basic Rule BNI", 80. "description": "Point from transaction: INV001TESTFIT", 81. "reff": "INV001TESTFIT", 82. "amount": 200000, 83. "point": 2 84. }, 85. "redeem": null 86. }, 87. { 88. "trxType": 1, 89. "issuing": { 90. "date": "2019-06-24", 91. "promotionName": "Promotion BNI", 92. "ruleType": "Basic Rule", 93. "ruleName": "Basic Rule BNI", 94. "description": "Point from transaction: INV001TESTFIT", 95. "reff": "INV001TESTFIT", 96. "amount": 200000, 97. "point": 2 98. }, 99. "redeem": null 100. }, 101. { 102. "trxType": 1, 103. "issuing": { 104. "date": "2019-06-24", 105. "promotionName": "Promo123", 106. "ruleType": "Basic Rule", 107. "ruleName": "BNI New Basic Rule", 108. "description": "Point from transaction: INV001TESTFIT", 109. "reff": "INV001TESTFIT", 110. "amount": 200000, 111. "point": 100 112. }, 113. "redeem": null 114. } 115. ], 116. "recordInfo": { 117. "totalRecords": 8, 118. "page": 0, 119. "nrecords": 10 120. }, 121. "abstractResponse": { 122. "responseStatus": "TRX018", 123. "responseMessage": "Get history issuing and redeem success" 124. } 125. }