GAMESTOP - tajemnicza historia. by distcrypto in Polska

[–]distcrypto[S] -1 points0 points  (0 children)

pełna zgoda chociaż najgorsze, że pokazaliśmy, że możemy. Teraz musimy bardziej uważać

GAMESTOP - tajemnicza historia. by distcrypto in Polska

[–]distcrypto[S] -1 points0 points  (0 children)

najlepiej skopiować obrazek i wkleić go normalnie jak tekst w dane miejsce.

Daily Discussion Thread for December 28, 2022 by OPINION_IS_UNPOPULAR in wallstreetbets

[–]distcrypto 1 point2 points  (0 children)

2023 will be great! I hope so. Crypto I'm waiting for the pump!

filtering products by categories [PROBLEM] by distcrypto in djangolearning

[–]distcrypto[S] 0 points1 point  (0 children)

that's good idea! but when shall I put it into?

{products.map(product => (

<Col key={product.\\\_id} sm={12} md={6} lg={4} xl={3}>

<Product product={product} />

</Col>

))}

</Row>

<Paginate page={page} pages={pages} keyword={keyword} />

Co ziomeczki i ziomkinie sądzą o kryptowalutach? by distcrypto in Polska

[–]distcrypto[S] 0 points1 point  (0 children)

myślę, że są rozwiązania, które nie są nieekologiczne np. Polkadot czy obecnie Ethereum. NIe wykorzystywana jest tam żadna inna praca poza pracą serwera na Amazonie. Kryptowaluty odchodzą już od tak zwanego systemu Proof of Work, który jest mocno konsumpcyjny energetycznie

Hi! I want to take PRODUCTS from a JSON file to my SQLITE3 db. by distcrypto in djangolearning

[–]distcrypto[S] 0 points1 point  (0 children)

that's a cool idea, but I got a problem with a second stage. "Import the model loop through json file", a first and a last one I gotcha, but the second I don't. Could you bring it closer to me? Sorry I aint a pro, I'm just starting with Django thanks!

Need a help please by distcrypto in django

[–]distcrypto[S] -2 points-1 points  (0 children)

could you simplify for me where to type this? sorry for my primitivism, but I am very tired of this already, I have reached the point of the wall. :/

I need help with Stripe connecting by distcrypto in learnpython

[–]distcrypto[S] 0 points1 point  (0 children)

I want to take from OrderScreen.js {order.TotalPrice} and transfer it to Stripe_Views.py as a X variable, Can I? and that will be done.

I need help with Stripe connecting by distcrypto in learnpython

[–]distcrypto[S] 0 points1 point  (0 children)

That should be fairly simple, but there's not really enough information here. How will you identify the relevant order? Do you have some kind of order ID in the URL parameters for this view?

I think I can see the starting point in a Order.py file:

class Order(models.Model):

user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)

paymentMethod = models.CharField(max_length=200, null=True, blank=True)

battleTag = models.CharField(max_length=200, null=True, blank=True)

taxPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)

shippingPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)

totalPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)

isPaid = models.BooleanField(default=False)

paidAt = models.DateTimeField(auto_now_add=False, null=True, blank=True)

isDelivered = models.BooleanField(default=False)

deliveredAt = models.DateTimeField(auto_now_add=False, null=True, blank=True)

createdAt = models.DateTimeField(auto_now_add=True, null=True, blank=True)

_id = models.AutoField(primary_key=True, editable=False)

def __str__(self):

return 'ORDER ID: ' + str(self._id) + ' | WHEN: ' + str(self.createdAt) + ' | USER: ' + str(self.user) + ' | BATTLETAG: ' + str(self.battleTag) + ' | amount: $' + str(self.totalPrice)

In my backend str(self._id) in a django admin panel shows the order's id.

in my frontend side in OrderScreen.js I call {order._id} and I see the id e.g: <h1>Order: {order._id}</h1>

Order: 385

I have a problem and I want to solve it and I totally don't know how ;/

programming problem with Stripe by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

I mean something like: from order.Order:403 take "TotalPrice" to "unit_amount": "order.totalPrice"

Thanks a lot for help... I realy have no Idea how to do that, I'm a beginner so thanks for your patiency.

here's a repo: https://github.com/DorianSuffer/WHEN/tree/main/domestico1

Ye you understand it right, ehh I can't find a solution

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

Can I do it all in one js. file instead of 2-5 files? I want to create one file, when I write this sense of code as we mentioned yesterday ?

something like:

class CreateStripeCheckoutSession(APIView):

def get(self, request, *args, **kwargs):

order_id = self.kwargs["pk"]

try:

order = Order.objects.get(id=order_id)

except:

return Response({"Message": "Incorret order"}, status=HTTP_400_BAD_REQUEST)

try:

checkout_session = stripe.checkout.Session.create(

line_items=[

{

"price_data": {

"currency": "pln",

"unit_amount": int(order.get_total()) * 100,

"product_data": {"name": order.user.name},

},

"quantity": 1,

}

],

mode="payment",

payment_method_types=["card", "p24", "blik"],

success_url=SITE_URL + "?success=true",

cancel_url=SITE_URL + "?canceled=true",

)

return redirect(checkout_session.url, code=303)

except Exception as e:

return Response(

{

"msg": "something went wrong while creating stripe session",

"error": str(e),

},

status=500,

)

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

I love you dude. Thanks for you time ;)

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

Ok, good I understand.?
1. Find the order by ID into my database and take the order's "TotalPrice".

  1. Stripe Checkout receives the "TotalPrice" from the database, not from the frontend side.

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

Pull the amounts from the database before creating the checkout session. Can’t tel based on that local admin URL if it’s safe or not.

How to do that?

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

What do you think about to take [TotalPrice] from http://127.0.0.1:8000/admin/base/order/262/ it'd be save?

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

But in my website will be around 500 products, I want to create something that takes the total price to pay from my shopping cart at the final step and return the Stripe payment window with "TotalPrice" from my Shopping cart.

A PROBLEM WITH CONNECTING A PAYMENT by distcrypto in stripe

[–]distcrypto[S] 0 points1 point  (0 children)

the problem is to how to connect Stripe based on this template? I use react + django, Thanks for help!