flutter-plugin icon indicating copy to clipboard operation
flutter-plugin copied to clipboard

Proposal to allow passing json string configuration to pay buttons

Open adxzhang1 opened this issue 3 years ago • 10 comments

One proposal that allows the GooglePayButton, ApplePayButton, and PayButton to accept a string which can either be the payment configuration or the payment configuration file.

#7

adxzhang1 avatar Jun 02 '21 21:06 adxzhang1

Hi @adxzhang1, thank you for taking a stab at this one.

I think it'd be clearer to have two different properties that clearly reflect the expectation to receive an asset or a JSON string respectively. This allows us to use clear rules to differentiate the two, instead of arbitrary conditions (eg.: a file with JSON contents many not necessarily need to include the .json extension).

I'd suggest we add a separate property (eg.: paymentConfigurationString) and control with assertions that only one of them is set at init time. What do you think?

JlUgia avatar Jun 07 '21 16:06 JlUgia

Hi @adxzhang1, thank you for taking a stab at this one.

I think it'd be clearer to have two different properties that clearly reflect the expectation to receive an asset or a JSON string respectively. This allows us to use clear rules to differentiate the two, instead of arbitrary conditions (eg.: a file with JSON contents many not necessarily need to include the .json extension).

I'd suggest we add a separate property (eg.: paymentConfigurationString) and control with assertions that only one of them is set at init time.

What do you think?

Hi @JlUgia, I totally agree, that would be much better!

adxzhang1 avatar Jun 08 '21 04:06 adxzhang1

Hi @adxzhang1, would you be willing to adapt your PR based on the conclusion above? I've re-read the change, and we'll only need to make adjustments to the naming. I can take it over otherwise.

JlUgia avatar Nov 22 '21 10:11 JlUgia

Hey @JlUgia - just updated.

adxzhang1 avatar Dec 01 '21 06:12 adxzhang1

oh need this feature to use dynamic configuration instead of static json asset ! all check passed

AymenFarrah avatar Apr 08 '22 08:04 AymenFarrah

Hi, what about this PR ? possible to merge it ? Thanks for the great work btw ;)

gwennguihal avatar May 06 '22 09:05 gwennguihal

@JlUgia Please consider merging this important one. We need this

rahulraj64 avatar Aug 17 '22 03:08 rahulraj64

@JlUgia included those changes

adxzhang1 avatar Aug 18 '22 04:08 adxzhang1

LGTM Any additional thoughts @domesticmouse?

JlUgia avatar Sep 12 '22 11:09 JlUgia

Hi @adxzhang1, apologies for the delay on this. Here are two small suggestions (1, 2) to make things a bit more readable. Feel free to include them in this PR, and we are ready to merge.

JlUgia avatar Oct 12 '22 14:10 JlUgia

Closing in favor of #178 (released as version 1.1.0)

JlUgia avatar Jan 24 '23 12:01 JlUgia