Giter Club home page Giter Club logo

temp-filament-square-field's Introduction

Filament Custom Field Debugging - Temporary Repo

This temporary repo is for debugging an issue with a Filament custom field.

Setup

  1. git clone
  2. configure database connection (SQLite is fine)
  3. artisan migrate
  4. artisan db:seed
  5. artisan make:filament-user
  6. Set .env values

Env values

These .env values are required:

  • SQUARE_APP_ID
  • SQUARE_ACCESS_TOKEN
  • SQUARE_LOCATION_ID

Workflow

  1. Visit https://site.test/admin/subscriptions
  2. Click "Renew" action next to a subscription record
  3. Set the renewal price or use what's pre-filled
  4. Select "Credit Card" as payment method
  5. Observe Square payment form appearing
  6. Use 4111 1111 1111 1111, any expiration date, CVV 111, any postal code
  7. Click "Charge Credit Card" button, observe "Payment successful" message appear below button
  8. Observe the value of the fake payment ID returned from the Square javascript displayed for debugging as the current field state
  9. Finally, click "Renew" to attempt to submit the renewal form

Problems

  1. Highest priority: value of custom field state is not included in the $data array that arrives in getAction() in RenewSubscriptionAction when "Renew" is clicked.
[2023-02-05 15:32:17] local.DEBUG: Array
(
    [subscriptionId] => 1
    [renewalPrice] => 9
    [paymentMethod] => card
    [squarePayment] =>
)
  1. Square form components flicker/disappear when other parts of the dom are refreshed or when there's a payment error and the card info has to be filled out twice. Have tried using wire:ignore but this can affect the live updating of the charge dollar amount in what is submitted to Square, which I'd like to preserve as the UI if possible.
  2. renewalPrice field does not become disabled as expected when payment method is switched to Credit Card. This is one way I was attempting to deal with DOM refresh issues by being able to set wire:ignore on the "square-payment-wrapper" div and force the user to select a price before selecting the CC payment method, but it is not the ideal UX.

temp-filament-square-field's People

Contributors

chrishardie avatar danharrin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.