#benjamineugenewhite
1 messages ยท Page 1 of 1 (latest)
hello! do you have a link to your test site which i can access?
Yes. One sec.
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
I don't see in upper right corner, but i see it in /settings/user under Accounts section
acct_1ASCSHBMAMOLTEak
hmmm, are you passing in StripeAccount when initializing stripe.js? https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
if you are, you should remove it
So we initialize using load_stripe here:
const stripePromise = useRef(loadStripe(HUB_STRIPE_API_PUB_KEY, { stripeAccount }));
you should definitely remove this { stripeAccount }
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?
Not sure how registration initially went down, but I'll consult with team tomorrow.
the next step here is to delete the hub.revengine-test.org domain on the connected account, and register it using the API - using the platform's secret key and Stripe-Account header
like how it's shown here : https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-using-with-connect
the second sample code in that section
just to confirm, you're doing direct charges with Connect right?
Believe so re: direct charges, but help me understand what exactly that means here.
direct charges - https://stripe.com/docs/connect/direct-charges. You'll create a charge on the connected account (using your platform's secret key and the Stripe-Account header)
Yes, that's correct, that's what we're doing.
And re: registering, we're doing as indicated in earlier snippet you shared
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
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
i have access to some internal tools to validate that
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 ...)
np, it's 3 backticks at the beginning and end of the code snippet
oh just like GitHub. ๐
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?
So via stripe.ApplePayDomain.delete?
yup, try that
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'
๐ค
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 ๐คท
are you alright to run it using curl instead?
sure
onesec, let me put it together
๐
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?
i still see the old registration there though ๐ค i.e. it doesn't seem to have been deleted from acct_1KPCZOCx6MKztsJa
>>> 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.
onesec, let me take a closer look at this domain on the connected account
๐
hmmm, sorry, but can you delete it again and create it using curl?
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 ?
the created domain is apwc_1Lku7ICx6MKztsJaqEiMVdov
are you listing it using the Stripe-Account header too?
was via stripe.ApplePayDomain.list() (python)
you need to use the Stripe-Account header. If you don't define that, it'll list the domains on the platform account
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.
and you're not seeing apwc_1Lku7ICx6MKztsJaqEiMVdov?
Oh, actually I may be blocked at this point. It's asking for host password for the sk_live i provide
i think your cURL command is probably missing the colon for the key
I used to see apwc_1Lku7ICx6MKztsJaqEiMVdov when I listed via Python, but now I don't (after the seemingly successful deletion log message)
-u sk_live_...: \
sometimes when i miss that out or my cURL command is formatted incorrectly, it asks for the password too
great! delete it. Recreate it using cURL too
weird. why does it appear with curl but not Python!?
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
Was able to recreate via curl and now it appears on page!
whew
hah
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
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.
at least you can do a quick fix using curl to move on with development first ๐
So Apple Pay loads and i can submit now, but my app hangs. Will have to investigate that.
let me know if you need help
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.
do you need me to help take a look at your PaymentIntent? if you paste the id here, i can take a look
no i should be good. actually think it's a react problem on our end, on further inspection
alrighty! feel free to reach out again if you need help ๐