flutter-plugin
flutter-plugin copied to clipboard
Proposal to allow passing json string configuration to pay buttons
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
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 @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!
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.
Hey @JlUgia - just updated.
oh need this feature to use dynamic configuration instead of static json asset ! all check passed
Hi, what about this PR ? possible to merge it ? Thanks for the great work btw ;)
@JlUgia Please consider merging this important one. We need this
@JlUgia included those changes
LGTM Any additional thoughts @domesticmouse?
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.
Closing in favor of #178 (released as version 1.1.0
)