3thix-typescript-sdk
v1.0.0
Published
[](https://www.npmjs.com/package/3thix-typescript-sdk)
Keywords
Readme
3thix typescript SDK
Installing
npm install 3thix-typescript-sdk
# OR
yarn add 3thix-typescript-sdkExample
import Client from '3thix-typescript-sdk';
const client = Client("sandbox", "<your-api-key>")
async function openNewPayment() {
try {
const resp = await client.createOrderPayment("1.00", "USD")
const paymentUrl = resp.getPaymentUrl()
const win = window.open(paymentUrl, '', 'popup=true');
if (!win) return;
win.resizeTo(550, 800);
} catch (err) {
console.error(err)
}
}
openNewPayment()Interface
export interface SDK {
invoiceGet(id: string): Promise<InvoiceGetResponse>;
createOrderPayment(amount: string, currency: string): Promise<CreateOrderResponse>;
createOrderPurchase(fulfillmentGameUserId: string, destinationCurrency: string, cart: Cart): Promise<CreateOrderResponse>;
authorizeFulfillment(invoiceId: string): Promise<AuthorizeFulfillmentResponse>;
getCampaigns(gameUserId: string): Promise<GetCampaignResponse>;
syncUsersGame(req: SyncUsersReq): Promise<SyncUsersResponse>;
createOrderFulfillment(amount: string, currency: string, rail: string, sourceAccountId: string, fulfillmentGameUserId: string): Promise<CreateOrderResponse>;
}