PaymentRefunds.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Responses;
  3. use GuzzleHttp\Utils;
  4. trait PaymentRefunds
  5. {
  6. /**
  7. * @return array
  8. */
  9. private function mockGetRefundDetailsResponse(): array
  10. {
  11. return Utils::jsonDecode('{
  12. "id": "1JU08902781691411",
  13. "amount": {
  14. "value": "10.99",
  15. "currency_code": "USD"
  16. },
  17. "status": "COMPLETED",
  18. "note_to_payer": "Defective product",
  19. "seller_payable_breakdown": {
  20. "gross_amount": {
  21. "value": "10.99",
  22. "currency_code": "USD"
  23. },
  24. "paypal_fee": {
  25. "value": "0",
  26. "currency_code": "USD"
  27. },
  28. "net_amount": {
  29. "value": "10.99",
  30. "currency_code": "USD"
  31. },
  32. "total_refunded_amount": {
  33. "value": "10.99",
  34. "currency_code": "USD"
  35. }
  36. },
  37. "invoice_id": "INVOICE-123",
  38. "create_time": "2018-09-11T23:24:19Z",
  39. "update_time": "2018-09-11T23:24:19Z",
  40. "links": [
  41. {
  42. "rel": "self",
  43. "method": "GET",
  44. "href": "https://api.paypal.com/v2/payments/refunds/1JU08902781691411"
  45. },
  46. {
  47. "rel": "up",
  48. "method": "GET",
  49. "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P"
  50. }
  51. ]
  52. }', true);
  53. }
  54. }