如何在支付部门中集成支付网关

时间:2015-10-23 11:55:03

标签: ruby-on-rails-4 sharetribe

我是sharetribe的新手,我在我的应用程序中集成了sharetribe,现在我想在我的ruby应用程序中集成付款选项。我搜索了一下,但在我的管理员方面,没有付款选项。

如何在sharetribe中启用付款选项?

2 个答案:

答案 0 :(得分:2)

Sharetribe具有Stripe和PayPal集成。

但是您必须从admin启用,然后必须在数据库上添加一些插入。

**#设置PayPal网关

    INSERT INTO payment_settings SET active = 1, community_id = 1, payment_gateway = 'paypal', payment_process = 'preauthorize', commission_from_seller = 0, minimum_price_cents = 400, minimum_transaction_fee_cents = 0, confirmation_after_days = 14, created_at = NOW(), updated_at = NOW();

定义变量

 SET @username=(SELECT username FROM people LIMIT 1);

 SET @owner_email=(SELECT e.address from people p left join emails e on 

 (e.person_id=p.id) where p.username=@username);

 SET @merchant_account_id="[merchant_account_id]";

 SET @paypal_username="[paypal_username]";

 SET @paypal_app_id="APP-80W284485P519543T";


 UPDATE people set is_admin=1 where username=@username;

 INSERT INTO paypal_accounts (person_id, community_id, email, payer_id, 
 created_at, updated_at, active) VALUES (null, 1, @owner_email, 
 @merchant_account_id, NOW(), NOW(), 1);

 SET @paypal_account_id=(SELECT LAST_INSERT_ID());

 INSERT INTO billing_agreements (paypal_account_id, billing_agreement_id, created_at, updated_at, paypal_username_to, request_token) VALUES (@paypal_account_id, 'fake-agreement', NOW(), NOW(), @paypal_username, @paypal_app_id);

 INSERT INTO order_permissions (paypal_account_id, created_at, updated_at, request_token, paypal_username_to, scope, verification_code, onboarding_id, permissions_granted) VALUES (@paypal_account_id, NOW(), NOW(), 'fake-token', @paypal_username, null, null, null, 1);

  INSERT INTO transaction_processes (community_id, process, author_is_seller, created_at, updated_at) VALUES (1, 'preauthorize', 1, NOW(), NOW());

SET @ transaction_process_id =(选择LAST_INSERT_ID());

  UPDATE listing_shapes SET transaction_process_id=@transaction_process_id where name='selling';

  #if you have listings added before you should modify transaction_process_id in listing entries too**


http://publish.yexperiment.com/post/156715320289/sharetribe-with-paypal-payments-the-lost

这将对您有很大帮助。 干杯

答案 1 :(得分:1)

Sharetribe开源代码目前包含BrainTree支付集成的代码,但该代码不再由托管解决方案使用,也不会由核心团队更新,并且可能在将来被删除。

开源代码还包括与PayPal付款相关的代码,但该代码依赖于与Sharetribe核心团队和PayPal的特殊安排(以促进市场管理员入职),因此不能直接用于开源安装。

因此,Sharetribe开源代码可以提供的支付选项目前还不是很好。我们希望将来改善这种状况。

可在以下位置找到更多信息:http://support.sharetribe.com/knowledgebase/articles/577014(部分"付款")