Skip to content

Commit ca69fa9

Browse files
authored
Merge pull request #890 from PayButton/ui-new-advanced-button-generator-options
[UI] Add advanced button generator options
2 parents de615da + c831c25 commit ca69fa9

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

components/ButtonGenerator/data.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,23 @@ export const generatorFormFields = [
161161
helpText: 'Allow changing the payment amount',
162162
advanced: true
163163
},
164+
{
165+
name: 'OP-Return',
166+
placeholder: 'myCustomMessage',
167+
key: 'opReturn',
168+
className: 'col_lg',
169+
type: 'input',
170+
onChange: 'handleChange',
171+
helpText: 'Custom message that will be sent with the transaction',
172+
advanced: true
173+
},
174+
{
175+
name: 'Disable Payment ID',
176+
key: 'disablePaymentId',
177+
className: 'col_sm_center',
178+
type: 'boolean',
179+
default: false,
180+
helpText: 'Removes the random ID generated for the payment that is used to prevent the onSuccess callback to be triggered by a person who has the payment screen open at the same time as another',
181+
advanced: true
182+
},
164183
]

components/ButtonGenerator/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ interface ButtonState {
3535
disabled: boolean
3636
editable: boolean
3737
widget: boolean
38+
disablePaymentId: boolean
39+
opReturn: string
3840
[key: string]: any
3941
}
4042

@@ -70,7 +72,9 @@ export const initialButtonState: ButtonState = {
7072
disableEnforceFocus: true,
7173
disabled: false,
7274
editable: false,
73-
widget: false
75+
widget: false,
76+
disablePaymentId: false,
77+
opReturn: ''
7478
}
7579

7680
export default function ButtonGenerator (): JSX.Element {

components/Paybutton/paybutton.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@
144144
padding: 25px;
145145
border-radius: 10px;
146146
border: 1px solid var(--secondary-text-color);
147+
overflow-y: auto;
148+
max-height: 90vh;
147149
}
148150

149151
.form_ctn p {

0 commit comments

Comments
 (0)