ReferencedPayouts.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Responses;
  3. use GuzzleHttp\Utils;
  4. trait ReferencedPayouts
  5. {
  6. /**
  7. * @return array
  8. */
  9. private function mockCreateReferencedBatchPayoutResponse(): array
  10. {
  11. return Utils::jsonDecode('{
  12. "links": [
  13. {
  14. "href": "https://api-m.sandbox.paypal.com/v1/payments/referenced-payouts/CDZEC5MJ8R5HY",
  15. "rel": "self",
  16. "method": "GET"
  17. }
  18. ]
  19. }', true);
  20. }
  21. /**
  22. * @return array
  23. */
  24. private function mockShowReferencedBatchPayoutResponse(): array
  25. {
  26. return Utils::jsonDecode('{
  27. "referenced_payouts": [
  28. {
  29. "item_id": "dVeQhMc5Ck5WPw2gWYDLzh3qM2Dp1XbRlZb9fDouzLzDhx1eMYYTFe3syHEKKx4=",
  30. "processing_state": {
  31. "status": "SUCCESS"
  32. },
  33. "reference_id": "2KP03934U4415543C",
  34. "reference_type": "TRANSACTION_ID",
  35. "payout_amount": {
  36. "currency_code": "USD",
  37. "value": "1.0"
  38. },
  39. "payout_destination": "KJDHGANDJ4DPZ",
  40. "payout_transaction_id": "3KP03934U4415543D",
  41. "disbursement_transaction_id": "4KP03934U4415543E",
  42. "links": [
  43. {
  44. "href": "https://api-m.sandbox.paypal.com/v1/payments/referenced-payouts-items/dVeQhMc5Ck5WPw2gWYDLzh3qM2Dp1XbRlZb9fDouzLzDhx1eMYYTFe3syHEKKx4=",
  45. "rel": "self",
  46. "method": "GET"
  47. }
  48. ]
  49. },
  50. {
  51. "item_id": "spK0ggOfijUiOUtbXBepp3h5tolruRWTl4aED-_6yz25POeNFABpkewSIxIXh4A=",
  52. "processing_state": {
  53. "status": "SUCCESS"
  54. },
  55. "reference_id": "8TA4226978212399L",
  56. "reference_type": "TRANSACTION_ID",
  57. "payout_amount": {
  58. "currency_code": "USD",
  59. "value": "1.0"
  60. },
  61. "payout_destination": "KJDHGANDJ4DPZ",
  62. "payout_transaction_id": "4KP03934U4415543D",
  63. "disbursement_transaction_id": "5KP03934U4415543E",
  64. "links": [
  65. {
  66. "href": "https://api-m.sandbox.paypal.com/v1/payments/referenced-payouts-items/spK0ggOfijUiOUtbXBepp3h5tolruRWTl4aED-_6yz25POeNFABpkewSIxIXh4A=",
  67. "rel": "self",
  68. "method": "GET"
  69. }
  70. ]
  71. }
  72. ],
  73. "payout_directive": {
  74. "destination": "CC-CDZEC5MJ8R5HY",
  75. "type": "FINANCIAL_INSTRUMENT_ID"
  76. },
  77. "links": [
  78. {
  79. "href": "https://api-m.sandbox.paypal.com/v1/payments/referenced-payouts/KHbwO28lWlXwi2IlToJ2IYNG4juFv6kpbFx4J9oQ5Hb24RSp96Dk5FudVHd6v4E=",
  80. "rel": "self",
  81. "method": "GET"
  82. }
  83. ]
  84. }', true);
  85. }
  86. /**
  87. * @return array
  88. */
  89. private function mockCreateReferencedBatchPayoutItemResponse(): array
  90. {
  91. return Utils::jsonDecode('{
  92. "item_id": "SOMEITEMID",
  93. "links": [
  94. {
  95. "href": "https://api-m.sandbox.paypal.com/v1/payments/referenced-payouts-items/SOMEITEMID",
  96. "rel": "self",
  97. "method": "GET"
  98. }
  99. ]
  100. }', true);
  101. }
  102. /**
  103. * @return array
  104. */
  105. private function mockShowReferencedBatchPayoutItemResponse(): array
  106. {
  107. return Utils::jsonDecode('{
  108. "item_id": "SOMEITEMID",
  109. "processing_state": {
  110. "status": "PROCESSING"
  111. },
  112. "reference_id": "CAPTURETXNID",
  113. "reference_type": "TRANSACTION_ID",
  114. "payout_amount": {
  115. "currency_code": "USD",
  116. "value": "2.0"
  117. },
  118. "payout_destination": "PAYERED",
  119. "payout_transaction_id": "PAYOUTTXNID",
  120. "links": [
  121. {
  122. "href": "https://api-m.paypal.com/v1/payments/referenced-payouts-items/SOMEITEMID",
  123. "rel": "self",
  124. "method": "GET"
  125. }
  126. ]
  127. }', true);
  128. }
  129. }