bagistoapi.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | BagistoApi Configuration
  5. |--------------------------------------------------------------------------
  6. |
  7. | Switches for the BagistoApi payment / express-checkout flow.
  8. |
  9. */
  10. return [
  11. /*
  12. |--------------------------------------------------------------------------
  13. | Express Checkout
  14. |--------------------------------------------------------------------------
  15. |
  16. | express_checkout.enabled
  17. | Master switch for the quick (no email/address) payment path.
  18. |
  19. | express_checkout.cancel_without_address
  20. | Strategy for "registered customer cancels express payment AND order
  21. | has no shipping address" scenario:
  22. | - "cancel" (default) cancel the order immediately.
  23. | - "keep_pending" leave order pending; caller can call paymentReplay
  24. | later or operations team can intervene via the
  25. | `bagistoapi.express.cancel.no-address` event.
  26. |
  27. | express_checkout.placeholder_address
  28. | Placeholder address used for the pre-payment order when no real
  29. | shipping address is known yet. Re-written from the gateway response
  30. | on a successful capture callback.
  31. */
  32. 'express_checkout' => [
  33. 'enabled' => env('BAGISTOAPI_EXPRESS_CHECKOUT_ENABLED', true),
  34. 'cancel_without_address' => env('BAGISTOAPI_EXPRESS_CANCEL_WITHOUT_ADDRESS', 'cancel'),
  35. 'placeholder_address' => [
  36. 'first_name' => 'Express',
  37. 'last_name' => 'Checkout',
  38. 'email' => 'express-checkout@placeholder.local',
  39. 'address' => 'Pending gateway response',
  40. 'city' => 'Pending',
  41. 'state' => 'Pending',
  42. 'country' => 'US',
  43. 'postcode' => '00000',
  44. 'phone' => '0000000000',
  45. ],
  46. ],
  47. /*
  48. |--------------------------------------------------------------------------
  49. | Frontend URLs
  50. |--------------------------------------------------------------------------
  51. |
  52. | frontend.reset_password_url
  53. | Generic base URL of the reset-password page on the headless frontend,
  54. | e.g. https://shop.example.com/reset-password. Used when no device
  55. | specific URL below is configured.
  56. |
  57. | frontend.reset_password_url_pc / frontend.reset_password_url_mobile
  58. | Device specific base URLs. PC requests use reset_password_url_pc,
  59. | mobile requests use reset_password_url_mobile (detected from the
  60. | X-Device-Type header or the User-Agent).
  61. |
  62. | The token and email are appended as query parameters
  63. | (?token=...&email=...). When every option is empty, emails fall back to
  64. | the built-in Shop storefront page.
  65. */
  66. 'frontend' => [
  67. 'reset_password_url' => env('FRONTEND_RESET_PASSWORD_URL', ''),
  68. 'reset_password_url_pc' => env('FRONTEND_RESET_PASSWORD_URL_PC', ''),
  69. 'reset_password_url_mobile' => env('FRONTEND_RESET_PASSWORD_URL_MOBILE', ''),
  70. ],
  71. /*
  72. |--------------------------------------------------------------------------
  73. | Payment Reconciliation Job
  74. |--------------------------------------------------------------------------
  75. |
  76. | reconcile.enabled
  77. | Toggle the reconciliation job that polls the gateway while the order
  78. | is still PENDING.
  79. |
  80. | The job re-schedules itself. All values below are in SECONDS and are
  81. | measured from the anchor time (order creation, or the most recent
  82. | `redirected` payment attempt when the buyer used paymentReplay):
  83. |
  84. | reconcile.early_marks
  85. | Fixed early probes, e.g. [30, 60, 300] = 30s, 1min, 5min.
  86. |
  87. | reconcile.interval
  88. | Polling interval once the early probes are done (default 3 min).
  89. |
  90. | reconcile.late_after / reconcile.late_interval
  91. | After `late_after` seconds the interval widens to `late_interval`
  92. | (default: after 30 min, poll every 5 min).
  93. |
  94. | reconcile.max_seconds
  95. | Hard stop. A PayPal order expires after roughly 3 hours, so polling
  96. | past that point cannot tell us anything new.
  97. |
  98. | reconcile.queue
  99. | Name of the queue the reconciliation job is dispatched onto. This must
  100. | be consumed by a worker, and the Redis instance backing it must not
  101. | evict keys (see the package README).
  102. */
  103. 'reconcile' => [
  104. 'enabled' => env('BAGISTOAPI_PAYMENT_RECONCILE_ENABLED', true),
  105. 'early_marks' => [30, 60, 300],
  106. 'interval' => (int) env('BAGISTOAPI_PAYMENT_RECONCILE_INTERVAL', 180),
  107. 'late_after' => (int) env('BAGISTOAPI_PAYMENT_RECONCILE_LATE_AFTER', 1800),
  108. 'late_interval' => (int) env('BAGISTOAPI_PAYMENT_RECONCILE_LATE_INTERVAL', 300),
  109. 'max_seconds' => (int) env('BAGISTOAPI_PAYMENT_RECONCILE_MAX_SECONDS', 10800),
  110. 'queue' => env('BAGISTOAPI_PAYMENT_RECONCILE_QUEUE', 'payment-reconcile'),
  111. ],
  112. ];