code_corps v0.0.1 CodeCorps.StripeService.StripePlatformCustomerService View Source

Used to perform actions on StripePlatformCustomer records while propagating to and from associated Stripe.Customer records.

Link to this section Summary

Functions

Updates a CodeCorps.StripePlatformCustomer local and associated %Stripe.Customer{} API record with provided attributes

Updates a CodeCorps.StripePlatformCustomer local record using %Stripe.Customer{} API record retrieved from API using the provided Stripe ID

Link to this section Functions

Link to this function update(customer, attributes) View Source

Updates a CodeCorps.StripePlatformCustomer local and associated %Stripe.Customer{} API record with provided attributes

Returns

  • {:ok, %CodeCorps.StriePlatformCustomer{}, %Stripe.Customer{}} if everything was updated
  • {:error, %Ecto.Changeset{}} -if there was a validation issue while updating the local record
  • {:error, %Stripe.Error{}} - if there was a problem with updating the API record
  • {:error, :unhandled} -if something unexpected went wrong
Link to this function update_from_stripe(id_from_stripe) View Source

Updates a CodeCorps.StripePlatformCustomer local record using %Stripe.Customer{} API record retrieved from API using the provided Stripe ID

Returns

  • {:ok, %CodeCorps.StripePlatformCustomer{}} if the local record was updated
  • {:error, :not_found} - If there was no record witht he specified Stripe ID
  • {:error, %Ecto.Changeset{}} -if there was a validation issue while updating the local record
  • {:error, %Stripe.Error{}} - if there was a problem with retrieving the API record
  • {:error, :unhandled} -if something unexpected went wrong