#satvik-techie_code

1 messages ¡ Page 1 of 1 (latest)

cedar nightBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1230400313551491143

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

mystic streamBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

river crag
#

The Payment Intent has been confirmed with confirm: true in the initial Payment Intent request creation, which has moved the status to succeeded: https://dashboard.stripe.com/test/logs/req_S1AWuJ9NnKNeWz

You shouldn't need to confirm again in https://dashboard.stripe.com/test/logs/req_9iIijCjFB1KqSq

native cloak
#

so should i remove Confirm = true, from my api ?

#

var paymentIntent = await service.CreateAsync(new PaymentIntentCreateOptions
{
Amount = Convert.ToInt32(stripePaymentRequestViewModel.amount * 100),
Currency = "gbp",
AutomaticPaymentMethods = new PaymentIntentAutomaticPaymentMethodsOptions
{
Enabled = true,
AllowRedirects="never"
},

                Customer = customer.Id,
                PaymentMethod = stripePaymentRequestViewModel.PaymentMethod,
                PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions
                {
                    Card = new PaymentIntentPaymentMethodOptionsCardOptions { Moto = true },
                },
                Confirm = true,
                SetupFutureUsage = "off_session",
            }, requestOptions);
river crag
native cloak
#

above code is my backend code to create payment intent

#

so should i remove line Confirm = true ?

#

const objSave = Object.assign({});
objSave.landlordRentGuaranteeId = this.landlordRentGuaranteeId;
objSave.isFromBackoffice = true;
objSave.paymentMethod = this.paymentMethodid;

this.subscription.add(
  this.rentGuaranteeService.MakePayment(objSave).subscribe((data: any) => {
    this._stripe
      .confirmCardPayment(data.clientSecret, {
        payment_method: this.paymentMethodid,
      })
      .subscribe((result1) => {
        if (result1.error) {
          // Show error to your customer (e.g., insufficient funds)
          console.log(result1.error.message);
          this.toastrService.error(result1.error.message);
        } else {
          // The payment has been processed!
          if (result1.paymentIntent.status === "succeeded") {
            console.log(result1);
            this.toastrService.success("Payment Successfull");
            this.card.element.clear();
            this.cardExpiry.clear();
            this.router.navigate(["/search"]);
          }
        }
      });
  })
);

// return this.http.post<PaymentIntent>(
//   `https://localhost:44326/api/Payment/create_payment_intent/` +
//     this.paymentMethodid +
//     "/" +
//     amount,
//   null
// );
#

this is my front end code

river crag
#

We'd need to understand what you're trying to do with https://dashboard.stripe.com/test/logs/req_9iIijCjFB1KqSq, so that we can advise further?

Since you have created the Payment Intent with payment method at the server, why is there a need to confirm again at client/frontend? It can be simplied to just one single step which is just https://dashboard.stripe.com/test/logs/req_S1AWuJ9NnKNeWz

native cloak
#

so first i have created request to get paymentmethod using stirpejs
second i am creating payment intent using my api
third i will confirmpayment using stripe js

river crag
#

Thanks for sharing the details. In this case, confirm: true should be removed

native cloak
#

if i remove confirm true then i am running into error
The parameter moto cannot be passed as part of payment_method_options when creating a PaymentIntent unless confirm is set to true."

river crag
#

You shouldn't set moto if the customer is present to enter the card details to make a payment

#

Why do you set moto in the request?

#

If the customer is present to enter the card details, moto should be removed as well

native cloak
#

my client want to take payment over phone

#

that why i need to include moto

river crag
#

I see! Then this is the different scenario. Your integration should then be:

  1. Collect payment method details from StripeJS
  2. Create and confirm the Payment Intent with confirm: true and moto set

There shouldn't be additional request to confirm payment using StripeJS

#

Third step in your original integration is not required

native cloak
#

ok let me check

#

i have checked it works , but i cannot see payment in stripe dashboard

river crag
#

The payments were made on the connected account. You should be able to view the payments in the connected account, not platform account

native cloak
river crag