stripe / stripe-terminal-ios

Stripe Terminal iOS SDK
https://stripe.com/docs/terminal/sdk/ios
Other
104 stars 64 forks source link

Direct creation of PaymentMethods for type 'card_present' is disallowed #44

Closed jacobrharris closed 5 years ago

jacobrharris commented 5 years ago

I've worked through the rc1 release doc, but now I'm getting this error when running -[SCPTerminal processPayment:completion:]:

Direct creation of PaymentMethods for type 'card_present' is disallowed

The error object looks like this:

<SCPProcessPaymentError: 0x2825ea040; requestId = req_F8aJfHnf2qPCws; code = 6000; paymentIntent = <SCPPaymentIntent: 0x2814424c0; amount = 100; currency = usd; created = 2019-04-24 17:38:06 +0000; charges = (
); metadata = {
}; status = requires_payment_method; stripeId = xxxxx>; requestError = Error Domain=com.stripe-terminal Code=9020 "Direct creation of PaymentMethods for type 'card_present' is disallowed." UserInfo={com.stripe-terminal:Message=Direct creation of PaymentMethods for type 'card_present' is disallowed., com.stripe-terminal:StripeAPIRequestId=req_F8aJfHnf2qPCws, com.stripe-terminal:StripeAPIPaymentIntent=<SCPPaymentIntent: 0x2814424c0; amount = 100; currency = usd; created = 2019-04-24 17:38:06 +0000; charges = (
); metadata = {
}; status = requires_payment_method; stripeId = xxxxx>, com.stripe-terminal:StripeAPIErrorType=invalid_request_error, com.stripe-terminal:HttpStatusCode=400, NSLocalizedDescription=Direct creation of PaymentMethods for type 'card_present' is disallowed.}>

I'm using the Stripe Point of Sale test card fwiw.

twelvearrays commented 5 years ago

I am getting this error also, but only when I am trying to use a Connect account and using the stripe_account option on the connectionsTokens.create method. Are you using a Connect account?

jacobrharris commented 5 years ago

@twelvearrays We are using Connect, but we've always been using Connect. We used to be able to charge cards left and right.

bg-stripe commented 5 years ago

Thanks for reporting this! We've got a fix going out soon (should be fixed if you try again in ~an hour) – sorry for the inconvenience!

jacobrharris commented 5 years ago

This seems to be fixed. Thanks!

suvarnaratna commented 5 years ago

Hi, facing same issue. Can you please tell me how to add "stripeAccount" header from client side.

twelvearrays commented 5 years ago

With the Node SDK this is how I added the header token when creating the connection token.

const token = await stripe.terminal.connectionTokens.create({ stripe_account: stripeAccount })

This is was on an express endpoint that the app called to get the token.

Also another example of when I created a payment intent: const paymentIntent = await stripe.paymentIntents.create( { amount: amount, currency: 'usd', payment_method_types: [paymentMethodType], capture_method: 'manual' }, { stripe_account: stripeAcctId } )

jd-stripe commented 5 years ago

Thanks for helping out @twelvearrays!

@suvarnaratna Hopefully your question is answered about client side usage of the header. We also have a set of docs on server side usage which may be of assistance in your integration [0].

[0] https://stripe.com/docs/connect/authentication#stripe-account-header