PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / gateways / assets / src / js / editor / paypal / main.js
jetformbuilder / modules / gateways / assets / src / js / editor / paypal Last commit date
main.js 2 years ago pay-now-scenario.js 2 years ago
main.js
105 lines
1 const { compose } = wp.compose;
2
3 const {
4 withSelect,
5 withDispatch,
6 } = wp.data;
7 const {
8 __,
9 } = wp.i18n;
10
11 const {
12 TextControl,
13 SelectControl,
14 withNotices,
15 } = wp.components;
16
17 const {
18 useEffect,
19 } = wp.element;
20
21 const {
22 renderGateway,
23 } = JetFBActions;
24
25 const {
26 withSelectGateways,
27 withDispatchGateways,
28 } = JetFBHooks;
29
30 const {
31 ToggleControl,
32 } = JetFBComponents;
33
34 function PaypalMain( {
35 setGatewayRequest,
36 gatewaySpecific,
37 setGatewaySpecific,
38 gatewayScenario,
39 setGatewayScenario,
40 getSpecificOrGlobal,
41 additionalSourceGateway,
42 specificGatewayLabel,
43 noticeOperations,
44 noticeUI,
45 } ) {
46
47 const {
48 id: scenario = 'PAY_NOW',
49 } = gatewayScenario;
50
51 useEffect( () => {
52 setGatewayRequest( { id: scenario } );
53 }, [ scenario ] );
54
55 useEffect( () => {
56 setGatewayRequest( { id: scenario } );
57 }, [] );
58
59 return <>
60 { noticeUI }
61 <ToggleControl
62 checked={ gatewaySpecific.use_global }
63 onChange={ use_global => setGatewaySpecific( { use_global } ) }
64 >
65 { __( 'Use', 'jet-form-builder' ) + ' ' }
66 <a href={ JetFormEditorData.global_settings_url +
67 '#payments-gateways__paypal' }>
68 { __( 'Global Settings', 'jet-form-builder' ) }
69 </a>
70 </ToggleControl>
71 <TextControl
72 label={ specificGatewayLabel( 'client_id' ) }
73 key="paypal_client_id_setting"
74 value={ getSpecificOrGlobal( 'client_id' ) }
75 onChange={ client_id => setGatewaySpecific( { client_id } ) }
76 disabled={ gatewaySpecific.use_global }
77 />
78 <TextControl
79 label={ specificGatewayLabel( 'secret' ) }
80 key="paypal_secret_setting"
81 value={ getSpecificOrGlobal( 'secret' ) }
82 onChange={ secret => setGatewaySpecific( { secret } ) }
83 disabled={ gatewaySpecific.use_global }
84 />
85 <SelectControl
86 labelPosition="side"
87 label={ specificGatewayLabel( 'gateway_type' ) }
88 value={ scenario }
89 onChange={ id => {
90 setGatewayScenario( { id } );
91 } }
92 options={ additionalSourceGateway.scenarios }
93 />
94 { renderGateway( 'paypal', { noticeOperations }, scenario ) }
95 </>;
96 }
97
98 export default compose(
99 withSelect( withSelectGateways ),
100 withDispatch( withDispatchGateways ),
101 withNotices,
102 )( PaypalMain );
103
104
105