Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't deploy specific payment provider settings #15

Open
mattbrailsford opened this issue Mar 11, 2022 · 5 comments
Open

Don't deploy specific payment provider settings #15

mattbrailsford opened this issue Mar 11, 2022 · 5 comments

Comments

@mattbrailsford
Copy link
Member

This was raised in the Vendr Deploy repo but probably counts here too, but some payment provider settings might not want to be deployed so we have implemented an app setting to ignore specific settings. Whatever we do in that package, we are probably going to need to replicate here too

vendrhub/vendr-deploy#14

@KevinJump
Copy link
Collaborator

Hi,

easing back into uSync.Vendr with this one. :)

So just to confirm what i am looking at ?

In a "PaymentMethod" we have a provider settings section ?

e.g for the 'Zero Value' payment methiod.

  <ProviderSettings>
    <Setting>
      <Key>ContinueUrl</Key>
      <Value>/checkout/order-confirmation/</Value>
    </Setting>
  </ProviderSettings>

presumably for more complex payment systems this is fancier and has more properties ?

and we want to ignore/not serialize/deserialize certain ones?

@mattbrailsford
Copy link
Member Author

mattbrailsford commented Oct 7, 2022

Yea, so those settings are always key/value, but in the app settings there should be something to say "ignore this setting entirely" and just don't include it.

For example, here's what we now support in Vendr.Deploy

{
   ...
   "Vendr.Deploy": {
        "PaymentMethods": {
            "IgnoreSettings": [ "testMode", "sanboxMode", "liveApiKey" ]
        }
    }
}

Which means any settings with the key testMode, sandboxMode or liveApiKey will get ignored and won't be transfered, so ideally I guess we would want to support

{
   ...
   "Vendr.uSync": {
        "PaymentMethods": {
            "IgnoreSettings": [ "testMode", "sanboxMode", "liveApiKey" ]
        }
    }
}

@KevinJump
Copy link
Collaborator

there is already have a way of passing settings to the serializers

so the "simple" fix is to use that, but the settings will be buried in uSync then.

 "uSync": {
    "Publisher": {
      "Handlers": {
        "vendrPaymentMethodHandler": {
          "settings": {
            "IgnoreSettings": [ "testMode", "sanboxMode", "liveApiKey" ]
          }
        }
      }
  }
}

as much as that obviously pleases me, i think we can make a vendr.usync settings section for this one 😄

@KevinJump
Copy link
Collaborator

Hi this is already done on serialization 😄
5ed72ec

I suppose for completeness, we could do in on import too, just incase its not configured on the exporting server.

KevinJump added a commit that referenced this issue Oct 7, 2022
Ignore the settings by key on import, just covers situation where the values might have been exported but we don't want them imported.
@mattbrailsford
Copy link
Member Author

Good point, I don't actually think we do that in Vendr.Deploy so I should probably implement that too 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants