forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests of module "yandex-money-sdk" have been added
- Loading branch information
Showing
1 changed file
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/// <reference path="../yandex-money-sdk/yandex-money-sdk.d.ts" /> | ||
|
||
import * as ymsdk from 'yandex-money-sdk'; | ||
|
||
let wallet: ymsdk.Wallet; | ||
let externalPayment: ymsdk.ExternalPayment; | ||
|
||
{ | ||
let clientId: string; | ||
let redirectURI: string; | ||
let scope: string[]; | ||
let result: string; | ||
|
||
result = ymsdk.Wallet.buildObtainTokenUrl(clientId, redirectURI, scope); | ||
} | ||
|
||
{ | ||
let clientId: string; | ||
let code: string; | ||
let redirectURI: string; | ||
let clientSecret: string; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.GetAccessTokenResult>; | ||
|
||
ymsdk.Wallet.getAccessToken(clientId, code, redirectURI, clientSecret, callback); | ||
} | ||
|
||
{ | ||
let token: string; | ||
let revoke_all: any; | ||
let callback: ymsdk.ResponseCallback<any>; | ||
|
||
ymsdk.Wallet.revokeToken(token, revoke_all, callback); | ||
} | ||
|
||
{ | ||
let accessToken: string; | ||
let result: ymsdk.Wallet; | ||
|
||
result = new ymsdk.Wallet(accessToken); | ||
} | ||
|
||
{ | ||
let params: YandexMoneySDK.Wallet.SendAuthenticatedRequestParams; | ||
let callback: ymsdk.ResponseCallback<any>; | ||
|
||
wallet.sendAuthenticatedRequest(params, callback) | ||
} | ||
|
||
{ | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.AccountInfoResult>; | ||
|
||
wallet.accountInfo(callback); | ||
} | ||
|
||
{ | ||
let options: YandexMoneySDK.Wallet.OperationHistoryOptions; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.OperationHistoryResult>; | ||
|
||
wallet.operationHistory(options, callback); | ||
} | ||
|
||
{ | ||
let operation_id: string; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.OperationDetailsResult>; | ||
|
||
wallet.operationDetails(operation_id, callback); | ||
} | ||
|
||
{ | ||
let options: YandexMoneySDK.Wallet.RequestPaymentOptions; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.RequestPaymentResult>; | ||
|
||
wallet.requestPayment(options, callback); | ||
} | ||
|
||
{ | ||
let options: YandexMoneySDK.Wallet.ProcessPaymentOptions; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.ProcessPaymentResult>; | ||
|
||
wallet.processPayment(options, callback); | ||
} | ||
|
||
{ | ||
let operation_id: string; | ||
let protectionCode: string; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.IncomingTransferAcceptResult>; | ||
|
||
wallet.incomingTransferAccept(operation_id, protectionCode, callback); | ||
} | ||
|
||
{ | ||
let operation_id: string; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.Wallet.IncomingTransferRejectResult>; | ||
|
||
wallet.incomingTransferReject(operation_id, callback); | ||
} | ||
|
||
{ | ||
let clientId: string; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.ExternalPayment.GetInstanceIdResult>; | ||
|
||
ymsdk.ExternalPayment.getInstanceId(clientId, callback); | ||
} | ||
|
||
{ | ||
let instanceId: string; | ||
let result: ymsdk.ExternalPayment; | ||
|
||
result = new ymsdk.ExternalPayment(instanceId); | ||
} | ||
|
||
{ | ||
let options: YandexMoneySDK.ExternalPayment.RequestOptions; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.ExternalPayment.RequestResult>; | ||
|
||
externalPayment.request(options, callback); | ||
} | ||
|
||
{ | ||
let options: YandexMoneySDK.ExternalPayment.ProcessOptions; | ||
let callback: ymsdk.ResponseCallback<YandexMoneySDK.ExternalPayment.ProcessResult>; | ||
|
||
externalPayment.process(options, callback); | ||
} |