Zach Bluedorn
Zach Bluedorn

Reputation: 21

How to Set Up Braintree Marketplace Users with Rails?

I'm making a task website similar to Taskrabbit where users can post tasks they want completed and others can make an offer for how much they'd charge to complete the task.

I'd like to use Braintree Marketplace with Devise to create individual "merchant accounts" associated with each user, but I'm having trouble figuring out how to make each user a merchant once the user has signed up.

Braintree has a "merchant create" action:

result = Braintree::MerchantAccount.create(merchant_account_params)

but I'm not sure what to do with it.

I have a Transactions controller for Braintree transactions, but that doesn't seem like the place to set up merchants. Would I need another controller? Or can I make a method in my User model to verify their account so they can receive money?

Any help would be greatly appreciated!

Thanks, Zach

Upvotes: 1

Views: 237

Answers (1)

pblesi
pblesi

Reputation: 534

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact our support team.

As outlined in our Marketplace guide there are 3 steps to set up a sub merchant and have them start transacting. They are:

  1. Creating the Sub-merchant
  2. Confirming the Sub-merchant
  3. Transacting with the Sub-merchant

Once the sub-merchant has been created/signed up, then the submerchant must be confirmed on Braintree's end. This process happens asynchronously and we notify you of the status via a webhook. To receive this webhook you need to set up an endpoint that we call into.

After the submerchant has been confirmed, then you can start transacting with the merchant by indicating the submerchant to associate with the transaction when the transaction is performed.

Upvotes: 1

Related Questions