Tôi đã cố gắng triển khai cổng thanh toán paypal.Lỗi PayPal: Giao dịch này không hợp lệ. Vui lòng quay lại trang web của người nhận để hoàn tất giao dịch của bạn bằng cách sử dụng quy trình thanh toán thông thường của họ
Nhưng tôi nhận được một lỗi:
This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow.
Trong Gem tập
gem 'activemerchant', :require => 'active_merchant'
Trong development.rb
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
paypal_options = {
:login => "************",
:password => "************",
:signature => "************",
}
::STANDARD_GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(paypal_options)
::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options)
end
Mẫu mã Tôi đang sử dụng trong m y điều khiển
response = EXPRESS_GATEWAY.setup_purchase(10000,
:ip => request.remote_ip,
:return_url => new_order_url,
:cancel_return_url => orders_url
)
p response
p response.token
redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)
O/p cho phản ứng:
#<ActiveMerchant::Billing::PaypalExpressResponse:0x007f90bbababa0 @params={"timestamp"=>"2011-12-17T21:41:21Z", "ack"=>"Failure", "correlation_id"=>"c152e1862f475", "version"=>"62.0", "build"=>"2271164", "message"=>"Security header is not valid", "error_codes"=>"10002", "Timestamp"=>"2011-12-17T21:41:21Z", "Ack"=>"Failure", "CorrelationID"=>"c152e1862f475", "Errors"=>{"ShortMessage"=>"Security error", "LongMessage"=>"Security header is not valid", "ErrorCode"=>"10002", "SeverityCode"=>"Error"}, "Version"=>"62.0", "Build"=>"2271164"}, @message="Security header is not valid", @success=false, @test=true, @authorization=nil, @fraud_review=false, @avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil}, @cvv_result={"code"=>nil, "message"=>nil}>
o/p cho response.token
nil
Vì vậy, tôi nghĩ rằng vấn đề response.token là con số không
bất kỳ đề xuất nào tại sao điều này xảy ra?
tôi đã nhận nó .. và nó làm việc .. nhờ một anh chàng rất nhiều .. u tiết kiệm thời gian ass lớn của tôi. .. tình yêu u soo nhiều .. Trao tặng tiền thưởng .. bỏ phiếu lên .. accpeted câu trả lời .. bây giờ u có thể bình luận .. bỏ phiếu lên .. bỏ phiếu xuống .. và nhiều hơn nữa .. thnks rất nhiều anh chàng .. –
Awsome, vui vì tôi có thể giúp đỡ và các điểm được chào đón vì vậy tôi tham gia nhiều hơn. Chúc mừng. – slarti42uk