* Это очень специфично для active_merchant gem
Я пытаюсь создать новый платежный шлюз. Однако при выполнении удаленных тестов для моего платежного шлюза я сталкиваюсь с ошибкой: The SSL connection to the remote server could not be established
.
Был бы признателен, если бы была некоторая помощь в попытке выяснить, почему это так.
Мой код для моего платежного шлюза:
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class JReserveGateway < Gateway
self.test_url = 'https://test.j-reserve.com:10443/ros/settlement.php'
self.supported_countries = ['JPY']
self.default_currency = 'JPY'
self.supported_cardtypes = [:visa, :master, :american_express]
self.homepage_url = 'http://www.example.net/'
self.money_format = :cents
STANDARD_ERROR_CODE_MAPPING = {
# '101' => STANDARD_ERROR_CODE[:incorrect_number],
}
def initialize(options={})
requires!(options, :member_code)
super
end
def purchase(money, payment, options={})
post = {
"job" => "AUTH",
"member_code" => 9999999999,
"proposal_code" => "testCode1",
"card_brand" => "VISA",
"card_number" => 4111111111111111,
"expire_year" => 2019,
"expire_month" => 9,
"amount" => 1000,
"cancel_base_fee" => 100,
"sales_start" => "2020-07-01",
"sales_end" => "2020-07-02",
"customer_email" => "test@gmail.com",
"customer_name" => "kiong"
}
commit('COMMMIT', post)
end
private
def commit(action, parameters)
url = (test? ? test_url : live_url)
params = parameters.to_json
raw_response = ssl_post(url, params, request_headers)
response = parse(raw_response)
Response.new(
success_from(response),
message_from(response),
response,
authorization: authorization_from(response),
avs_result: AVSResult.new(code: response["some_avs_response_key"]),
cvv_result: CVVResult.new(response["some_cvv_response_key"]),
test: test?,
error_code: error_code_from(response)
)
end
def request_headers()
{
'Content-Type' => 'application/json',
}
end
end
end
end