main.js
36 lines
| 1 | import PaypalMain from './paypal/main'; |
| 2 | import PayNowScenario from './paypal/pay-now-scenario'; |
| 3 | import gatewayPlugin from './plugin'; |
| 4 | |
| 5 | const { |
| 6 | registerGateway, |
| 7 | } = JetFBActions; |
| 8 | |
| 9 | const { |
| 10 | addFilter, |
| 11 | } = wp.hooks; |
| 12 | |
| 13 | const { __ } = wp.i18n; |
| 14 | |
| 15 | const gatewayID = 'paypal'; |
| 16 | |
| 17 | registerGateway( |
| 18 | gatewayID, |
| 19 | PaypalMain, |
| 20 | ); |
| 21 | |
| 22 | registerGateway( |
| 23 | gatewayID, |
| 24 | PayNowScenario, |
| 25 | 'PAY_NOW', |
| 26 | ); |
| 27 | |
| 28 | addFilter( |
| 29 | 'jet.fb.register.plugin.jf-validation-panel.after', |
| 30 | 'jet-form-builder/gateways', |
| 31 | function ( plugins ) { |
| 32 | plugins.push( gatewayPlugin ); |
| 33 | |
| 34 | return plugins; |
| 35 | }, |
| 36 | ); |