LibreHealthIO / lh-ehr-fhir-api

FHIR API to LibreEHR Package for Laravel
MIT License
12 stars 6 forks source link

put special case for when token is provided on update (change CC) #74

Open kchapple opened 8 years ago

kchapple commented 8 years ago

When patient is updated, and there is a stripe token passed, need to update customer

Leo24 commented 8 years ago

Tested updating Patient [base]/fhir/Patient/85 PUT request with new Stripe token, so Customer ID updates in Database. Is it that we need in this "bug"? If not - could you please give me more detailed explanation.

kchapple commented 8 years ago

@Leo24 We shouldn't change the customer ID. Is it possible to just update the Customer's Credit Card information using a new token, we shouldn't have to create a new customer entirely. Maybe I'm misunderstanding how the Stripe Customer update works.

kchapple commented 8 years ago

@Leo24 check out the update-customer documentation https://stripe.com/docs/api?lang=php

When we get a new token, we need to update the "source" parameter with the new token so that the new card becomes the active source.

Leo24 commented 8 years ago

Add check if customer exist - update source data Remove extra set of patient id. Сauses updating wrong patient. https://github.com/LibreEHR/fhir/pull/83