Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 2.13 KB

payment-client.md

File metadata and controls

72 lines (53 loc) · 2.13 KB

Payment Client

PaymentClient deals with payment instruments and PCI data.

API Endpoint

This client is connected with https://api.expediagroup.com/supply/payments/graphql endpoint by default.

You can refer to the configuration document to explore the full configuration options.

Initialize the Client

const config: ClientConfiguration = {
   key: 'YOUR_API_KEY',
   secret: 'YOUR_API_SECRET'
};

const paymentClient = new PaymentClient(config);

Set the Environment (Optional)

PaymentClient can be configured to work in different environments, below is a list of the supported environments by this client:

Environment Corresponding API Endpoint
ClientEnvironment.PROD https://api.expediagroup.com/supply/payments/graphql
ClientEnvironment.TEST https://test-api.expediagroup.com/supply/payments/graphql

Configuration with Environment Example

const config: ClientConfiguration = {
   key: 'YOUR_API_KEY',
   secret: 'YOUR_API_SECRET',
   environment: ClientEnvironment.TEST
};

Execute the operation

const paymentInstrumentResponse = await paymentClient.query({
    query: PaymentInstrumentDocument,
    variables: { token: 'some-token' }
});

Available Operations

At the moment, there is only one query called PaymentInstrument you can execute using the PaymentClient.


PaymentInstrument

Summary: Retrieve Payment instrument from external payment instrument token

Operation Document Name: PaymentInstrumentDocument

Operation Inputs:

Name Type Description Required
token String! External token Yes

Resources