(In case of ‘invalid_request’ error) --site-domainin command is URL of trusted client added by defaultfor ecommerce app use. Make sure URL and Redirect URL of trusted client is set accordingly with this command i.e ecommerce-{sandbox link} and ecommerce-{sandbox link}/complete/edx-oidc/. Trusted Clients are at {sandbox link}/admin/edx_oauth2_provider/trustedclient/. You will need a superuser to access admin site.
In this case check lms.auth.json,lms.env.json and update all the redirect uri's to the sandbox link e.g. ecommerce-{sandbox link}.
Note:This guide assumes that sandbox was created with clients and trusted clients. Sandbox by default create clients and trusted clients.
Enable Ecommerce basket Page
By default edxapp does not uses the normal checkout flow. To enable ecommerce basket page and checkout do following steps
if there is a client for ecommerce services confirm following settings else create one with following settings (Use urls according to url sandbox)
after that go to ecommerce.yml
sudo nano /edx/etc/ecommerce.yml
confirm following settings of JWT if something is missing add it.
JWT_AUTH: JWT_AUDIENCE: ecommerce-key # It should be same as described in lms client. JWT_SECRET_KEY: ecommerce-secret # It should be same as described in lms client. JWT_SECRET_KEYs: - ecommerce-secret JWT_ISSUERS: - ecommerce_worker JWT_VERIFY_EXPIRATION: False JWT_VERIFY_AUDIENCE: False
Now go to lms.env.json file
sudonano /edx/app/edxapp/lms.env.json
confirm the following JWT_AUTH settings
JWT_AUTH: JWT_AUDIENCE: ecommerce-key # It should be same as described in lms client. JWT_SECRET_KEY: ecommerce-secret # It should be same as described in lms client.
Enable Payment Processor on Sandbox
Use the Following commands to setup the payment processor
sudo nano /edx/etc/ecommerce.yml
Search 'PayPal' in 'ecommerce.yml', Provide client_id , secret_id from your PayPal sandbox account and update mode value to 'sandbox'