payment session
This commit is contained in:
@@ -77,7 +77,7 @@ class AccountService(BaseService):
|
||||
"completed": random.randint(0, 10)
|
||||
}
|
||||
|
||||
logger.info(f"Member Actions Error: {action_data}")
|
||||
# logger.info(f"Member Actions : {action_data}")
|
||||
|
||||
return ResponseHelper.success(data=action_data)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class MyProductsService(BaseService):
|
||||
def mpproduct_template_data(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -98,7 +98,7 @@ class MyProductsService(BaseService):
|
||||
def process_provision(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, ProvisionSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -158,7 +158,7 @@ class MyProductsService(BaseService):
|
||||
def process_subscription(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -238,7 +238,7 @@ class MyProductsService(BaseService):
|
||||
|
||||
memberSubscription = MembersProducts.get_member_product_by_product_member_id(member_id, product_id)
|
||||
if memberSubscription is not None:
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
productDataStatus = memberSubscription.status
|
||||
product_subscription_uid = memberSubscription.uid
|
||||
# product_subscription_external_url = memberSubscription.external_url
|
||||
@@ -291,7 +291,7 @@ class MyProductsService(BaseService):
|
||||
def process_request(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -307,7 +307,7 @@ class MyProductsService(BaseService):
|
||||
|
||||
memberSubscription = MembersProducts.get_member_product_by_product_member_id(member_id, product_id)
|
||||
if memberSubscription is not None:
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
productDataStatus = memberSubscription.status
|
||||
product_subscription_uid = memberSubscription.uid
|
||||
product_subscription_external_url = memberSubscription.external_url
|
||||
@@ -363,7 +363,7 @@ class MyProductsService(BaseService):
|
||||
def process_settings_values(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -379,7 +379,7 @@ class MyProductsService(BaseService):
|
||||
memberSubscription = MembersProducts.get_member_product_by_product_member_id(member_id, product_id)
|
||||
settings_data = []
|
||||
if memberSubscription is not None:
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||
product_subscription_uid = memberSubscription.uid
|
||||
settings_data_result = MembersProductsSettings.get_product_settings_by_product_id_and_member_id(
|
||||
product_id, member_id)
|
||||
|
||||
@@ -55,7 +55,7 @@ class ProductsService(BaseService):
|
||||
|
||||
products = Products.get_user_product_list(member_id)
|
||||
product_data=[]
|
||||
logger.info(f"Product Data ****** *****: {products}")
|
||||
# logger.info(f"Product Data ****** *****: {products}")
|
||||
|
||||
for t in products:
|
||||
currentStatus = t.status
|
||||
@@ -65,7 +65,7 @@ class ProductsService(BaseService):
|
||||
if filtered_list:
|
||||
product_sub_result = filtered_list[0]
|
||||
currentStatus = product_sub_result["status"]
|
||||
logger.info(f"Member Product Filtered Sub Data Status ****** *****: {currentStatus}")
|
||||
# logger.info(f"Member Product Filtered Sub Data Status ****** *****: {currentStatus}")
|
||||
icon_style = ''
|
||||
st_text = "Activate Now"
|
||||
product_icon = "fa-cart-plus",
|
||||
@@ -232,7 +232,7 @@ class ProductsService(BaseService):
|
||||
products = MembersProducts.get_member_productlist_by_member_id(member_id)
|
||||
|
||||
product_data=[]
|
||||
logger.info(f"Product Data ****** *****: {products}")
|
||||
# logger.info(f"Product Data ****** *****: {products}")
|
||||
|
||||
|
||||
for t in products:
|
||||
|
||||
@@ -6,7 +6,7 @@ from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.user import UserSchema
|
||||
from app.api.schemas.subscription_session import SubscriptionSession
|
||||
from marshmallow import ValidationError
|
||||
from app.models import Members, MembersProducts, SubscriptionOptions, SubscriptionOptionsItems
|
||||
from app.models import Members, MembersProducts, SubscriptionOptions, SubscriptionOptionsItems, PaymentsSession
|
||||
from app.extensions import db
|
||||
from app.api.integrations import StripeIntegration
|
||||
|
||||
@@ -152,7 +152,7 @@ class SubscriptionService(BaseService):
|
||||
def subscription_session_start(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
# logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = SubscriptionService.validate_data(data, SubscriptionSession())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
@@ -168,7 +168,9 @@ class SubscriptionService(BaseService):
|
||||
return []
|
||||
|
||||
stripe_session = StripeIntegration.create_checkout_session_subscription(priceId, customerId)
|
||||
logger.info(f"Inside Stripe_Session ===== : {stripe_session}")
|
||||
logger.info(f"Inside Stripe_Session ===== : {stripe_session}")
|
||||
logger.info(f"Inside Stripe_Session ID ===== : {stripe_session.id}")
|
||||
PaymentsSession.add_payment_session(member_id, option_name, 'STRIPE', stripe_session.id)
|
||||
#
|
||||
# product_id = validated_data.get('product_id')
|
||||
# product_subscription_uid=''
|
||||
|
||||
Reference in New Issue
Block a user