2

authorize.net で開発者アカウントを作成し、activemerchant を介して顧客プロファイルを作成しようとしています。

> GATEWAY.create_customer_profile(:profile => { :merchant_customer_id => "123foobar", :email => "lol@lol.com" })

#<ActiveMerchant::Billing::Response:0x007fc3a2663e20 @params={"messages"=>
{"result_code"=>"Error", "message"=>{"code"=>"E00007", "text"=>"User authentication failed 
due to invalid authentication values."}}}, @message="User authentication failed due to 
invalid authentication values.", @success=false, @test=false, @authorization=nil, 
@fraud_review=nil,
@avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil},
@cvv_result={"code"=>nil, "message"=>nil}> 

そのエラーコードを調べたところ、次のように書かれています:

API Error Code: E00007
Error Code Text: User authentication failed due to invalid authentication values.
Description: The name/and or transaction key is invalid.
Other Tips: Try switching between production and developer test URL's. The test URL     
requires a separate developer test account, which can be set up by filling out the following form: http://developer.authorize.net/testaccount.

念のため、API ログイン キーを確認しました。ゲートウェイ オブジェクトを調べると、ログイン (API ログイン キー)、パスワード (トランザクション キー)、および :test => true が表示されます。

誰が契約が何であるか教えてもらえますか?


アップデート

したがって、問題がauthorize.netにあることを完全に確認するのが最善であると判断しました---結局のところ、そうではありません..curlを介してリクエストを行うと、成功します:

    curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X POST -d '<?xml version="1.0" encoding="utf-8"?>
    <createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
      <merchantAuthentication>
        <name>myTestLogin</name>
        <transactionKey>myTransactionKey</transactionKey>
      </merchantAuthentication>
      <profile>
        <merchantCustomerId>custId123</merchantCustomerId>
        <description>some description</description>
        <email>foo@bar.com</email>
      </profile>
    </createCustomerProfileRequest>' https://apitest.authorize.net/xml/v1/request.api


      <?xml version="1.0" encoding="utf-8"?><createCustomerProfileResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><customerProfileId>10521778</customerProfileId><customerPaymentProfileIdList /><customerShippingAddressIdList /><validationDirectResponseList /></createCustomerProfileResponse>

...

つまり、これは問題が ActiveMerchant にあることを意味します.... Activemerchant を介してライブの実世界のアカウントで問題なく顧客プロファイルを作成できますが、何らかの理由で、開発者のテスト アカウントでは作成できません。 ..

私が疑わしいことが1つあります:

ゲートウェイがテストモードであると言っているにもかかわらず: 1.9.3p194 :007 > GATEWAY => #, :password=>, :test=>true}>

実際にテストモードであるかどうかを問い合わせると、予期しない応答が返されます........

1.9.3p194 :008 > GATEWAY.test?
 => false 

うーん…

4

1 に答える 1

0

テストモードと設定testtrue別物です。アカウントがテスト モードの場合は、設定testするfalseか、まったく送信しないでください。

さらに良いことに、アプリケーションを開発中の場合は、Authorize.Netで開発者アカウントにサインアップする必要があります。そうすれば、開発者アカウントは基本的に常にテスト モードであるため、テスト モードやパラメーターを扱う必要はありません。それらは本番アカウントのように機能しますが、実際には支払いを処理しません。これにより、開発がより簡単かつ安全になります。

于 2012-11-10T03:00:36.627 に答える