mollie-mock-data.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import { E2E_DEFAULT_CHANNEL_TOKEN } from '@vendure/testing';
  2. export const mollieMockData = {
  3. host: 'https://my-vendure.io',
  4. redirectUrl: 'https://fallback-redirect/order',
  5. apiKey: 'myApiKey',
  6. methodCode: `mollie-payment-${E2E_DEFAULT_CHANNEL_TOKEN}`,
  7. methodCodeBroken: `mollie-payment-broken-${E2E_DEFAULT_CHANNEL_TOKEN}`,
  8. molliePaymentResponse: {
  9. resource: 'payment',
  10. id: 'tr_mockPayment',
  11. mode: 'test',
  12. amount: {
  13. value: '10.00',
  14. currency: 'EUR',
  15. },
  16. description: 'Order #mockOrder',
  17. sequenceType: 'oneoff',
  18. redirectUrl: 'https://webshop.example.org/order/mockOrder/',
  19. webhookUrl: 'https://webshop.example.org/payments/webhook/',
  20. metadata: { languageCode: 'nl' },
  21. profileId: 'pfl_mockProfile',
  22. status: 'paid',
  23. isCancelable: false,
  24. createdAt: '2024-03-20T09:13:37.0Z',
  25. expiresAt: '2024-03-20T09:28:37.0Z',
  26. paidAt: '2024-03-20T09:28:37.0Z',
  27. authorizedAt: '2024-03-20T09:28:37.0Z',
  28. _links: {
  29. self: {
  30. href: 'https://api.mollie.com/v2/payments/tr_mockPayment',
  31. type: 'application/hal+json',
  32. },
  33. checkout: {
  34. href: 'https://www.mollie.com/checkout/select-method/mock-payment',
  35. type: 'text/html',
  36. },
  37. },
  38. },
  39. molliePaymentMethodsResponse: {
  40. count: 1,
  41. _embedded: {
  42. methods: [
  43. {
  44. resource: 'method',
  45. id: 'ideal',
  46. description: 'iDEAL',
  47. minimumAmount: {
  48. value: '0.01',
  49. currency: 'EUR',
  50. },
  51. maximumAmount: {
  52. value: '50000.00',
  53. currency: 'EUR',
  54. },
  55. image: {
  56. size1x: 'https://www.mollie.com/external/icons/payment-methods/ideal.png',
  57. size2x: 'https://www.mollie.com/external/icons/payment-methods/ideal%402x.png',
  58. svg: 'https://www.mollie.com/external/icons/payment-methods/ideal.svg',
  59. },
  60. _links: {
  61. self: {
  62. href: 'https://api.mollie.com/v2/methods/ideal',
  63. type: 'application/hal+json',
  64. },
  65. },
  66. },
  67. ],
  68. },
  69. _links: {
  70. self: {
  71. href: 'https://api.mollie.com/v2/methods',
  72. type: 'application/hal+json',
  73. },
  74. documentation: {
  75. href: 'https://docs.mollie.com/reference/v2/methods-api/list-methods',
  76. type: 'text/html',
  77. },
  78. },
  79. },
  80. };