We've moved discussions to Discord

Stripe Checkout does not process

I set up the Stripe account and the payment plan.  When I try the checkout, I got this message

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://js.stripe.com') does not match the recipient window's origin ('https://fg.letsapp.cloud').

How to set the recipient window ? Do I miss anything ?

After I set up the endpoint with checkout, I got this message

ActionController::InvalidAuthenticityToken in SubscriptionsController#create


        def handle_unverified_request
          raise ActionController::InvalidAuthenticityToken
        end
      end
    end

Thanks in advance.
Chris Oliver
You can ignore the Stripe message. They have confirmed it's a benign error you can ignore. https://github.com/stripe/react-stripe-elements/issues/98#issuecomment-333666816

As for your invalid authenticity token, sounds like the CSRF token was not sent.
It is strange that it works in local development, but not in the production server ?! The Request POST body are exactly the same in both environments.

The Stripe error log is:

{
  "expand": {
    "0": "pending_setup_intent",
    "1": "latest_invoice.payment_intent"
  },
  "items": {
    "0": {
      "plan": " plan_GPIuM1vUCPBV70"
    }
  },
  "off_session": "true",
  "trial_from_plan": "true"
}

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such plan: plan_GPIuM1vUCPBV70",
    "param": "plan",
    "type": "invalid_request_error"
  }
}

The plan ID should be fine (double checked). 
Chris Oliver
Sounds like it's your plan ID given that the message is:     "message": "No such plan: plan_GPIuM1vUCPBV70",

If you defined that plan on Stripe when in "test" mode, it's not going to exist when running your app in production mode.   

Stripe test mode == Rails Development
Stripe Produduction == Rails Production

Each have their own set of products and plans.
Chris Oliver
👆
Thanks... will try.

Tyler Smart
Yeah, I"m running in dev mode, the stripe plan is in test, and I still can't see it. When I click on the plan from the jumpstart admin, it tries to show me the plan as if it were a production plan, but it's not. It picks up the stripe credentials in dev, just apparently looks for a stripe plan in prod.
Tyler Smart
That is, the plan is available at /test/plans, but the "View on stripe" button points to just /plans on stripe.

Edit: /plans is hardcoded.

Edit #2: Nevermind, I was using the product ID not the Subscription/Plan ID. Stripe noob!
Bryan Stewart
Had the same thing Tyler, LOL
Notifications
You’re not receiving notifications from this thread.