LMS Development Company – Expert Moodle Developers Forums Moodle Stripe Payment Pro subscription without trial period getting 400 error on checkout

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #23384
    JasonL
    Participant

    i have a course with subscription but no trial period (0 days and enabled flag unchecked)
    – when user clicks pay it hangs on “PLEASE WAIT …”

    On stripe logs, i see 400 Bad Request about trial-end period must be 2 days ahead
    `
    POST /v1/checkout/sessions
    {
    “customer_email”: “xxx-redacted-xxx@email.com”,
    “line_items”: {
    “0”: {
    “price”: “price_1R5jFOFz6uncsxqlwl4UbLAe”,
    “quantity”: “1”
    },
    “1”: {
    “price”: “price_1R5jFOFz6uncsxql2rnq5Vtx”,
    “quantity”: “1”
    }
    },
    “metadata”: {
    “couponid”: “”,
    “instanceid”: “6”,
    “userid”: “3”
    },
    “mode”: “subscription”,
    “subscription_data”: {
    “trial_end”: “1742717696”
    },
    “success_url”: “https://xxx-redacted-xxx/enrol/stripepaymentpro/thankyou.php?session_id={CHECKOUT_SESSION_ID}”
    }
    `

    and stripe is replying
    `
    400 Bad Request
    {
    “error”: {
    “message”:
    “The trial_end date has to be at least 2 days in the future.”,
    “param”:
    “subscription_data[trial_end]”,
    “request_log_url”:
    https://dashboard.stripe.com/test/logs/req_1fRy0ZkqBUnbn4?t=1742717696”,
    “type”:
    “invalid_request_error”,
    },
    }
    `

    Is this a bug or misconfiguration on my end ?

    Appreciate your help thanks

    #23402
    dualcube
    Keymaster

    @JasonL, sorry to hear that you have faced this issue.

    However, we have tried to check this on our end, but didn’t face any issue. So can you please create a staging site and share the moodle admin access so we can check and assist you accordingly.

    While sharing the access, don’t forget to mark the reply as private.

    #23406
    JasonL
    Participant
    This reply has been marked as private.
    #23411
    JasonL
    Participant
    This reply has been marked as private.
    #23412
    dualcube
    Keymaster
    This reply has been marked as private.
    #23426
    dualcube
    Keymaster
    This reply has been marked as private.
    #23432
    JasonL
    Participant
    This reply has been marked as private.
    #23433
    JasonL
    Participant
    This reply has been marked as private.
    #23434
    JasonL
    Participant
    This reply has been marked as private.
    #23435
    dualcube
    Keymaster
    This reply has been marked as private.
    #23436
    dualcube
    Keymaster
    This reply has been marked as private.
    #23438
    JasonL
    Participant
    This reply has been marked as private.
    #23439
    JasonL
    Participant
    This reply has been marked as private.
    #23440
    JasonL
    Participant
    This reply has been marked as private.
    #23441
    dualcube
    Keymaster
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.