plaid / plaid-ruby

Ruby bindings for Plaid

Home Page:https://plaid.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't Access Stripe Token via Generic Processor Endpoint

adimitri opened this issue · comments

On plaid gem v8.5.0, I've tried to use the new generic processor endpoint to create a stripe token. A response gets returned from the server and I can see the token when I inspect the variable. However, I'm unable to get the token from the available processor_token method, which just returns nil.

plaid_client = Plaid::Client.new(...)

 processor_token_response = plaid_client
  .processor
  .processor_token
  .create(access_token, plaid_account_id, 'stripe')
  # => #<Plaid::ProcessorTokenResponse request_id="<request_id>" stripe_bank_account_token="btok_<token>">

processor_token_response.processor_token # => nil

processor_token_response.stripe_bank_account_token
# NoMethodError: undefined method `stripe_bank_account_token' for #<Plaid::ProcessorTokenResponse:0x00007fcb33b35af0>

I think the ProcessorTokenResponse class needs a property definition for that method call. The other processors should be unaffected since they all rely on the same processor_token key in the response. It’s just Stripe that is unique it seems.

hi @adimitri,

thank you for raising this issue. I have confirmed that this is indeed a problem. It is trying to coerce the stripe response into the ProcessorTokenResponse, when they in fact have different fields.

I've put this on our backlog to fix. Thank you for your patience

commented

The client libraries have been re-released and in them the Stripe specific endpoint now needs to be used to generate Stripe tokens; we are no longer trying to support using the generic endpoint for Stripe. Closing this as a result.