#hamid-sofort

1 messages ยท Page 1 of 1 (latest)

crystal pagoda
#

hello @lethal pewter! what specific question regarding the below can i help with?

So now, if you accept a 10โ‚ฌ payment with Sofort, the PaymentIntent is associated with pm_123 for Sofort, and in turn, if you also passed setup_future_usage: 'off_session' we know you want SEPA debit and we will create a new PaymentMethod for SEPA Debit and that one will be attached to the customer
lethal pewter
#

okie, great, question i have is, yesterday i was discussing this with one of you guys, and he/she gave me above statement..

#

actually i want to use sorfot for later payments

#

or future payments

#

Also for that i an following this doc

#

so question is: how and where i can passsetup_future_usage: 'off_session'

#

to get such payment_method so that i can attach it to customer and can charge later by using setup intent

#

As, yesterday when i tried, it go following error and i started discussion with you guys.

crystal pagoda
#

can you share the exact req id where you got that error message?

lethal pewter
#

ohhhh, not sure, let me see if i have logs

#

this is the max info i have

#

I, [2021-10-27T13:45:34.183629 #19] INFO -- : SSS: Stripe: attach_payment_method: cus_KTKOwI7Ux0Txw1 payment_method: pm_1JpCR9B9MHxVN54cFEuwJ72h
I, [2021-10-27T13:45:34.183776 #19] INFO -- : SSS: Stripe: retrieve_customer: cus_KTKOwI7Ux0Txw1
W, [2021-10-27T13:45:34.828140 #19] WARN -- : spaceos_error_uuid: 39a25a3c-2072-4176-bb3a-1dd4a875d493: Stripe::InvalidRequestError: PaymentMethods of type 'sofort' cannot be saved to customers.

crystal pagoda
#

hrm

#

you seem to already have already successfully done it for the latest attempt though

#

i'm looking at pm_1JpTHNB9MHxVN54cjlOySNWK specifically

lethal pewter
#

when it was done?

#

i mean the payment_method i gave, which generated error was old, and new one was generated, which could be attached?

crystal pagoda
#

if you login to your Dashboard

#

it's the latest log

#

you can see the confirmation was successful

lethal pewter
#

confirmation of what?>

crystal pagoda
#

sorry, that was confusing. What i meant was that you have successfully attached pm_1JpTHFB9MHxVN54c5P3lya3G (Sofort) to the customer in the latest request : req_cvmNc8tvyAHOdy

lethal pewter
#

to which customer?

#

do you have id

crystal pagoda
#

cus_KTKOwI7Ux0Txw1

lethal pewter
#

one sec, how this happened, automatically?

crystal pagoda
#

are you sure no one else in your team is testing?

lethal pewter
#

Front end is testing

#

my point here is

#

i am doing backend

#

I didn't write the code yet to attach payment method with customer

#

as it giving error

#

see i just tried and got this

#
irb(main):003:1*             "cus_KTKOwI7Ux0Txw1",
irb(main):004:1*             payment_method: "pm_1JpTHFB9MHxVN54c5P3lya3G"
irb(main):005:1>           )
#
        2: from (irb):2
        1: from app/adapters/stripe_gateway/stripe_adapter_core.rb:179:in `attach_payment_method'
Stripe::InvalidRequestError ((Status 400) (Request req_aluYWNTWAKO4PI) PaymentMethods of type 'sofort' cannot be saved to customers.)
#

request_id=req_B6gToGm3VNLtSr

crystal pagoda
#

not create the PaymentMethod and then attach it to the Customer later

lethal pewter
#

setupintent was created in the first step

#

setup inetnt was already generated as first step and is attached with customer

#

for sepa_debit we attach payment_methods as well to charge it later

crystal pagoda
#

that won't work - you need to follow the exact steps in that guide. Sofort is not a PaymentMethod that supports recurring payments. When you use stripe.confirmSofortSetup to confirm the SetupIntent with the Sofort PaymentMethod details, it converts the Sofort details into a SEPA DD PaymentMethod automatically

lethal pewter
#

yea thats fine

#

i got it

#

it already happening

#

so point here is how we can create payment intent without attaching payment_method?

#

also if its automatically attached, can user attach multiple sorfot accounts as well?

crystal pagoda
lethal pewter
#

remember you gave me customer above?

#

and payment_method

#

I tried to created payment intent with them like this

#
                                                payment_method_types: ['sepa_debit'],
                                                amount: 1099,
                                                currency: 'eur',
                                                customer: 'cus_KTKOwI7Ux0Txw1',
                                                payment_method: 'pm_1JpTHFB9MHxVN54c5P3lya3G',
                                                confirm: true,
                                              })```
#

and this is what i got

#

``` 1: from (irb):17:in `rescue in irb_binding'
Stripe::InvalidRequestError ((Status 400) (Request req_6nkmoXV8WrqfMo) The provided sofort PaymentMethod cannot be used again. It was used in a previous PaymentIntent or SetupIntent to set up a sepa_debit PaymentMethod, which can be used for multiple payments. To find the ID of the sepa_debit PaymentMethod, list the sepa_debit PaymentMethods associated with the Customer used to set up this PaymentMethod.)

crystal pagoda
#

as the error message mentioned, you need to use the ID of the generated sepa_debit PaymentMethod which is pm_1JpTHNB9MHxVN54cjlOySNWK

#

pm_1JpTHFB9MHxVN54c5P3lya3G -> this is the id of the sofort payment method

lethal pewter
#

okie thats understandable and from wher ei can get setp debit payment method?

#

this way

#
  id: '{{SETUP_INTENT_ID}}',
  expand: ['latest_attempt'],
})```
lethal pewter
#

so we need to find payment method of sepa from setup intent we created in first step

crystal pagoda
#

yep!

lethal pewter
#

please stay with me

#

generated_sepa_debit

#

?

#

pm_1JpTHNB9MHxVN54cjlOySNWK

#

?

#

yes great

#

it worked, like payment intent worked

#

okie great

#

i am able to attache and create payment intent against the pm_1JpTHNB9MHxVN54cjlOySNWK

#

which is generated_sepa_debit

#

thanks a lot

#

thanks a lot ๐Ÿ™‚

#

last question, how can i get email script of our complete chat?

crystal pagoda
#

that's not possible in Discord, i'd suggest just copying everything we talked about and pasting it somewhere in a document

lethal pewter
#

srue

#

๐Ÿ™‚