2017-01-16 7 views
1

masterpass Api Partner walletを統合しようとしていますが、OAuth署名を適用する方法についての正確な文書はありません。手伝ってくれませんか?Masterpass API Partner wallet ServicesにOAuth署名を適用する方法は?

+0

ようこそ!本、ツール、ソフトウェアライブラリ、チュートリアル、またはその他のオフサイトリソースを推薦するか、見つけようとする質問は、批判的な回答と迷惑メールを引き付ける傾向があるため、スタックオーバーフローのトピックではありません。代わりに、[問題を説明する](http://meta.stackoverflow.com/questions/254393)、これを解決するためにこれまでに何が行われているか。 –

答えて

0

私は署名を適用するために使用方法がされた:

私はMavenのリポジトリで利用可能なmasterpass商人APIを、次のとおりです。

<dependency> 
     <groupId>com.mastercard.masterpass.merchant</groupId> 
     <artifactId>mastercard-masterpass-merchant</artifactId> 
     <version>1.0.0</version> 
    </dependency> 

次にあなたがApiConfigをロードし、秘密鍵を設定する必要があり、公開鍵、ホストポイント、および環境が含まれます。

ApiConfig apiConfig = null; 
try { 
apiConfig = new ApiConfigBuilder() 
    .consumerKey(MASTERPASS_CONSUMER_KEY) 
    .privateKey(MASTERPASS_PRIVATE_KEY) 
    .hostUrl(MASTERPASS_HOST) 
    .name(MASTERPASSS_ENVIRONMENT).build(); 
} catch (Exception e) { 
    logger.error("[Error]Error loading masterpass Api Config: {}", e.getMessage()); 
} 

あなたはこれらを設定した後、今あなたがApiClientフォームmasterpassライブラリを呼び出すことができますスタックオーバーフローへ

ApiClient client = new ApiClient(apiConf); 

ServiceRequest<?> request = new ServiceRequest<>(); 

request.contentType(MediaType.APPLICATION_XML); 
request.requestBody(shippingAddressRequest); 

ShippingAddressVerificationResponse response = null; 
try { 
    response = client.call(masterpassEndpoint, request, HttpMethod.POST , ShippingAddressVerificationResponse.class); 
} catch (Exception e) { 
    logger.error("[Error]ShippingAddressVerificationResponse]"+ 
    "Error: There was an exception validating the shipping address: {}", e.getMessage() , e); 
} 
関連する問題