Disputes.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Responses;
  3. use GuzzleHttp\Utils;
  4. trait Disputes
  5. {
  6. /**
  7. * @return array
  8. */
  9. private function mockListDisputesResponse(): array
  10. {
  11. return Utils::jsonDecode('{
  12. "items": [
  13. {
  14. "dispute_id": "PP-000-003-648-191",
  15. "create_time": "2017-01-24T10:41:35.000Z",
  16. "update_time": "2017-01-24T11:40:32.000Z",
  17. "status": "WAITING_FOR_SELLER_RESPONSE",
  18. "reason": "MERCHANDISE_OR_SERVICE_NOT_RECEIVED",
  19. "dispute_state": "REQUIRED_OTHER_PARTY_ACTION",
  20. "dispute_amount": {
  21. "currency_code": "USD",
  22. "value": "50.00"
  23. },
  24. "links": [
  25. {
  26. "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-000-003-648-191",
  27. "rel": "self",
  28. "method": "GET"
  29. }
  30. ]
  31. },
  32. {
  33. "dispute_id": "PP-000-003-648-175",
  34. "create_time": "2017-01-24T10:37:23.000Z",
  35. "update_time": "2017-01-24T11:32:32.000Z",
  36. "status": "UNDER_REVIEW",
  37. "reason": "UNAUTHORISED",
  38. "dispute_amount": {
  39. "currency_code": "USD",
  40. "value": "20.00"
  41. },
  42. "links": [
  43. {
  44. "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-000-003-648-175",
  45. "rel": "self",
  46. "method": "GET"
  47. }
  48. ]
  49. }
  50. ],
  51. "links": [
  52. {
  53. "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes",
  54. "rel": "self",
  55. "method": "GET"
  56. },
  57. {
  58. "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes",
  59. "rel": "first",
  60. "method": "GET"
  61. }
  62. ]
  63. }', true);
  64. }
  65. /**
  66. * @return array
  67. */
  68. private function mockGetDisputesResponse(): array
  69. {
  70. return Utils::jsonDecode('{
  71. "dispute_id": "PP-D-4012",
  72. "create_time": "2019-04-11T04:18:00.000Z",
  73. "update_time": "2019-04-21T04:19:08.000Z",
  74. "disputed_transactions": [
  75. {
  76. "seller_transaction_id": "3BC38643YC807283D",
  77. "create_time": "2019-04-11T04:16:58.000Z",
  78. "transaction_status": "REVERSED",
  79. "gross_amount": {
  80. "currency_code": "USD",
  81. "value": "192.00"
  82. },
  83. "buyer": {
  84. "name": "Lupe Justin"
  85. },
  86. "seller": {
  87. "email": "merchant@example.com",
  88. "merchant_id": "5U29WL78XSAEL",
  89. "name": "Lesley Paul"
  90. }
  91. }
  92. ],
  93. "reason": "MERCHANDISE_OR_SERVICE_NOT_AS_DESCRIBED",
  94. "status": "RESOLVED",
  95. "dispute_amount": {
  96. "currency_code": "USD",
  97. "value": "96.00"
  98. },
  99. "dispute_outcome": {
  100. "outcome_code": "RESOLVED_BUYER_FAVOUR",
  101. "amount_refunded": {
  102. "currency_code": "USD",
  103. "value": "96.00"
  104. }
  105. },
  106. "dispute_life_cycle_stage": "CHARGEBACK",
  107. "dispute_channel": "INTERNAL",
  108. "messages": [
  109. {
  110. "posted_by": "BUYER",
  111. "time_posted": "2019-04-11T04:18:04.000Z",
  112. "content": "SNAD case created through automation"
  113. }
  114. ],
  115. "extensions": {
  116. "merchandize_dispute_properties": {
  117. "issue_type": "SERVICE",
  118. "service_details": {
  119. "sub_reasons": [
  120. "INCOMPLETE"
  121. ],
  122. "purchase_url": "https://ebay.in"
  123. }
  124. }
  125. },
  126. "offer": {
  127. "buyer_requested_amount": {
  128. "currency_code": "USD",
  129. "value": "96.00"
  130. }
  131. },
  132. "links": [
  133. {
  134. "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-D-4012",
  135. "rel": "self",
  136. "method": "GET"
  137. }
  138. ]
  139. }', true);
  140. }
  141. }