bagistoapi.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 delayed reconciliation job that polls the gateway after
  78. | `delay_minutes` if the order is still PENDING.
  79. |
  80. | reconcile.delay_minutes
  81. | How long to wait before a pending order is reconciled against the
  82. | gateway.
  83. |
  84. | reconcile.queue
  85. | Name of the queue the reconciliation job is dispatched onto. Operators
  86. | can route this to a dead-letter capable broker (e.g. RabbitMQ) via the
  87. | Laravel queue config without touching code.
  88. */
  89. 'reconcile' => [
  90. 'enabled' => env('BAGISTOAPI_PAYMENT_RECONCILE_ENABLED', true),
  91. 'delay_minutes' => (int) env('BAGISTOAPI_PAYMENT_RECONCILE_DELAY', 15),
  92. 'queue' => env('BAGISTOAPI_PAYMENT_RECONCILE_QUEUE', 'payment-reconcile'),
  93. ],
  94. ];