GithubHelp home page GithubHelp logo

Stripe Integration? about logfire HOT 7 OPEN

pydantic avatar pydantic commented on September 26, 2024 4
Stripe Integration?

from logfire.

Comments (7)

ozleryildirim2 avatar ozleryildirim2 commented on September 26, 2024

help please stripe

I cannot receive the payment made to my Stripe account, I have made changes many times, the error has gotten bigger and now, even though I have entered my information correctly, I am giving an address verification error and I cannot activate my account, so I cannot receive the payment of the money in the account, they banned me, I think it has been 1 year.

My other problem is, I want to access the control panel from the e-mail sent on a past date, but there is no e-mail, I cannot find it, so I cannot activate my account.

While creating a new membership, before switching from the test mode to the live mode, it says that the restriction is not acceptable to confirm. Could it be because my API address is blocked? I cannot create a healthy membership. Turkey does not provide any kind of service. Am I signing up with the information of that country with a VPN? Even if it does not work, if I send 1 dollar to try it, it will be restricted.

When I connect it to my website, I cannot work because there will be restrictions when payments are made. I integrate it in 2D and there are restrictions when there are incoming payments. Is there anyone who can help me with this? I do not want to connect the APIs to the website and try to persuade these stripe approvals.

from logfire.

Kludex avatar Kludex commented on September 26, 2024

@samuelcolvin Can you give more details about what's interesting here?

All the stripe objects on the client seem to inherit the following: https://github.com/stripe/stripe-python/blob/5e5eb48993c8c964abb7a93d37a817bfdf674d9e/stripe/_stripe_object.py#L80

Maybe we can do something about it? What do you think?

from logfire.

Kludex avatar Kludex commented on September 26, 2024

Stripe has a logger that we can use for this.

from logfire.

Kludex avatar Kludex commented on September 26, 2024

I did some investigation here.

As I said, stripe uses a logger:

logger: logging.Logger = logging.getLogger("stripe")

With this snippet, you can already see it in use:

import logging
import os

import dotenv
import stripe
from rich.logging import RichHandler

import logfire

logfire.configure(console=False)

FORMAT = '%(message)s'
logging.basicConfig(
    level='DEBUG',
    format=FORMAT,
    datefmt='[%X]',
    handlers=[RichHandler(), logfire.LogfireLoggingHandler()],
)

dotenv.load_dotenv()

client = stripe.StripeClient(api_key=os.environ['STRIPE_SECRET_KEY'])

with logfire.span('list_products'):
    products = client.products.list()

The console output:

❯ python main.py
Logfire project URL: https://logfire.pydantic.dev/kludex/my-project
[12:00:57] DEBUG    load_ssl_context                                                                                                                   _config.py:80
                    verify='/Users/marcelotryle/dev/pydantic/logfire/.venv/lib/python3.12/site-packages/stripe/data/ca-certificates.crt' cert=None                  
                    trust_env=True http2=False                                                                                                                      
           DEBUG    load_verify_locations                                                                                                             _config.py:146
                    cafile='/Users/marcelotryle/dev/pydantic/logfire/.venv/lib/python3.12/site-packages/stripe/data/ca-certificates.crt'                            
           INFO     message='Request to Stripe api' method=get url=https://api.stripe.com/v1/products                                                   _util.py:128
           DEBUG    api_version=2024-06-20 message='Post details' post_data=                                                                            _util.py:121
           DEBUG    Starting new HTTPS connection (1): api.stripe.com:443                                                                     connectionpool.py:1051
           DEBUG    https://api.stripe.com:443 "GET /v1/products HTTP/11" 200 678                                                              connectionpool.py:546
           INFO     message='Stripe API response' path=https://api.stripe.com/v1/products response_code=200                                             _util.py:128
           DEBUG    body='{\n  "object": "list",\n  "data": [\n    {\n      "id": "prod_QRRsAs4oOhniSu",\n      "object": "product",\n      "active":   _util.py:121
                    true,\n      "attributes": [],\n      "created": 1720512044,\n      "default_price": "price_1PiaDGB7axlxkstuaOyy5kn8",\n                        
                    "description": null,\n      "images": [],\n      "livemode": false,\n      "marketing_features": [],\n      "metadata": {},\n                   
                    "name": "Logfire Service",\n      "package_dimensions": null,\n      "shippable": null,\n      "statement_descriptor": null,\n                  
                    "tax_code": "txcd_20030000",\n      "type": "service",\n      "unit_label": null,\n      "updated": 1722591869,\n      "url":                   
                    null\n    }\n  ],\n  "has_more": false,\n  "url": "/v1/products"\n}' message='API response body'                                                
           DEBUG    link=https://dashboard.stripe.com/test/logs/req_u5SowCdY2lntte message='Dashboard link for request'                                 _util.py:121
           DEBUG    Starting new HTTPS connection (1): logfire-api.pydantic.dev:443                                                           connectionpool.py:1051
Starting new HTTPS connection (1): logfire-api.pydantic.dev:443
           DEBUG    Starting new HTTPS connection (2): logfire-api.pydantic.dev:443                                                           connectionpool.py:1051
Starting new HTTPS connection (2): logfire-api.pydantic.dev:443
[12:00:58] DEBUG    https://logfire-api.pydantic.dev:443 "POST /v1/metrics HTTP/11" 200 2                                                      connectionpool.py:546
https://logfire-api.pydantic.dev:443 "POST /v1/metrics HTTP/11" 200 2
           DEBUG    https://logfire-api.pydantic.dev:443 "POST /v1/traces HTTP/11" 200 2                                                       connectionpool.py:546
https://logfire-api.pydantic.dev:443 "POST /v1/traces HTTP/11" 200 2

As we can see, the body information is available on the DEBUG level. We may be able to use that on our UI.

from logfire.

Kludex avatar Kludex commented on September 26, 2024

I talked to Samuel, and the idea would be to monkeypatch the HTTPClient, and create a span with otel scope "stripe".

from logfire.

ozleryildirim2 avatar ozleryildirim2 commented on September 26, 2024

from logfire.

ozleryildirim2 avatar ozleryildirim2 commented on September 26, 2024

from logfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.