BxPaymentProviderStripeConnect.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Payment Payment
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxPaymentProviderStripeConnect extends BxBaseModPaymentProvider implements iBxBaseModPaymentProvider
  12. {
  13. protected $_sModuleSc;
  14. public function __construct($aConfig)
  15. {
  16. $this->MODULE = 'bx_payment';
  17. parent::__construct($aConfig);
  18. $this->_sModuleSc = 'bx_stripe_connect';
  19. }
  20. public function getMode($iVendorId, $aParams = [])
  21. {
  22. if(($sMethod = 'get_option_value_mode') && bx_is_srv($this->_sModuleSc, $sMethod))
  23. return bx_srv($this->_sModuleSc, $sMethod, [$iVendorId, $aParams]);
  24. else
  25. return _t('_undefined');
  26. }
  27. public function getConnect($iVendorId, $aParams = [])
  28. {
  29. if(($sMethod = 'get_connect_code') && bx_is_srv($this->_sModuleSc, $sMethod))
  30. return bx_srv($this->_sModuleSc, $sMethod, [$iVendorId, $aParams]);
  31. else
  32. return _t('_undefined');
  33. }
  34. public function getLiveAccountId($iVendorId, $aParams = [])
  35. {
  36. if(($sMethod = 'get_option_value_live_account_id') && bx_is_srv($this->_sModuleSc, $sMethod) && ($sAccountId = bx_srv($this->_sModuleSc, $sMethod, [$iVendorId, $aParams])))
  37. return $sAccountId;
  38. else
  39. return _t('_undefined');
  40. }
  41. public function getTestAccountId($iVendorId, $aParams = [])
  42. {
  43. if(($sMethod = 'get_option_value_test_account_id') && bx_is_srv($this->_sModuleSc, $sMethod) && ($sAccountId = bx_srv($this->_sModuleSc, $sMethod, [$iVendorId, $aParams])))
  44. return $sAccountId;
  45. else
  46. return _t('_undefined');
  47. }
  48. public function initializeCheckout($iPendingId, $aCartInfo, $sRedirect = '')
  49. {
  50. return $this->_sLangsPrefix . 'err_not_supported';
  51. }
  52. public function finalizeCheckout(&$aData)
  53. {
  54. return ['code' => 1, 'message' => $this->_sLangsPrefix . 'err_not_supported'];
  55. }
  56. }
  57. /** @} */