New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2
Accepted Solution

UCRM not correctly posting stripe subscription payment

Still having discrepancies with Stripe Subscriptions: (I'm in Sandbox mode & stripe test mode)

1) I set up a service for $250/mo

2) Set up a subscription payment on Stripe. Verified in both Stripe events & webhook for payment event that the $250 was charged successfully to the client.

3) No sign of payment showing up on UCRM (again, the webhook showed UCRM was successfully notified)

4) Added. a one-time payment via the stripe interface for $11. Again the webhook was executed successfully.

5) This time it showed up as a payment on UCRM

6) The "invoice hour" arrived, and a new invoice for $250 was created

7) It now shows a balance due of $239, but only the one-time payment... nothing from the subscription

 

Screen Shot 2019-03-06 at 8.38.11 PM.png
Screen Shot 2019-03-06 at 8.38.50 PM.png

Accepted Solutions
Highlighted
New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2

Re: UCRM not correctly posting stripe subscription payment

The problem I had was a webhook that was sent by stripe, but never processed by UCRM. Since we had just reset the database, it is possible it was related to being the first webhook? After that webhook started arriving normally.

 

the beauty and complexity of a stripe subscription is that stripe dictates the payment cycle and notifies ucrm with webhooks. UCRM has its own invoicing cycle daily. If all is working they stay in sync with webhooks. If for some reason UCRM stops responding, clients will still be billed, and you will still be paid.  I have used stripe subscriptions via Moonclerk for years, and it works really well!

View solution in original post


All Replies
New Member
Posts: 16
Registered: ‎05-01-2018

Re: UCRM not correctly posting stripe subscription payment

What is the difference between a service and subscription in UCRM. And why can clients pay with debit/credit card if they have a subscription but they can’t if they just have a service?  Also with a subscription it only allows them to pay with a debit/credit card. With service it just takes what credit they have on there account. 

Highlighted
New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2

Re: UCRM not correctly posting stripe subscription payment

The problem I had was a webhook that was sent by stripe, but never processed by UCRM. Since we had just reset the database, it is possible it was related to being the first webhook? After that webhook started arriving normally.

 

the beauty and complexity of a stripe subscription is that stripe dictates the payment cycle and notifies ucrm with webhooks. UCRM has its own invoicing cycle daily. If all is working they stay in sync with webhooks. If for some reason UCRM stops responding, clients will still be billed, and you will still be paid.  I have used stripe subscriptions via Moonclerk for years, and it works really well!

New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2

Re: UCRM not correctly posting stripe subscription payment

Back to webhook errors....

 

I setup and paid a subscription on UCRM with a credit-card (sandbox mode). 

 

Stripe shows 200 success, with this in its log:

{

  "id": "evt_1EEO3zFlLMTkTyaTkYT3lDpM",

  "object": "event",

  "api_version": "2019-02-19",

  "created": 1552687179,

  "data": {

    "object": {

      "id": "in_1EEO3yFlLMTkTyaThryGFN6c",

      "object": "invoice",

      "amount_due": 25000,

      "amount_paid": 25000,

      "amount_remaining": 0,

      "application_fee": null,

      "attempt_count": 1,

      "attempted": true,

      "auto_advance": false,

      "billing": "charge_automatically",

      "billing_reason": "subscription_create",

      "charge": "ch_1EEO3yFlLMTkTyaTN7p22oFL",

      "created": 1552687178,

      "currency": "usd",

      "custom_fields": null,

      "customer": "cus_EhnfhcYajYHZMw",

      "date": 1552687178,

      "default_source": null,

      "description": null,

      "discount": null,

      "due_date": null,

      "ending_balance": 0,

      "finalized_at": 1552687178,

      "footer": null,

      "hosted_invoice_url": "https://pay.stripe.com/invoice/invst_PKDi7fgnFMEq1AxLhN9DFe5zjO",

      "invoice_pdf": "https://pay.stripe.com/invoice/invst_PKDi7fgnFMEq1AxLhN9DFe5zjO/pdf",

      "lines": {

        "object": "list",

        "data": [

          {

            "id": "sli_2ececc7bf8bbe2",

            "object": "line_item",

            "amount": 25000,

            "currency": "usd",

            "description": "1 × $250.00 / 1 month - client103 Testing (at $250.00 / month)",

            "discountable": true,

            "livemode": false,

            "metadata": {

            },

            "period": {

              "end": 1555365578,

              "start": 1552687178

            },

            "plan": {

              "id": "ucrm_stripe_p8_1552687152",

              "object": "plan",

              "active": true,

              "aggregate_usage": null,

              "amount": 25000,

              "billing_scheme": "per_unit",

              "created": 1552687176,

              "currency": "usd",

              "interval": "month",

              "interval_count": 1,

              "livemode": false,

              "metadata": {

                "paymentPlanId": "8",

                "clientId": "10"

              },

              "nickname": null,

              "product": "prod_EhnfNxo4GB1oVc",

              "tiers": null,

              "tiers_mode": null,

              "transform_usage": null,

              "trial_period_days": null,

              "usage_type": "licensed"

            },

            "proration": false,

            "quantity": 1,

            "subscription": "sub_Ehnf83xIma8S31",

            "subscription_item": "si_EhnfrDD7rcxacq",

            "type": "subscription"

          }

        ],

        "has_more": false,

        "total_count": 1,

        "url": "/v1/invoices/in_1EEO3yFlLMTkTyaThryGFN6c/lines"

      },

      "livemode": false,

      "metadata": {

      },

      "next_payment_attempt": null,

      "number": "44B9DCF-0001",

      "paid": true,

      "period_end": 1552687178,

      "period_start": 1552687178,

      "receipt_number": null,

      "starting_balance": 0,

      "statement_descriptor": null,

      "status": "paid",

      "status_transitions": {

        "finalized_at": 1552687178,

        "marked_uncollectible_at": null,

        "paid_at": 1552687178,

        "voided_at": null

      },

      "subscription": "sub_Ehnf83xIma8S31",

      "subtotal": 25000,

      "tax": null,

      "tax_percent": null,

      "total": 25000,

      "webhooks_delivered_at": null

    }

  },

  "livemode": false,

  "pending_webhooks": 1,

  "request": {

    "id": "req_8j9bIFu7etVSVg",

    "idempotency_key": null

  },

  "type": "invoice.payment_succeeded"

}

 

 

UCRM prod.log shows:

 

[2019-03-15 14:59:39] request.INFO: Matched route "stripe_webhook". {"route":"stripe_webhook","route_parameters":{"_controller":"AppBundle\\Controller\\ClientZone\\OnlinePaymentController::stripeWebhookAction","id":"1","_route":"stripe_webhook"},"request_uri":"https://ucrm.kizawireless.com/online-payment/stripe-webhook/1","method":"POST"} []

 

[2019-03-15 14:59:39] security.INFO: Populated the TokenStorage with an anonymous Token. [] []

 

[2019-03-15 14:59:40] app.ERROR: Payment with ID "ch_1EEO3yFlLMTkTyaTN7p22oFL" does not belong to UCRM, ignoring. [] []

Ubiquiti Employee
Posts: 3,923
Registered: ‎12-10-2015
Kudos: 1380
Solutions: 299

Re: UCRM not correctly posting stripe subscription payment

Thanks for the log @DennyBoll
Can you please provide steps you did to reproduce this issue? Did you use the guide for testing the Stripe in sandbox mode?
New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2

Re: UCRM not correctly posting stripe subscription payment

1) added client

2) added UCRM service

3) paid for the subscription with Stripe dummy 4242 card

4) checked that I got 200 OK in stripe log

5) tail -f prod.log  shows the error

 

The webhook is setup per instructions (worked when I tested last week).  Sandbox mode.

 

As you can see, the token that stripe sent in the webhook was rejected by UCRM.

 

Denny

New Member
Posts: 17
Registered: ‎08-01-2015
Kudos: 1
Solutions: 2

Re: UCRM not correctly posting stripe subscription payment

Debugging again.  The key seems to be "Payment with ID xxx does not belong to UCRM".  What can cause that message in your code?