checkout-single-subscription icon indicating copy to clipboard operation
checkout-single-subscription copied to clipboard

Readme intro - error with prices create commant

Open SuperRoach opened this issue 1 year ago • 1 comments

Bug report

Describe the bug

The stock command in the readme.md gives an error: Missing required param: Currency

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository: Follow the readme.md , Using Node although it would be the same for others.

When you are up to this part:

./stripe prices create
  -d "product=ID_OF_BASIC_PRODUCT"
  -d "unit_amount=1800"
  -d "currency=usd"
  -d "recurring[interval]=month"

After substituting in your ID, you'll get this error:

  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: currency.",
    "param": "currency",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_DizJci51DGcUB5?t=1685198228",
    "type": "invalid_request_error"
  }
}

Expected behavior

That the price is created, without you having to go in the GUI and do it.

SuperRoach avatar May 27 '23 14:05 SuperRoach

I could reproduce this error by this command on the readme.md on https://github.com/stripe-samples/checkout-single-subscription/tree/main?tab=readme-ov-file#how-to-run-locally .

$ stripe prices create
  -d "product=ID_OF_BASIC_PRODUCT"
  -d "unit_amount=1800"
  -d "currency=usd"
  -d "recurring[interval]=month"

Error message;

{
  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: currency.",
    "param": "currency",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_TNSUukHrIH9fVP?t=1708499436",
    "type": "invalid_request_error"
  }
}

It appears that the issue is due to the command not containing a newline key (\).

$ stripe prices create \
  -d "product=ID_OF_BASIC_PRODUCT" \
  -d "unit_amount=1800" \
  -d "currency=usd" \
  -d "recurring[interval]=month"

hideokamoto-stripe avatar Feb 21 '24 07:02 hideokamoto-stripe