feat: allow paystack options as argument in initialize function #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
initializePayment
function now takes in an optionalpaystackProps
argument as a config param. Props passed in the function's config param will overwrite props passed in theusePaystackPayment
Hook.In hook config options, only the
publicKey
prop is mandatory since it doesn't change and will be a pain to pass in on every invocation of theinitializePayment
function. IninitializePayment
config options, publicKey is omitted.Fixes issue #78
BREAKING CHANGES:
initializePayment
function now takes in an object withonClose
,onSuccess
andconfig
as keys rather than as individual arguments. This ensures all three props can in any order or omitted since they are all optional.