我正在尝试将订阅集成到我的平台,但我没有得到它......
发送表单时出错:
任何数据都不正确 检查一下,然后再试一次。
付款网关是:“MercadoPago”
这是我的GemFile:
...
gem 'mercadopago-sdk', '~> 0.3.4'
...
我使用以下方法:
require 'mercadopago.rb'
...
def pricing
mp = MercadoPago.new('1607128004788137', 'sq1fDz941LqsEj3jYcJgESLYvvkH0Fs3')
mp.sandbox_mode(true)
preapprovalPayment_data = Hash[
"payer_email" => "carpintinimatias@gmail.com",
"back_url" => "http://www.diabecarp.com",
"reason" => "Suscripción PREMIUM - Diabecarp",
"external_reference" => "OP-1234",
"site_id" => "MLA",
"auto_recurring" => Hash[
"frequency" => 1,
"frequency_type" => "months",
"transaction_amount" => 79.99,
"currency_id" => "ARS",
]
]
preapprovalPayment = mp.create_preapproval_payment(preapprovalPayment_data)
@subscription_link = preapprovalPayment['response']['sandbox_init_point']
end
在前端我有以下按钮:
=link_to "Suscribirse", @subscription_link, class:"pricing-button is-featured", name:"MP-Checkout"
%script{src:"https://www.mercadopago.com/org-img/jsapi/mptools/buttons/render.js"}