Merge branch 'release/1.0.10'

This commit is contained in:
Nathan Chapman 2022-04-30 15:31:48 -06:00
commit 2e9c558f04

View File

@ -3,7 +3,7 @@ import sys
import json import json
import logging import logging
from paypalcheckoutsdk.core import PayPalHttpClient, SandboxEnvironment from paypalcheckoutsdk.core import PayPalHttpClient, SandboxEnvironment, LiveEnvironment
from paypalcheckoutsdk.orders import OrdersCreateRequest, OrdersCaptureRequest from paypalcheckoutsdk.orders import OrdersCreateRequest, OrdersCaptureRequest
from paypalhttp.serializers.json_serializer import Json from paypalhttp.serializers.json_serializer import Json
@ -23,7 +23,10 @@ class PayPalClient:
"""Setting up and Returns PayPal SDK environment with PayPal Access credentials. """Setting up and Returns PayPal SDK environment with PayPal Access credentials.
For demo purpose, we are using SandboxEnvironment. In production this will be For demo purpose, we are using SandboxEnvironment. In production this will be
LiveEnvironment.""" LiveEnvironment."""
self.environment = SandboxEnvironment(client_id=self.client_id, client_secret=self.client_secret) if settings.DEBUG:
self.environment = SandboxEnvironment(client_id=self.client_id, client_secret=self.client_secret)
else:
self.environment = LiveEnvironment(client_id=self.client_id, client_secret=self.client_secret)
""" Returns PayPal HTTP client instance with environment which has access """ Returns PayPal HTTP client instance with environment which has access
credentials context. This can be used invoke PayPal API's provided the credentials context. This can be used invoke PayPal API's provided the