Custom fields - PHP class to process data?

I have created a custom field to display a payment button from Braintree using their drop-in UI inside an AlpineJS component. To use threeDSecure I have to create a payment token on the server and pass that to the component. Where do I put this code? Do I create a class extending the DynamicComponent and are there any requirements for it? Can’t see anything in the docs. My field:
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div>
<div id="dropin-container"></div>
<button id="braintree-submit-button" type="button">Submit</button>

<div
x-ignore
ax-load
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('test-component') }}"
x-data="testComponent({
state: {
amount: '79.00',
token: //// braintree token from server
}
})"
>
</div>
</div>
</x-dynamic-component>
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div>
<div id="dropin-container"></div>
<button id="braintree-submit-button" type="button">Submit</button>

<div
x-ignore
ax-load
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('test-component') }}"
x-data="testComponent({
state: {
amount: '79.00',
token: //// braintree token from server
}
})"
>
</div>
</div>
</x-dynamic-component>
Thanks
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server