react-square-web-payments-sdk icon indicating copy to clipboard operation
react-square-web-payments-sdk copied to clipboard

Split Button out from CreditCard component

Open llampwall opened this issue 3 years ago • 5 comments

Describe the bug

Currently the CreditCard field includes the submit payment button in it. There is no way to separate them. This makes using the library impossible for someone like me who has the button on a different part of the screen, in a different component. When using the regular Square JavaScript SDK, you can put them wherever you want in relation to each other. It's as simple as moving the divs.

<div id="card-container"></div> <button id="card-button" type="button">Pay $1.00</button>

This library should be updated to split those components and allow them to each be placed anywhere within the children of PaymentForm.

Your Example Website or App

this applies to any site this is used on

Steps to Reproduce the Bug or Issue

  1. Attempt to put the button somewhere else in your code.
  2. Realize there is no trivial way to do so.

Expected behavior

As a user, I expected to be able to have the same flexibility as the Square Web Payments SDK that this library wraps. This is a breaking change.

Screenshots or Videos

No response

Platform

  • OS: macOS, Windows
  • Browser: Chrome, Safari, Firefox

Additional context

No response

llampwall avatar Jun 14 '22 07:06 llampwall

Agreed with this. Even though our application houses the two together, we have essentially no control over it.

KalebMills avatar Oct 04 '22 22:10 KalebMills

I agree as well. Also can you make the CreditCard button interoperable with libraries like MUI. Atm it will throw many errors and bugs when trying to compose this component.

FeLiNa22 avatar Mar 30 '23 23:03 FeLiNa22

Any updates on this? Much needed improvement as it completely destroys our current billing flow.

Sexual avatar Nov 21 '23 15:11 Sexual

I'm also interested in this option, an example use case would be to create a checkout page like this image

alexbrazier avatar Mar 06 '24 14:03 alexbrazier

Why did the merge died ?

100tomtomas100 avatar Dec 05 '24 20:12 100tomtomas100