2

I have configured BrainTree API key in the Sitecore Commerce installer powershell script and ran the setup successfully.

But I realised afterwards that I misconfiguration one character in the braintree API key. I have tried editing it CommerceAuthoring\wwwroot\data\Environments\PlugIn.Payments.Braintree.PolicySet-1.0.0.json but it does not seem to have any effect.

Does anyone knows how to configure the braintree API key on Sitecore commerce, without having to go through the installation process again?

The braintree API key I am referring to is this

{
        "$type": "Plugin.Sample.Payments.Braintree.BraintreeClientPolicy, Plugin.Sample.Payments.Braintree",
        "Environment": "sandbox",
        "MerchantId": "[YourMerchantId]",
        "PublicKey": "[YourPublicKey]",
        "PrivateKey": "[YourPrivateKey]",
        "ConnectTimeout": 120000
 }

https://doc.sitecore.com/developers/91/sitecore-experience-commerce/en/payment-concepts.html

3

Yes is possible to update the braintree keys without installing again Commerce.

You just need to modify one file in 4 places.

On all roles of commerce (Authoring,Shops,Minions, Ops) you have in the environment folder next json config file:

Example: C:\inetpub\wwwroot\yoursite\CommerceAuthoring_Sc910\data\Environments\PlugIn.Payments.Braintree.PolicySet-1.0.0

You need to update merchantid, privatekey and public key

{
    "$type":  "Sitecore.Commerce.Core.PolicySet, Sitecore.Commerce.Core",
    "Id":  "Entity-PolicySet-BraintreePolicySet",
    "Version":  1,
    "IsPersisted":  false,
    "Name":  "BraintreePolicySet",
    "Policies":  {
                     "$type":  "System.Collections.Generic.List`1[[Sitecore.Commerce.Core.Policy, Sitecore.Commerce.Core]], mscorlib",
                     "$values":  [
                                     {
                                         "$type":  "Plugin.Sample.Payments.Braintree.BraintreeClientPolicy, Plugin.Sample.Payments.Braintree",
                                         "Environment":  "sandbox",
                                         "MerchantId":  "",
                                         "PublicKey":  "",
                                         "PrivateKey":  "",
                                         "ConnectTimeout":  120000
                                     }
                                 ]
                 }
}

After you made the changes you need to bootstrap the commerce engine.

1

You need to bootstrap your environment once again so the changes take in effect and are pushed to Global database and CommerceEntities table.

If you have Postman set up, in Postman Collections pane, scroll all the way down to SitecoreCommerce_DevOps. Expand it and expand also "1 Environment Bootstrap" section. Click on "Bootstrap Sitecore Commerce":

enter image description here

Click on the blue "Send" button to send the request. As you have security token, this operation should go through without any problem:

enter image description here

To generate security token and overall setting up Postman, take a look on my blog post here -> https://tothecore.sk/2018/07/25/setting-up-development-environment-with-postman-and-sitecore-experience-commerce-sxc-9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.