始めましょう
復元力のある統合を保証するために、
ヘッダーの設定
ヘッダーの設定は、APIリクエストの重要な部分です。ヘッダーは、APIリクエストに関連付けられたメタデータを表します。
Authorization: {your_credentials}
Content-Type: application/vnd.worldpay.pay-direct-v1+json
Accept: application/vnd.worldpay.pay-direct-v1+json
Authorization: {your_credentials} Content-Type: application/vnd.worldpay.pay-direct-v1+json Accept: application/vnd.worldpay.pay-direct-v1+json
ヘッダー | 説明 |
---|---|
Authorization | Authorization ヘッダーでAccess Worldpay内でユーザーを識別および認証します。TLSを介した顧客証明書認証を使用する場合を除き、APM APIに送信するリクエストにはAuthorization ヘッダーを使用しなければなりません。ヘッダーを使用する必要がある場合は、 |
Content-Type | 送信するリクエストにリクエスト本文が含まれている場合、HTTP方法がPOST またはPUT の場合は、Content-Type ヘッダーが必要です。 |
Accept | Accept ヘッダーで使用するAPM APIのバージョンを識別します。APIに送信するリクエストにはAccept ヘッダーを使用しなければなりません。 |
Content-Type
とAccept
ヘッダーの両方を使用している場合は、それらが一致していなければなりません。
注記:{your_credentials}
をbase64でエンコードされた基本認証のユーザー名とパスワードに置き換えます。Access Worldpay認証情報を取得するには、実装マネージャーにお問い合わせください。
ルートリソースの照会
当社のAPIは、次に利用可能なアクションへのリンクを提供することでガイドします。
APIを検出して使用を開始するには、最初にルートリソースに照会を実行しなければなりません。これにより、Access Worldpay内で利用可能なリソースが返されます。
リクエスト
GET https://try.access.worldpay.com/
注記:このリクエストにはリクエスト本文は必要ありません。
応答
応答で利用可能なすべてのAPIリソースを受け取ります。
{
"_links": {
"payments:authorize": {
"href": "https://try.access.worldpay.com/payments/authorizations"
},
"service:payments": {
"href": "https://try.access.worldpay.com/payments"
},
"service:sessions": {
"href": "https://try.access.worldpay.com/sessions"
},
"service:tokens": {
"href": "https://try.access.worldpay.com/tokens"
},
"service:verifications/accounts": {
"href": "https://try.access.worldpay.com/verifications/accounts"
},
"service:verifications/customers/3ds": {
"href": "https://try.access.worldpay.com/verifications/customers/3ds"
},
"service:verifiedTokens": {
"href": "https://try.access.worldpay.com/verifiedTokens"
},
"service:fraudsight": {
"href": "https://try.access.worldpay.com/fraudsight"
},
"service:exemptions": {
"href": "https://try.access.worldpay.com/exemptions"
},
"service:payouts": {
"href": "https://try.access.worldpay.com/payouts"
},
"service:payments/alternative/direct": {
"href": "https://try.access.worldpay.com/payments/alternative/direct"
},
"service:payments/alternative/action/paypal": {
"href": "https://try.access.worldpay.com/payments/alternative/action/paypal"
},
"service:payments/alternative/action/ideal": {
"href": "https://try.access.worldpay.com/payments/alternative/action/ideal"
},
"service:payouts/accounts": {
"href": "https://try.access.worldpay.com/payouts/accounts"
},
"service:payouts/events": {
"href": "https://try.access.worldpay.com/payouts/events"
},
"service:moneyTransfers": {
"href": "https://try.access.worldpay.com/moneyTransfers"
},
"service:foreignExchange": {
"href": "https://try.access.worldpay.com/foreignExchange"
},
"service:accounts/statements": {
"href": "https://try.access.worldpay.com/accounts/statements"
},
"service:accounts/balance": {
"href": "https://try.access.worldpay.com/accounts/balance"
},
"service:accounts/transfer": {
"href": "https://try.access.worldpay.com/accounts/transfer"
},
"curies": [
{
"href": "https://try.access.worldpay.com/rels/payments/{rel}",
"name": "payments",
"templated": true
}
]
}
}
Access Worldpayに統合する場合は、アクションリンクからURIリソースリンクを取得することを強くお勧めします。URIリソースリンクをハードコーディングしないでください。統合が変更されたり、壊れたりする可能性があります。
アクションリンクとは何ですか?
アクションリンクは、リソースへのURIリンクが格納されているパラメータです。
URIリソースリンクとは何ですか?
URIリソースリンクは、リクエストの送信先のリソースへのリンクです。
Paydirectルートリソースの照会
ルートリソースのservice:payments/alternative/direct
アクションリンクを照会します。
リクエスト
GET https://try.access.worldpay.com/payments/alternative/direct
注記:このリクエストにはリクエスト本文は必要ありません。
応答
{
"_links": {
"resourceTree": {
"href": "https://try.access.worldpay.com/rels/payments/alternative/direct/resourceTree"
},
"direct:sale": {
"href": "https://try.access.worldpay.com/payments/alternative/direct/sale",
"templated": true
},
"direct:events": {
"href": "https://try.access.worldpay.com/payments/alternative/direct/events",
"templated": true
},
"curies": [
{
"name": "direct",
"href": "https://try.access.worldpay.com/rels/payments/alternative/direct/{rel}",
"templated": true
}
]
}
}
{ "_links": { "resourceTree": { "href": "https://try.access.worldpay.com/rels/payments/alternative/direct/resourceTree" }, "direct:sale": { "href": "https://try.access.worldpay.com/payments/alternative/direct/sale", "templated": true }, "direct:events": { "href": "https://try.access.worldpay.com/payments/alternative/direct/events", "templated": true }, "curies": [ { "name": "direct", "href": "https://try.access.worldpay.com/rels/payments/alternative/direct/{rel}", "templated": true } ] } }
リソース
応答には、販売リクエストへのリンクが含まれています。
アクションリンク(リソース) | 説明 |
---|---|
Direct:sale | 販売リクエストのアクションリンク |
支払照会リクエスト |
DNSホワイトリスト
次のURLをホワイトリストに登録します。
https://try.access.worldpay.com/
https://access.worldpay.com/
明示的なIPホワイトリストではなく、DNSホワイトリストを使用していることを確認してください。
リンクキャッシング
Access Worldpay内でリクエストを行う場合は、返された応答を常にキャッシュしなければなりません。
次の手順