#benjamineugenewhite

1 messages ยท Page 1 of 1 (latest)

muted snowBOT
tame flicker
#

hello! do you have a link to your test site which i can access?

somber stag
#

Yes. One sec.

tame flicker
#

testing this, gimme a while

#

Can you share your account id so that I can take a closer look at how your integration works? You can find your account id by logging in to https://dashboard.stripe.com/settings/account. It'll be in the upper right hand corner and looks like acct_123

somber stag
#

I don't see in upper right corner, but i see it in /settings/user under Accounts section

#

acct_1ASCSHBMAMOLTEak

tame flicker
#

if you are, you should remove it

somber stag
#

So we initialize using load_stripe here:
const stripePromise = useRef(loadStripe(HUB_STRIPE_API_PUB_KEY, { stripeAccount }));

tame flicker
#

you should definitely remove this { stripeAccount }

tame flicker
#

oh

#

which connected account are you testing this on?

somber stag
#

let me double check. one sec.

#

Looks like it's acct_1KPCZOCx6MKztsJa

tame flicker
#

hmmm, so i think the problem here is that the domain on the connected account needs to be registered using the platform's secret key and Stripe-Account header. I'm guessing you may have just logged into the Dashboard of the connected account to register the domain?

somber stag
#

Not sure how registration initially went down, but I'll consult with team tomorrow.

tame flicker
#

the second sample code in that section

#

just to confirm, you're doing direct charges with Connect right?

somber stag
#

Believe so re: direct charges, but help me understand what exactly that means here.

tame flicker
somber stag
#

Yes, that's correct, that's what we're doing.

#

And re: registering, we're doing as indicated in earlier snippet you shared

tame flicker
#

to clarify, i see newsrevenuehub.revengine.org is done correctly, as per the earlier snippet i shared

#

but hub.revengine-test.org, is not

#

so you'd want to delete and register the domain via the earlier snippet for hub.revengine-test.org

somber stag
#

Where are you getting newsrevenuehub.revengine.org from?

#

That's our prod server, but I'm trying to understand how/where you see that that's properly configured, but hub.revengine-test.org is not

tame flicker
#

i have access to some internal tools to validate that

somber stag
#

According to my server logs, we registered hub.revengine-test.org at 18:56 (UTC) today, and as best i can tell it was using correct signature

#

stripe.ApplePayDomain.create(
api_key=settings.STRIPE_LIVE_SECRET_KEY,
domain_name=f"{self.slug}.{settings.DOMAIN_APEX}",
stripe_account=self.payment_provider.stripe_account_id,
)

#

The domain name has to do with how we auto-generate subdomain names for connected accounts that use our service

#

and the value we're passing for stripe account is the value we get from the connected account

#

So in this case, acct_1KPCZOCx6MKztsJa

#

(excuse the lack of formatting -- i don't know the ins and outs of discord code snippet formatting just yet ...)

tame flicker
#

np, it's 3 backticks at the beginning and end of the code snippet

somber stag
#

oh just like GitHub. ๐Ÿ‘

tame flicker
#

i don't really know what went wrong along the way when the registration was done, but how about deleting that domain on the connected account and registering again?

somber stag
#

So via stripe.ApplePayDomain.delete?

tame flicker
#

yup, try that

somber stag
#

Hmmm... I get this error:

#
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/stripe/util.py", line 267, in _wrapper
    return class_method(*args, **kwargs)
TypeError: DeletableAPIResource._cls_delete() missing 1 required positional argument: 'sid'
tame flicker
#

๐Ÿค”

somber stag
#

called with api_key and stripe_account params

#
>>> inspect.signature(stripe.ApplePayDomain.create)
<Signature (api_key=None, idempotency_key=None, stripe_version=None, stripe_account=None, **params)>
#

doesn't seem like sid is a required param ๐Ÿคท

tame flicker
#

are you alright to run it using curl instead?

somber stag
#

sure

tame flicker
#

onesec, let me put it together

somber stag
#

๐Ÿ‘

tame flicker
#
curl https://api.stripe.com/v1/apple_pay/domains/apwc_... \
  -u sk_live_...: \
  -H Stripe-Account:acct_ \
  -X DELETE 
#

do you have the id of that domain on hand?

somber stag
#

just got it done with Python

#

the deletion

#

let me try to recreate

#

*reregister

tame flicker
#

i still see the old registration there though ๐Ÿค” i.e. it doesn't seem to have been deleted from acct_1KPCZOCx6MKztsJa

somber stag
#
>>> stripe.ApplePayDomain.delete('apwc_1LkuAsBMAMOLTEakOdtClzet', api_key=settings.STRIPE_LIVE_SECRET_KEY)
INFO stripe:63 - message='Request to Stripe api' method=delete path=https://api.stripe.com/v1/apple_pay/domains/apwc_1LkuAsBMAMOLTEakOdtClzet
INFO stripe:63 - message='Stripe API response' path=https://api.stripe.com/v1/apple_pay/domains/apwc_1LkuAsBMAMOLTEakOdtClzet response_code=200
<ApplePayDomain apple_pay_domain id=apwc_1LkuAsBMAMOLTEakOdtClzet at 0x7fe5057ed170> JSON: {
  "deleted": true,
  "id": "apwc_1LkuAsBMAMOLTEakOdtClzet",
  "object": "apple_pay_domain"
}
>>> stripe.ApplePayDomain.create(api_key=settings.STRIPE_LIVE_SECRET_KEY, domain_name="hub.revengine-test.org", stripe_account="acct_1KPCZOCx6MKztsJa")
INFO stripe:63 - message='Request to Stripe api' method=post path=https://api.stripe.com/v1/apple_pay/domains
INFO stripe:63 - message='Stripe API response' path=https://api.stripe.com/v1/apple_pay/domains response_code=200
<ApplePayDomain apple_pay_domain id=apwc_1Lku7ICx6MKztsJaqEiMVdov at 0x7fe5056816c0> JSON: {
  "created": 1663871240,
  "domain_name": "hub.revengine-test.org",
  "id": "apwc_1Lku7ICx6MKztsJaqEiMVdov",
  "livemode": true,
  "object": "apple_pay_domain"
}
#

Interesting. Deletion seems successful from logs.

tame flicker
#

onesec, let me take a closer look at this domain on the connected account

somber stag
#

๐Ÿ‘

tame flicker
#

hmmm, sorry, but can you delete it again and create it using curl?

somber stag
#

yes

#

actually, i can't delete cause it doesn't show up when i list

#

should i use the same ID as before from Python -- apwc_1LkuAsBMAMOLTEakOdtClzet ?

tame flicker
#

the created domain is apwc_1Lku7ICx6MKztsJaqEiMVdov

#

are you listing it using the Stripe-Account header too?

somber stag
#

was via stripe.ApplePayDomain.list() (python)

tame flicker
#

you need to use the Stripe-Account header. If you don't define that, it'll list the domains on the platform account

somber stag
#

What's the Stripe Account header?

#

oh i see, for curl

#

I'm passing stripe_account to stripe.ApplePayDomain.list(), which would seem to be the counterpart for curl's header.

tame flicker
#

and you're not seeing apwc_1Lku7ICx6MKztsJaqEiMVdov?

somber stag
#

Oh, actually I may be blocked at this point. It's asking for host password for the sk_live i provide

tame flicker
#

i think your cURL command is probably missing the colon for the key

somber stag
#

I used to see apwc_1Lku7ICx6MKztsJaqEiMVdov when I listed via Python, but now I don't (after the seemingly successful deletion log message)

tame flicker
#

-u sk_live_...: \

#

sometimes when i miss that out or my cURL command is formatted incorrectly, it asks for the password too

somber stag
#

that was it!

#

okay, yes i see that id now

tame flicker
#

great! delete it. Recreate it using cURL too

somber stag
#

weird. why does it appear with curl but not Python!?

tame flicker
#

hmmm, let me go hunt down the code for creating Apple Pay domains in our SDK. in the meantime, let me know once you're done creating it in cURL and i'll take a look

somber stag
#

Was able to recreate via curl and now it appears on page!

tame flicker
#

whew

somber stag
#

hah

tame flicker
#

alright, so i think you may want to relook at your code, to make sure it's really passing in the Stripe Account header when registering the domain on the connected account

#

and maybe also make sure you're using the correct secret key

#

while rare, it's entirely possible that you're using the secret key of the connected account instead

somber stag
#

Possible. I don't know how the keys I'm using got generated, and this is a weird case where we're using our own org as a connected account. I think it's a separate Stripe account, but it's possible there was copy pasta setting up.

tame flicker
#

at least you can do a quick fix using curl to move on with development first ๐Ÿ˜†

somber stag
#

So Apple Pay loads and i can submit now, but my app hangs. Will have to investigate that.

tame flicker
#

let me know if you need help

somber stag
#

So looks like there's a promise rejection after submitting, paying with apple pay

#
Unhandled Promise Rejection: Error: Missing argument for: amount
#

Okay, this may be an error on our server where we're creating payment intent

#

happens with cc too

#

ok. well this is progress. thanks for your help.

tame flicker
#

do you need me to help take a look at your PaymentIntent? if you paste the id here, i can take a look

somber stag
#

no i should be good. actually think it's a react problem on our end, on further inspection

tame flicker
#

alrighty! feel free to reach out again if you need help ๐Ÿ˜„