mollie / mollie-api-node

Official Mollie API client for Node
http://www.mollie.com
BSD 3-Clause "New" or "Revised" License
237 stars 63 forks source link

Missing subscriptionId #23

Closed azachar closed 7 years ago

azachar commented 7 years ago

Hi there, I am experiencing very strange behavior with your version "mollie-api-node": "=1.3.1"

I have a customer that has already the valid mandate, subscribing to a new subscription. Hover the received payment is not containing any subscriptionId, so I am unable to look it up. Moreover, if I miss this payment notification, is there any other way to proactively check if the subscription is paid? I do not want to rely only on your hook only.

Here is the log

The first is the subscription I made and later on is the payment that I've received via webhook for that subscription.

Subscription {
  resource: 'subscription',
  id: 'sub_MzERSTKSNr',
  customerId: 'cst_pVmdd6e5Ce',
  mode: 'test',
  createdDatetime: '2016-12-14T14:16:51.0Z',
  status: 'active',
  amount: '19.90',
  times: null,
  interval: '1 month',
  description: 'Personal Unlimited Monthly reprehenderit quis Lorem plan',
  method: null,
  cancelledDatetime: null }

Payment {
  resource: 'payment',
  id: 'tr_qj4PJrh4Qm',
  mode: 'test',
  amount: '19.90',
  amountRefunded: '0.00',
  amountRemaining: '19.90',
  description: 'Personal Unlimited Monthly reprehenderit quis Lorem plan 2016-12-14',
  method: 'creditcard',
  status: 'paid',
  createdDatetime: '2016-12-14T14:20:01.0Z',
  paidDatetime: '2016-12-14T14:20:07.0Z',
  cancelledDatetime: undefined,
  expiredDatetime: undefined,
  expiryPeriod: undefined,
  metadata: null,
  details: 
   { cardNumber: '6787',
     cardHolder: 'T. TEST',
     cardAudience: 'consumer',
     cardLabel: 'Mastercard',
     cardCountry: 'Netherlands',
     cardCountryCode: 'NL',
     cardSecurity: 'normal',
     feeRegion: 'other' },
  locale: undefined,
  profileId: 'pfl_hz97u6A7AK',
  customerId: 'cst_pVmdd6e5Ce',
  recurringType: 'recurring',
  mandateId: 'mdt_JEjB6hzDBs',
  settlementId: undefined,
  links: 
   { webhookUrl: 'xxxxx/payments/web-hook',
     redirectUrl: null } }

Also, it would be great if subscription would allow keeping metadata as the same as in payments.

Thank you for your help!

Best regards, Andrej

FaaPz commented 7 years ago

Hi @azachar, sorry for the delayed response. We've just released v1.3.5 (91cfef5f88c24f8383c9cb93866e8762ea0849a8) of our Mollie API client for Node and we highly recommend you updating to this latest version.

We'd also like to thank you for your suggestions! We'll look into your metadata request as well other ways of notifying Merchants once a Subscription has been paid.

azachar commented 7 years ago

Thank you, I will check your changings.