diff --git a/README.md b/README.md index fbe42d7..460b1bc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ In Solution Explorer, right-click the project node and click Add Reference. Sele #### With NuGet Open your package manager console and enter: -`PM> Install-Package Trolley.SDK` +`PM> Install-Package trolleyhq` The library is hosted on github [here](https://github.com/Trolley/dotnet-sdk) @@ -41,10 +41,10 @@ class Program { static void Main(string[] args) { - // set your API key - var client = new Trolley.Gateway("YOUR-API-KEY", "YOUR-SECRET-KEY"); - Recipient response = client.recipient.find("R-4q7zxMa26hpZhx7ULApBGw"); - Console.WriteLine(response.Id); + // set your API keys + var gateway = new Trolley.Gateway("",""); + Recipient recipient = gateway.recipient.Get("R-a4q7zxMa26Zhx7ULApBGw"); + Console.WriteLine(recipient.Id); Console.Read(); } @@ -54,15 +54,6 @@ class Program ### Usage -Methods should all have C# Doc comments to help you understand their usage. As mentioned the [full API documentation](https://docs.trolley.com) -is the best source of information about the API. - -For more information please read the [C# API docs](https://github.com/Trolley/dotnet-sdk/tree/master/docs/) is available. The best starting point is: - -| Data Type | SDK Documentation | -| ----- | ----- | -| Batch | [API Docs for Batch](https://github.com/Trolley/dotnet-sdk/tree/master/docs/classes/batchgateway.md) | -| Payment | [API Docs for Payment](https://github.com/Trolley/dotnet-sdk/tree/master/docs/classes/paymentgateway.md) | -| Recipient | [API Docs for Recipient](https://github.com/Trolley/dotnet-sdk/tree/master/docs/classes/recipientgateway.md) | -| Recipient Account | [API Docs for Recipient Account](https://github.com/Trolley/dotnet-sdk/tree/master/docs/classes/recipientaccountgateway.md) | +Methods should all have C# Doc comments to help you understand their usage. +As mentioned the [full API documentation](https://docs.trolley.com) is the best source of information about the API. \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index d650870..0000000 --- a/docs/README.md +++ /dev/null @@ -1,61 +0,0 @@ - - - -# Trolley C# SDK - -## Index - -### Packages - -* [Exceptions](packages/exceptions.md) - - -### Classes - -* [BalancesGateway](classes/balancesgateway.md) -* [BatchGateway](classes/batchgateway.md) -* [Configuration](classes/configuration.md) -* [Gateway](classes/gateway.md) -* [PaymentGateway](classes/paymentgateway.md) -* [RecipientAccount](classes/recipientaccount.md) -* [RecipientAccountGateway](classes/recipientaccountgateway.md) -* [RecipientGateway](classes/recipientgateway.md) - - -### Types - -* [Batch](types/batch.md) -* [ConfigurationParams](types/configurationparams.md) -* [Payment](types/payment.md) -* [Recipient](types/recipient.md) - - ---- - - -Create a client for the Trolley C# SDK - - - var client = new Trolley_Gateway("MY_PUBLIC_KEY", "MY_PRIVATE_KEY", "production"); - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| publicKey | [String] | The public key | -| secretKey | [String] | The secret key | -| environment | [String] | The environment which should be used | - - - - - -**Returns:** [Gateway](classes/gateway.md) - - - - - -___ - - diff --git a/docs/classes/balancesgateway.md b/docs/classes/balancesgateway.md deleted file mode 100644 index d3c61bc..0000000 --- a/docs/classes/balancesgateway.md +++ /dev/null @@ -1,57 +0,0 @@ -[Trolley C# SDK](../README.md) > [Trolley_Balances_Gateway](../classes/Trolley_Balances_Gateway.md) - - - -# Class: Trolley_Balances_Gateway - -## Index - -### Methods - -* [find](Trolley_Balances_Gateway.md#find) - - - ---- - - -## Methods - -___ - - - -### find - -► **find**(kind: *"paypal"⎮"paymentrails"*): `Dictionary`<`String`, `Balance`> - - - -*Defined in [Trolley_Balances_Gateway.ts:49](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Balances_Gateway.cs#L49)* - - - -Fetch the account balance for the given account type - - Dictionary balances = gateway.balances.find(); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| kind | "paypal"⎮"paymentrails" | The account type to get the balances for | - - - - - -**Returns:** `Dictionary`<`String`, `Balance`> - - - - - -___ - - diff --git a/docs/classes/batchgateway.md b/docs/classes/batchgateway.md deleted file mode 100644 index f55c643..0000000 --- a/docs/classes/batchgateway.md +++ /dev/null @@ -1,349 +0,0 @@ -[Trolley C# SDK](../README.md) > [Trolley_Batch_Gateway](../classes/Trolley_Batch_Gateway.md) - - - -# Class: Trolley_Batch_Gateway - - -Gateway class for batches -*__class__*: Trolley_Batch_Gateway - - -## Index - -### Methods - -* [create](Trolley_Batch_Gateway.md#create) -* [find](Trolley_Batch_Gateway.md#find) -* [generateQuote](Trolley_Batch_Gateway.md#generatequote) -* [paymentList](Trolley_Batch_Gateway.md#paymentlist) -* [delete](Trolley_Batch_Gateway.md#delete) -* [search](Trolley_Batch_Gateway.md#search) -* [processBatch](Trolley_Batch_Gateway.md#processBatch) -* [summary](Trolley_Batch_Gateway.md#summary) -* [update](Trolley_Batch_Gateway.md#update) - - - ---- -## Methods - - -### create - -► **create**(batch: *`Batch`*): `Batch` - - - -*Defined in [Trolley_Batch_Gateway.cs:95](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L95)* - - - -Creates a batch with optional payments. This is the interface that is provide by the [Create Batch](https://docs.trolley.com/api/#create-a-batch) API - - Address address = new Address("123 Wolfstrasse", null, "Berlin", "123123", null, "DE", null); - - Recipient recipient = new Recipient(null, "individual", null, "tom.jones@example.com", null, "Tom", "Jones", null, null, null, "1990-01-01", null, null, null, address); - - Payment paymentAlpha = new Payment(recipientAlpha,0,null,10.00,"EUR",0,0,0,0,null,null,null,0,null,null,null,null,null); - List payments = new List(); - payments.Add(paymentAlpha); - - Batch batch = new Batch("My Batch",payments,"USD",10.20,0,null,null,null,null,null,null); - batch = gateway.batch.create(batch); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batch | `Batch` | - | - - - - - -**Returns:** `Batch` - - - - - -___ - - - -### find - -► **find**(batchId: *`string`*): `Batch` - - - -*Defined in [Trolley_Batch_Gateway.cs:67](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L67)* - - - -Retrieves a batch based on the batch id - - Batch batch = client.batch.find('B-xx999bb'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley batch id (e.g. "B-xx999bb") | - - - - - -**Returns:** `Batch` - - - - - -___ - - - -### generateQuote - -► **generateQuote**(batchId: *`string`*): `Batch` - - - -*Defined in [Trolley_Batch_Gateway.cs:182](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L182)* - - - -Generate a FX quote for this batch - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") | - - - - - -**Returns:** `Batch` - - - - - -___ - - - -### paymentList - -► **paymentList**(batchId: *`string`*, page?: *`number`*, pageSize?: *`number`*): `Promise`.<`Payment`[]> - - - -*Defined in [Trolley_Batch_Gateway.cs:166](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L166)* - - - -Return a paginated list of payments for this batch - - -**Parameters:** - -| Param | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| batchId | `string` | - | Trolley payment id (e.g. "B-xx999bb") | -| page | `number` | 1 | starting a 1 | -| pageSize | `number` | 10 | in the range 0...1000 | - - - - - -**Returns:** `Promise`.<`Payment`[]> - - - - - -___ - - - -### delete - -► **delete**(batchId: *`string`*): `Boolean` -► **delete**(batch: *`Batch`*): `Boolean` - - -*Defined in [Trolley_Batch_Gateway.cs:132](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L132)* - - - -Delete the given batch - - boolean success = client.batch.delete('B-xx999bb'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley batch (e.g. "B-xx999bb") | -| batch | `Batch` | Trolley batch | - - - - -**Returns:** `Boolean` - - - - - -___ - - - -### search - -► **search**(page?: *`number`*, pageSize?: *`number`*, term?: *`string`*): `Batch`[] - - - -*Defined in [Trolley_Batch_Gateway.cs:146](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L146)* - - - -Search for a batch matching the given term - - -**Parameters:** - -| Param | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| page | `number` | 1 | - | -| pageSize | `number` | 10 | - | -| term | `string` | "" | string search term | - - - - - -**Returns:** `Batch`[] - - - - - -___ - - - -### processBatch - -► **processBatch**(batchId: *`string`*): `Batch` - - - -*Defined in [Trolley_Batch_Gateway.cs:194](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L194)* - - - -Start processing this batch - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley batch id (e.g. "B-xx999bb") | - - - - - -**Returns:** `Batch` - - - - - -___ - - - -### summary - -► **summary**(batchId: *`string`*): `String` - - - -*Defined in [Trolley_Batch_Gateway.cs:206](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L206)* - - - -Get a transaction totaled summary for this batch - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") | - - - - - -**Returns:** `String` - - - - - -___ - - - -### update - -► **update**(batch: *`Batch`*): `boolean` - - - -*Defined in [Trolley_Batch_Gateway.cs:117](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch_Gateway.cs#L117)* - - - -Update the batch data, note you can only update the information of a batch not the payments via this API - - Batch batch = new Batch("My Batch for Wednesday", null, "USD", 0, 0, null, null, null, null, null, null); - batch = client.batch.create(batch); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| body | `Batch` | - | - - - - - -**Returns:** `boolean` - - - - - -___ - - diff --git a/docs/classes/configuration.md b/docs/classes/configuration.md deleted file mode 100644 index 7e432c1..0000000 --- a/docs/classes/configuration.md +++ /dev/null @@ -1,93 +0,0 @@ -[Trolley C# SDK](../README.md) > [Trolley_Configuration](../classes/Trolley_Configuration.md) - - - -# Class: Trolley_Configuration - -## Index - -### Properties - -* [apiBase](Trolley_Configuration.md#apibase) -* [apiKey](Trolley_Configuration.md#apikey) -* [apiSecret](Trolley_Configuration.md#apisecret) - - - - ---- -## Properties - - -### apiBase - -**● apiBase**: *`string`* - -*Defined in [Trolley_Configuration.cs:35](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L35)* - - - - - -___ - - - -### apiKey - -**● apiKey**: *`string`* - -*Defined in [Trolley_Configuration.cs:33](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L33)* - - - - - -___ - - - -### apiSecret - -**● apiSecret**: *`string`* - -*Defined in [Trolley_Configuration.cs:34](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L34)* - - - - -___ - - - -### «Static» setEnvironment - -► **setEnvironment**(environment: *"production"⎮"sandbox"⎮"integration"*): `void` - - - -*Defined in [Trolley_Configuration.cs:90](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L90)* - - - -Set the Trolley API environment that your using - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| environment | "production"⎮"sandbox"⎮"integration" | one of "production" or "sandbox" | - - - - - -**Returns:** `void` - - - - -___ - - diff --git a/docs/classes/exceptions.authentication.md b/docs/classes/exceptions.authentication.md deleted file mode 100644 index 84f3c96..0000000 --- a/docs/classes/exceptions.authentication.md +++ /dev/null @@ -1,81 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../packages/exceptions.md) > [Authentication](../classes/exceptions.authentication.md) - - - -# Class: Authentication - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ Authentication** - - - - - - - -## Index - -### Properties - -* [message](exceptions.authentication.md#message) -* [name](exceptions.authentication.md#name) -* [stack](exceptions.authentication.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - - -*An unhandled exception of type 'Trolley.Exceptions.AuthenticationException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.authorization.md b/docs/classes/exceptions.authorization.md deleted file mode 100644 index 8f341fb..0000000 --- a/docs/classes/exceptions.authorization.md +++ /dev/null @@ -1,80 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../packages/exceptions.md) > [Authorization](../classes/exceptions.authorization.md) - - - -# Class: Authorization - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ Authorization** - - - - - - - -## Index - -### Properties - -* [message](exceptions.authorization.md#message) -* [name](exceptions.authorization.md#name) -* [stack](exceptions.authorization.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - -*An unhandled exception of type 'Trolley.Exceptions.Authorization.Exception' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*AuthorizationException* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.baseexception.md b/docs/classes/exceptions.baseexception.md deleted file mode 100644 index 237819d..0000000 --- a/docs/classes/exceptions.baseexception.md +++ /dev/null @@ -1,66 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [BaseException](../classes/exceptions.baseexception.md) - - - -# Class: BaseException - -## Hierarchy - - - `Error` - -**↳ BaseException** - -↳ [DownForMaintenance](exceptions.downformaintenance.md) - - - - -↳ [ServerError](exceptions.servererror.md) - - - - -↳ [Unexpected](exceptions.unexpected.md) - - - - -↳ [NotFound](exceptions.notfound.md) - - - - -↳ [Authentication](exceptions.authentication.md) - - - - -↳ [Authorization](exceptions.authorization.md) - - - - -↳ [Malformed](exceptions.malformed.md) - - - - - - - - - - -## Index - -### Properties - -* [Error](exceptions.baseexception.md#error) -* [message](exceptions.baseexception.md#message) -* [name](exceptions.baseexception.md#name) -* [stack](exceptions.baseexception.md#stack) - - - - diff --git a/docs/classes/exceptions.downformaintenance.md b/docs/classes/exceptions.downformaintenance.md deleted file mode 100644 index be45710..0000000 --- a/docs/classes/exceptions.downformaintenance.md +++ /dev/null @@ -1,80 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [DownForMaintenance](../classes/exceptions.downformaintenance.md) - - - -# Class: DownForMaintenance - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ DownForMaintenance** - - - - - - - -## Index - -### Properties - -* [message](exceptions.downformaintenance.md#message) -* [name](exceptions.downformaintenance.md#name) -* [stack](exceptions.downformaintenance.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - -*An unhandled exception of type 'Trolley.Exceptions.DownForMaintenanceException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.malformed.md b/docs/classes/exceptions.malformed.md deleted file mode 100644 index f81a4ad..0000000 --- a/docs/classes/exceptions.malformed.md +++ /dev/null @@ -1,81 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [Malformed](../classes/exceptions.malformed.md) - - - -# Class: Malformed - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ Malformed** - - - - - - - -## Index - -### Properties - -* [message](exceptions.malformed.md#message) -* [name](exceptions.malformed.md#name) -* [stack](exceptions.malformed.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - - -*An unhandled exception of type 'Trolley.Exceptions.MalformedUrlException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.notfound.md b/docs/classes/exceptions.notfound.md deleted file mode 100644 index 11d299d..0000000 --- a/docs/classes/exceptions.notfound.md +++ /dev/null @@ -1,81 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [NotFound](../classes/exceptions.notfound.md) - - - -# Class: NotFound - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ NotFound** - - - - - - - -## Index - -### Properties - -* [message](exceptions.notfound.md#message) -* [name](exceptions.notfound.md#name) -* [stack](exceptions.notfound.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - - -*An unhandled exception of type 'Trolley.Exceptions.NotFoundException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.servererror.md b/docs/classes/exceptions.servererror.md deleted file mode 100644 index 1bea829..0000000 --- a/docs/classes/exceptions.servererror.md +++ /dev/null @@ -1,81 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [ServerError](../classes/exceptions.servererror.md) - - - -# Class: ServerError - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ ServerError** - - - - - - - -## Index - -### Properties - -* [message](exceptions.servererror.md#message) -* [name](exceptions.servererror.md#name) -* [stack](exceptions.servererror.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - - -*An unhandled exception of type 'Trolley.Exceptions.ServerErrorException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/exceptions.unexpected.md b/docs/classes/exceptions.unexpected.md deleted file mode 100644 index ce55e18..0000000 --- a/docs/classes/exceptions.unexpected.md +++ /dev/null @@ -1,81 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [Unexpected](../classes/exceptions.unexpected.md) - - - -# Class: Unexpected - -## Hierarchy - - -↳ [BaseException](exceptions.baseexception.md) - -**↳ Unexpected** - - - - - - - -## Index - -### Properties - -* [message](exceptions.unexpected.md#message) -* [name](exceptions.unexpected.md#name) -* [stack](exceptions.unexpected.md#stack) - - - ---- -## Properties - - -### «Static» message - -**● message**: *`string`* - - -*An unhandled exception of type 'Trolley.Exceptions.UnexpectedException' occurred in Trolley.exe* - - - - - -___ - - - -### «Static» name - -**● name**: *`string`* - -*Inherited from Error.name* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:873* - - - - - -___ - - - -### «Static»«Optional» stack - -**● stack**: *`undefined`⎮`string`* - -*Inherited from Error.stack* - -*Overrides Error.stack* - -*Defined in /Users/koblas/repos/trolley/dotnet-sdk/node_modules/typedoc/node_modules/typescript/trolley/lib.es5.d.ts:875* - - - - - -___ - - diff --git a/docs/classes/gateway.md b/docs/classes/gateway.md deleted file mode 100644 index 3bddccf..0000000 --- a/docs/classes/gateway.md +++ /dev/null @@ -1,121 +0,0 @@ -[Trolley C# SDK](../README.md) > [Gateway](../classes/gateway.md) - - - -# Class: Gateway - -## Index - -### Properties - -* [balances](gateway.md#balances) -* [batch](gateway.md#batch) -* [client](gateway.md#client) -* [config](gateway.md#config) -* [payment](gateway.md#payment) -* [recipient](gateway.md#recipient) -* [recipientAccount](gateway.md#recipientaccount) - - - ---- -## Properties - - -### balances - -**● balances**: *[Trolley_Balances_Gateway](balancesgateway.md)* - -*Defined in [Trolley_Gateway.md:15]* - - - - - -___ - - - -### batch - -**● batch**: *[Trolley_Batch_Gateway](batchgateway.md)* - -*Defined in [Trolley_Gateway.cs:13](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L13)* - - - - - -___ - - - -### client - -**● client**: *`Trolley_Client`* - -*Defined in [Trolley_Gateway.cs:11](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L11)* - - - - - -___ - - - -### config - -**● config**: *[Trolley_Configuration](configuration.md)* - -*Defined in [Trolley_Gateway.cs:10](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L10)* - - - - - -___ - - - -### payment - -**● payment**: *[Trolley_Payment_Gateway](paymentgateway.md)* - -*Defined in [Gateway.cs:16](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L16)* - - - - - -___ - - - -### recipient - -**● recipient**: *[Trolley_Recipient_Gateway](recipientgateway.md)* - -*Defined in [Trolley_Gateway.cs:12](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L12)* - - - - - -___ - - - -### recipientAccount - -**● Trolley_RecipientAccount**: *[Trolley_RecipientAccount_Gateway](recipientaccountgateway.md)* - -*Defined in [Trolley_Gateway.cs:14](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L14)* - - - - - -___ - - diff --git a/docs/classes/paymentgateway.md b/docs/classes/paymentgateway.md deleted file mode 100644 index c9ebb51..0000000 --- a/docs/classes/paymentgateway.md +++ /dev/null @@ -1,208 +0,0 @@ -[Trolley C# SDK](../README.md) > [PaymentGateway](../classes/paymentgateway.md) - - - -# Class: PaymentGateway - -## Index - -### Methods - -* [create](paymentgateway.md#create) -* [find](paymentgateway.md#find) -* [remove](paymentgateway.md#remove) -* [search](paymentgateway.md#search) -* [update](paymentgateway.md#update) - - - ---- -## Methods - - -### create - -► **create**(batchId: *`string`*, body: *`any`*): `Promise`.<`Payment`> - - - -*Defined in [PaymentGateway.ts:55](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L55)* - - - -Create a new payment in a batch - - const payment = await client.payment.create('B-xx99bb', { - recipient: { - email: 'tom.jones@example.com', - }, - sourceAmount: '10.99', - }); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") | -| body | `any` | Payment information | - - - - - -**Returns:** `Promise`.<`Payment`> - - - - - -___ - - - -### find - -► **find**(paymentId: *`string`*): `Promise`.<`Payment`> - - - -*Defined in [PaymentGateway.ts:34](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L34)* - - - -Find a specific payment - - const payment = await client.payment.find('P-aabbccc'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| paymentId | `string` | Trolley payment id (e.g. "P-aabccc") | - - - - - -**Returns:** `Promise`.<`Payment`> - - - - - -___ - - - -### remove - -► **remove**(paymentId: *`string`*, batchId: *`string`*): `Promise`.<`boolean`> - - - -*Defined in [PaymentGateway.ts:90](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L90)* - - - -Delete a given payment -- Note you can only delete non processed payments - - const success = await client.payment.remove('P-aabbccc', 'B-xx99bb'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| paymentId | `string` | Trolley payment id (e.g. "P-aabccc") | -| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") | - - - - - -**Returns:** `Promise`.<`boolean`> - - - - - -___ - - - -### search - -► **search**(batchId: *`string`*, page?: *`number`*, pageSize?: *`number`*, term?: *`string`*): `Promise`.<`Payment`[]> - - - -*Defined in [PaymentGateway.ts:105](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L105)* - - - -Search for payments in a given batch - - -**Parameters:** - -| Param | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| batchId | `string` | - | Trolley payment id (e.g. "B-xx999bb") | -| page | `number` | 1 | Page number (1 based) | -| pageSize | `number` | 10 | Page size (0...1000) | -| term | `string` | "" | Any search terms to look for | - - - - - -**Returns:** `Promise`.<`Payment`[]> - - - - - -___ - - - -### update - -► **update**(paymentId: *`string`*, batchId: *`string`*, body: *`any`*): `Promise`.<`boolean`> - - - -*Defined in [PaymentGateway.ts:74](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Gateway.cs#L74)* - - - -Update a given payment - - const success = await client.payment.update('P-aabbccc', 'B-xx99bb', { - sourceAmount: '99.99', - }); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| paymentId | `string` | Trolley payment id (e.g. "P-aabccc") | -| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") | -| body | `any` | Payment update information | - - - - - -**Returns:** `Promise`.<`boolean`> - - - - - -___ - - diff --git a/docs/classes/recipientaccountgateway.md b/docs/classes/recipientaccountgateway.md deleted file mode 100644 index 4954a04..0000000 --- a/docs/classes/recipientaccountgateway.md +++ /dev/null @@ -1,212 +0,0 @@ -[Trolley C# SDK](../README.md) > [RecipientAccountGateway](../classes/recipientaccountgateway.md) - - - -# Class: RecipientAccountGateway - -## Index - -### Methods - -* [findAll](recipientaccountgateway.md#findAll) -* [create](recipientaccountgateway.md#create) -* [find](recipientaccountgateway.md#find) -* [remove](recipientaccountgateway.md#remove) -* [update](recipientaccountgateway.md#update) - - - ---- - - -## Methods - - -### findAll - -► **findAll**(recipientId: *`string`*): `List`(recipientaccount.md)[]> - - - -*Defined in [RecipientAccountGateway.ts:33](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_RecipientAccountGateway.cs#L33)* - - - -Fetch all of the accounts for a given Trolley recipient - - List accounts = client.recipientAccount.findAll('R-1234'); -*__throws__*: {NotFound} if recipient doesn't exist - - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | - - - - - -**Returns:** `List(recipientaccount.md)[]> - - - - - -___ - - - -### create - -► **create**(recipientId: *`string`*, body: *`RecipientAccount`*): `RecipientAccount`(recipientaccount.md)> - - - -*Defined in [RecipientAccountGateway.ts:79](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_RecipientAccountGateway.cs#L79)* - - - -Create a new recipient account - - RecipientAccount recipientAccount = new RecipientAccount(null,null,"EUR",null,null,null,null,"FR","bank-transfer", "FR14 2004 1010 0505 0001 3M02 606", "123456",null,null,null,null,null,null,null,null,null); - - recipientAccount = client.recipientAccount.create("R-1234", recipientAccount); - - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | -| body | `RecipientAccount` | Account information | - - - - - -**Returns:** `RecipientAccount`(recipientaccount.md)> - - - - - -___ - - - -### find - -► **find**(recipientId: *`string`*, accountId: *`string`*): `RecipientAccount`(recipientaccount.md)> - - - -*Defined in [RecipientAccountGateway.ts:52](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_RecipientAccountGateway.cs#L52)* - - - -Fetch a specific account for a given Trolley recipient - - RecipientAccount account = client.recipientAccount.find('R-1234', 'A-789'); -*__throws__*: {NotFound} if account or recipient don't exist - - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | -| accountId | `string` | The Trolley account ID (e.g. A-xyzzy) | - - - - - -**Returns:** `RecipientAccount`(recipientaccount.md)> - - - - - -___ - - - -### remove - -► **remove**(recipientId: *`string`*, accountId: *`string`*): `boolean` -► **remove**(recipientId: *`string`*, recipientAccount: *`RecipientAccount`*): `boolean` - - -*Defined in [RecipientAccountGateway.ts:121](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_RecipientAccountGateway.cs#L121)* - - - -Delete the given recipient account. This will only return success, otherwise it will throw an exception (e.g. NotFound) - - bool success = client.recipientAccount.remove('R-1234', 'A-789'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | -| accountId | `string` | The Trolley account ID (e.g. A-xyzzy) | - - - - - -**Returns:** `boolean` - - - - - -___ - - - -### update - -► **update**(recipientId: *`string`*, accountId: *`string`*, body: *`RecipientAccount`*): `RecipientAccount`(recipientaccount.md)> - - - -*Defined in [RecipientAccountGateway.ts:102](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_RecipientAccountGateway.cs#L102)* - - - -Update a recipient account. Note: Updating an account will create a new account ID if it contains any property that isn't just "primary" - - RecipientAccount recipientAccount = new RecipientAccount(null,null,"EUR",null,null,null,null,"FR","bank-transfer", "FR14 2004 1010 0505 0001 3M02 606", "123456",null,null,null,null,null,null,null,null,null); - - const account = client.recipientAccount.update('R-1234', recipientAccount); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | -| accountId | `string` | The Trolley account ID (e.g. A-xyzzy) | -| body | `any` | Account information | - - - - - -**Returns:** `RecipientAccount`(recipientaccount.md)> - - - - - -___ - - diff --git a/docs/classes/recipientgateway.md b/docs/classes/recipientgateway.md deleted file mode 100644 index 7c33a8b..0000000 --- a/docs/classes/recipientgateway.md +++ /dev/null @@ -1,192 +0,0 @@ -[Trolley C# SDK](../README.md) > [Trolley_Recipient_Gateway](../classes/Trolley_Recipient_Gateway.md) - - - -# Class: Trolley_Recipient_Gateway - -## Index - -### Methods - -* [create](Trolley_Recipient_Gateway.md#create) -* [find](Trolley_Recipient_Gateway.md#find) -* [remove](Trolley_Recipient_Gateway.md#remove) -* [search](Trolley_Recipient_Gateway.md#search) -* [update](Trolley_Recipient_Gateway.md#update) - - - ---- - -## Methods - - -### create - -► **create**(body: *[Recipient](../types/recipient.md)*): `Recipient` - - - -*Defined in [Trolley_Recipient_Gateway.cs:82](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L82)* - - - -Create a given recipient - - Address address = new Address("123 Main St",null,null,null,null,"US",null); - Recipient recipient = new Recipient(null,"individual",null,"tom.jones@example.com",null","Tom","Jones",null,null,null,null,null,null,null,address); - - recipient = client.recipient.create(recipient); - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| body | [Recipient](../types/recipient.md) | The recipient information to create | - - - -**Returns:** `Recipient` - - - -___ - - - -### find - -► **find**(recipientId: *`string`*): `Recipient` -► **find**(recipient: *`Recipient`*): `Recipient` - - -*Defined in [Trolley_Recipient_Gateway.cs:58](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L58)* - - - -Find a specific recipient by their Trolley recipient ID - - Recipient recipient = client.recipient.find('R-1234'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | - - - -**Returns:** `Recipient` - - - - - -___ - - - -### delete - -► **delete**(recipientId: *`string`*): `boolean` -► **delete**(recipient: *`Recipient`*): `boolean` - - - -*Defined in [Trolley_Recipient_Gateway.cs:115](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L115)* - - - -Delete the given recipient. - - bool status = client.recipient.delete('R-123'); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| recipientId | `string` | The Trolley recipient ID (e.g. R-xyzzy) | -| recipient | `Recipient` | The Trolley recipient object | - - - - -**Returns:** `boolean` - - - - - -___ - - - -### search - -► **search**(page: *`number`*, pageSize: *`number`*, term: *`string`*): `Recipient`[] - - - -*Defined in [Trolley_Recipient_Gateway.cs:123](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L123)* - - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| page | `number` | - | -| pageSize | `number` | - | -| term | `string` | - | - - - - - -**Returns:** `Recipient`[] - - - - - -___ - - - -### update - -► **update**(body: *[Recipient](../types/recipient.md)*): `boolean` - - - -*Defined in [Trolley_Recipient_Gateway.cs:100](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L100)* - - - -Update the given recipient - - Recipient recipient = new Recipient(null, "individual", null, "tom.jones@example.com", null, "Tom", "Jones", null, null, null, "1990-04-29", null, null, null, null); - recipient = client.recipient.update(recipient); - - -**Parameters:** - -| Param | Type | Description | -| ------ | ------ | ------ | -| body | [Recipient](../types/recipient.md) | the changes to make to the recipient | - - - - - -**Returns:** `boolean` - - - - - -___ - - diff --git a/docs/packages/exceptions.md b/docs/packages/exceptions.md deleted file mode 100644 index 5e79b64..0000000 --- a/docs/packages/exceptions.md +++ /dev/null @@ -1,32 +0,0 @@ -[Trolley C# SDK](../README.md) > [Exceptions](../packages/exceptions.md) - - - -# Package: Exceptions - -*__packages__*: exceptions - - -## Index - -### Classes - -* [Authentication](../classes/exceptions.authentication.md) -* [Authorization](../classes/exceptions.authorization.md) -* [DownForMaintenance](../classes/exceptions.downFormMintenance.md) -* [Malformed](../classes/exceptions.malformed.md) -* [NotFound](../classes/exceptions.notNound.md) -* [ServerError](../classes/exceptions.serverError.md) -* [Unexpected](../classes/exceptions.unexpected.md) -* [TooManyRequests](../classes/exceptions.tooManyRequests.md) -* [InvalidCredentials](../classes/exceptions.invalidCredentials.md) -* [InvalidField](../classes/exceptions.invalidField.md) -* [InvalidServer](../classes/exceptions.invalidServer.md) -* [InvalidStatusCode](../classes/exceptions.invalidStatusCode.md) - - - - - - ---- diff --git a/docs/types/Batch.md b/docs/types/Batch.md deleted file mode 100644 index 7718bf3..0000000 --- a/docs/types/Batch.md +++ /dev/null @@ -1,39 +0,0 @@ -[Trolley C# SDK](../README.md) > [BatchInput](../types/batch.md) - - - -# Types: Batch - - -## Properties - - -### description - -**● description**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:15](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L15)* - - - - - - -___ - - - -### sourceCurrency - -**● sourceCurrency**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:14](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L14)* - - - - - - -___ - - diff --git a/docs/types/Payment.md b/docs/types/Payment.md deleted file mode 100644 index 1dfb595..0000000 --- a/docs/types/Payment.md +++ /dev/null @@ -1,82 +0,0 @@ -[Trolley C# SDK](../README.md) > [PaymentInput](../types/payment.md) - - - -# Types: Payment - -*__type__*: Payment - - - -## Properties - - -### «Optional» memo - -**● memo**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:22](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L22)* - - - - - - -___ - - - -### recipient - -**● recipient**: *`object`* - -*Defined in [Types/Batch.ts:23](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L23)* - - -#### Type declaration - -«Optional» email: `undefined`⎮`string` -«Optional» id: `undefined`⎮`string` -«Optional» referenceId: `undefined`⎮`string` - - - - -___ - - - -### «Optional» sourceAmount - -**● sourceAmount**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:19](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L19)* - - - - -___ - - - -### «Optional» targetAmount - -**● targetAmount**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:20](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L20)* - - - - -___ - - - -### «Optional» targetCurrency - -**● targetCurrency**: *`undefined`⎮`string`* - -*Defined in [Types/Batch.ts:21](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Batch.cs#L21)* - - -___ \ No newline at end of file diff --git a/docs/types/Recipient.md b/docs/types/Recipient.md deleted file mode 100644 index 630dd99..0000000 --- a/docs/types/Recipient.md +++ /dev/null @@ -1,190 +0,0 @@ -[Trolley C# SDK](../README.md) > [RecipientInput](../types/recipient.md) - - - -# Types: Recipient - - -## Properties - - -### «Optional» account - -**● account**: *`any`* - -*Defined in [Types/Recipient.cs:30](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L29)* - - - - - -___ - - - -### «Optional» address - -**● address**: *`undefined`⎮`object`* - -*Defined in [Types/Recipient.cs:20](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L20)* - - - - - -___ - - - -### «Optional» dob - -**● dob**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:15](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L15)* - - - - -___ - - - -### «Optional» email - -**● email**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:10](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L10)* - - - - - -___ - - - -### «Optional» firstName - -**● firstName**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:12](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L12)* - - - - - -___ - - - -### «Optional» governmentId - -**● governmentId**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:17](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L17)* - - - - - -___ - - - -### «Optional» language - -**● language**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:19](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L19)* - - - - - -___ - - - -### «Optional» lastName - -**● lastName**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:13](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L13)* - - - - - -___ - - - -### «Optional» name - -**● name**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:11](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L11)* - - - - - -___ - - - -### «Optional» passport - -**● passport**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:18](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L18)* - - - - - -___ - - - -### «Optional» referenceId - -**● referenceId**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:9](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L9)* - - - - - -___ - - - -### «Optional» ssn - -**● ssn**: *`undefined`⎮`string`* - -*Defined in [Types/Recipient.cs:16](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L16)* - - - - - -___ - - - -### «Optional» type - -**● type**: *"individual"⎮"business"* - -*Defined in [Types/Recipient.cs:14](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Recipient_Gateway.cs#L14)* - - - - - -___ - - diff --git a/docs/types/configurationparams.md b/docs/types/configurationparams.md deleted file mode 100644 index 3690b3f..0000000 --- a/docs/types/configurationparams.md +++ /dev/null @@ -1,59 +0,0 @@ -[Trolley C# SDK](../README.md) > [Trolley_ConfigurationParams](../types/configurationparams.md) - - - -# Interface: Configuration - -## Properties - - -### «Optional» environment - -**● environment**: *"production"⎮"sandbox"⎮"integration"⎮"development"* - -*Defined in [Trolley_Configuration.ts:15](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L15)* - - - -The environment that you're using, most likely one of "production" or "sandbox" - - - - -___ - - - -### key - -**● key**: *`string`* - -*Defined in [Trolley_Configuration.ts:7](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L7)* - - - -The Trolley public key - - - - -___ - - - -### secret - -**● secret**: *`string`* - -*Defined in [Trolley_Configuration.ts:11](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Trolley_Configuration.cs#L11)* - - - -The Trolley private key - - - - -___ - - diff --git a/docs/types/recipientaccount.md b/docs/types/recipientaccount.md deleted file mode 100644 index 9b32534..0000000 --- a/docs/types/recipientaccount.md +++ /dev/null @@ -1,278 +0,0 @@ -[Trolley C# SDK](../README.md) > [Types/RecipientAccount](../types/recipientaccount.md) - - - -# Types: RecipientAccount - -*__type__*: RecipientAccount - - - -## Properties - - -### «Optional» accountHolderName - -**● accountHolderName**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:23](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L23)* - - - - - -___ - - - -### «Optional» accountNum - -**● accountNum**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:22](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L22)* - - - - - -___ - - - -### «Optional» bankAddress - -**● bankAddress**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:28](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L28)* - - - - - -___ - - - -### «Optional» bankCity - -**● bankCity**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:29](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L29)* - - - - - -___ - - - -### «Optional» bankId - -**● bankId**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:26](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L26)* - - - - - -___ - - - -### «Optional» bankName - -**● bankName**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:27](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L27)* - - - - - -___ - - - -### «Optional» bankPostalCode - -**● bankPostalCode**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:31](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L31)* - - - - - -___ - - - -### «Optional» bankRegionCode - -**● bankRegionCode**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:30](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L30)* - - - - - -___ - - - -### «Optional» branchId - -**● branchId**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:25](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L25)* - - - - - -___ - - - -### «Optional» country - -**● country**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:19](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L19)* - - - - - -___ - - - -### currency - -**● currency**: *`string`* = "" - -*Defined in [Types/RecipientAccount.cs:11](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L11)* - - - - - -___ - - - -### «Optional» emailAddress - -**● emailAddress**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:16](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L16)* - - - - - -___ - - - -### «Optional» iban - -**● iban**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:21](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L21)* - - - - - -___ - - - -### id - -**● id**: *`string`* = "" - -*Defined in [Types/RecipientAccount.cs:9](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L9)* - - - - - -___ - - - -### primary - -**● primary**: *`boolean`* = false - -*Defined in [Types/RecipientAccount.cs:10](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L10)* - - - - - -___ - - - -### «Optional» recipientFees - -**● recipientFees**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:13](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L13)* - - - - - -___ - - - -### «Optional» routeType - -**● routeType**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:12](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L12)* - - - - - -___ - - - -### «Optional» swiftBic - -**● swiftBic**: *`string`⎮`null`* - -*Defined in [Types/RecipientAccount.cs:24](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L24)* - - - - - -___ - - - -### «Optional» type - -**● type**: *`undefined`⎮`string`* - -*Defined in [Types/RecipientAccount.cs:20](https://github.com/Trolley/dotnet-sdk/tree/master/trolley/Types/RecipientAccount.cs#L20)* - - - - - -___ - - diff --git a/tests/BatchTest.cs b/tests/BatchTest.cs index 470883f..568126e 100644 --- a/tests/BatchTest.cs +++ b/tests/BatchTest.cs @@ -2,6 +2,7 @@ using Trolley.Types; using System.Collections.Generic; using System; +using Trolley.Exceptions; namespace tests { @@ -128,12 +129,14 @@ public void testPayments() Assert.IsNotNull(payment.id); Assert.AreEqual(payment.amount, 10.92); - payment.sourceAmount = 20.00; - payment.batchId = batch.id; + Payment updatePaymentRequest = new Payment(recipient, 20.00, "EUR"); + updatePaymentRequest.batchId = batch.id; + updatePaymentRequest.id = payment.id; - bool response = gateway.payment.Update(payment); + bool response = gateway.payment.Update(updatePaymentRequest); Assert.IsTrue(response); + payment.batchId = batch.id; response = gateway.payment.Delete(payment); Assert.IsTrue(response); } @@ -153,11 +156,19 @@ public void testProcessing() Batch batch = new Batch("Integration Test Payments", payments, Config.TEST_BALANCE_CURRENCY, 0); batch = gateway.batch.Create(batch); - Batch quote = gateway.batch.GenerateQuote(batch.id); - Assert.IsNotNull(quote); + try { + Batch quote = gateway.batch.GenerateQuote(batch.id); + Assert.IsNotNull(quote); + + Batch start = gateway.batch.ProcessBatch(batch.id); + Assert.IsNotNull(start); + } + catch (MalformedUrlException mfe) + { + //this test might fail because testing accounts will not have a valid payment plan + } - Batch start = gateway.batch.ProcessBatch(batch.id); - Assert.IsNotNull(start); + gateway.batch.Delete(batch.id); } [TestMethod] diff --git a/tests/PaymentTest.cs b/tests/PaymentTest.cs index 706bc39..b908f1b 100644 --- a/tests/PaymentTest.cs +++ b/tests/PaymentTest.cs @@ -2,6 +2,7 @@ using Trolley.Types; using System; using System.Collections.Generic; +using Trolley.Types.Supporting; namespace tests { @@ -36,14 +37,27 @@ public void Smoke() [TestMethod] public void testFindBatchPayments() { - List batches = trolley.batch.Search().batches; - - Batch batch = batches.Find(x => x.totalPayments > 0); - List payments1 = trolley.payment.Search(batch.id).payments; - Assert.IsTrue(payments1.Count > 0); + Batch batch = null; + var batches = trolley.batch.ListAllBatches(null); + foreach(Batch b in batches) + { + if(b.payments != null && b.payments.Count > 0) + { + batch = b; + break; + } + } - List payments2 = trolley.payment.Search("", 1, 10, batch.id).payments; - Assert.IsTrue(payments2.Count > 0); + if(batch != null) + { + Payments p = trolley.payment.Search(batch.id); + List payments1 = p.payments; + Assert.IsTrue(payments1.Count > 0); + + List payments2 = trolley.payment.Search("", 1, 10, batch.id).payments; + Assert.IsTrue(payments2.Count > 0); + } + } [TestMethod] diff --git a/tests/RecipientTest.cs b/tests/RecipientTest.cs index 8bc2a55..6b6eb87 100644 --- a/tests/RecipientTest.cs +++ b/tests/RecipientTest.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; using System.Net; +using Newtonsoft.Json; +using System.IO; namespace tests { @@ -11,11 +13,12 @@ public class RecipientTest { Trolley.Gateway gateway; + Config config; [TestInitialize] public void Init() { - Config config = new Config(); + config = new Config(); gateway = new Trolley.Gateway(config.ACCESS_KEY, config.SECRET_KEY); } @@ -54,6 +57,15 @@ public void testCreateASCII() Assert.IsNotNull(recipient.id); } + public static string Serialize(object o, StringEscapeHandling stringEscapeHandling) + { + StringWriter wr = new StringWriter(); + var jsonWriter = new JsonTextWriter(wr); + jsonWriter.StringEscapeHandling = stringEscapeHandling; + new JsonSerializer().Serialize(jsonWriter, o); + return wr.ToString(); + } + [TestMethod] public void testLifecycle() { @@ -219,7 +231,7 @@ public void TestListAllRecipients() [TestMethod] public void TestRecipientLogs() { - string recipientId = ""; + string recipientId = config.RECIPIENT_ID; List logs = gateway.recipient.GetAllLogs(recipientId, 1, 10).logs; Assert.IsTrue(logs.Count > 0); @@ -237,7 +249,7 @@ public void TestRecipientLogs() [TestMethod] public void TestRecipientPayments() { - string recipientId = ""; + string recipientId = config.RECIPIENT_ID; List payments = gateway.recipient.GetAllPayments(recipientId, 1, 10).payments; Assert.IsTrue(payments.Count > 0); @@ -256,7 +268,7 @@ public void TestRecipientPayments() [TestMethod] public void TestRecipientOfflinePayments() { - string recipientId = ""; + string recipientId = config.RECIPIENT_ID; List offlinePayments = gateway.recipient.GetAllOfflinePayments(recipientId, null, 1, 10).offlinePayments; Assert.IsTrue(offlinePayments.Count > 0); diff --git a/tests/bin/Debug/netstandard1.3/tests.deps.json b/tests/bin/Debug/netstandard1.3/tests.deps.json index ce2bec8..29e3367 100644 --- a/tests/bin/Debug/netstandard1.3/tests.deps.json +++ b/tests/bin/Debug/netstandard1.3/tests.deps.json @@ -821,6 +821,14 @@ "fileVersion": "1.0.2.0" } } + }, + "PaymentRails/1.0.2.0": { + "runtime": { + "PaymentRails.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.2.0" + } + } } } }, diff --git a/tests/config.cs b/tests/config.cs index c4e3151..97e4dc4 100644 --- a/tests/config.cs +++ b/tests/config.cs @@ -9,7 +9,8 @@ class Config public string ACCESS_KEY = ""; public string SECRET_KEY = ""; public string BASE_URL = ""; - public const string TEST_BALANCE_CURRENCY = "usd"; + public string RECIPIENT_ID = ""; + public const string TEST_BALANCE_CURRENCY = "USD"; public Config() { @@ -26,7 +27,7 @@ public Config() { string[] parts = line.Split('='); - if (parts.Length == 2) + if (parts.Length == 2 && parts[1].Length > 0) { string key = parts[0]; string value = parts[1]; @@ -49,6 +50,11 @@ public Config() { this.BASE_URL = apiKeys["BASE_URL"]; } + + if (apiKeys.ContainsKey("RECIPIENT_ID")) + { + this.RECIPIENT_ID = apiKeys["RECIPIENT_ID"]; + } } else { diff --git a/tests/obj/Debug/netstandard1.3/tests.csproj.FileListAbsolute.txt b/tests/obj/Debug/netstandard1.3/tests.csproj.FileListAbsolute.txt index 900376d..f0bd280 100644 --- a/tests/obj/Debug/netstandard1.3/tests.csproj.FileListAbsolute.txt +++ b/tests/obj/Debug/netstandard1.3/tests.csproj.FileListAbsolute.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD /Users/joshua/Documents/git/dotnet-sdk/tests/bin/Debug/netstandard1.3/tests.deps.json /Users/joshua/Documents/git/dotnet-sdk/tests/bin/Debug/netstandard1.3/tests.dll /Users/joshua/Documents/git/dotnet-sdk/tests/bin/Debug/netstandard1.3/tests.pdb @@ -18,6 +19,28 @@ /Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/Trolley.dll /Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/Trolley.pdb /Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/Trolley.dll.config +======= +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/tests.deps.json +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/tests.dll +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/tests.pdb +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.dll +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.pdb +/Users/joshua/Documents/git/paymentrails_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.dll.config +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.GeneratedMSBuildEditorConfig.editorconfig +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.AssemblyInfoInputs.cache +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.AssemblyInfo.cs +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.csproj.CoreCompileInputs.cache +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.csproj.CopyComplete +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.dll +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.pdb +/Users/joshua/Documents/git/paymentrails_dotnet/tests/obj/Debug/netstandard1.3/tests.csproj.AssemblyReference.cache +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/tests.deps.json +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/tests.dll +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/tests.pdb +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.dll +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.pdb +/Users/amanalam/src/sdk_dotnet/tests/bin/Debug/netstandard1.3/PaymentRails.dll.config +>>>>>>> dev /Users/amanalam/src/sdk_dotnet/tests/obj/Debug/netstandard1.3/tests.csproj.AssemblyReference.cache /Users/amanalam/src/sdk_dotnet/tests/obj/Debug/netstandard1.3/tests.GeneratedMSBuildEditorConfig.editorconfig /Users/amanalam/src/sdk_dotnet/tests/obj/Debug/netstandard1.3/tests.AssemblyInfoInputs.cache diff --git a/tests/obj/project.assets.json b/tests/obj/project.assets.json index dd90ca7..7a0832a 100644 --- a/tests/obj/project.assets.json +++ b/tests/obj/project.assets.json @@ -127,17 +127,17 @@ } } }, - "Trolley.NetCore.SDK/1.0.11": { + "trolleyhq/2.0.0": { "type": "project", "framework": ".NETStandard,Version=v2.0", "dependencies": { "Newtonsoft.Json": "13.0.3" }, "compile": { - "bin/placeholder/Trolley.NetCore.SDK.dll": {} + "bin/placeholder/trolleyhq.dll": {} }, "runtime": { - "bin/placeholder/Trolley.NetCore.SDK.dll": {} + "bin/placeholder/trolleyhq.dll": {} } } }, @@ -530,17 +530,17 @@ } } }, - "Trolley.NetCore.SDK/1.0.11": { + "trolleyhq/2.0.0": { "type": "project", "framework": ".NETCoreApp,Version=v6.0", "dependencies": { "Newtonsoft.Json": "13.0.3" }, "compile": { - "bin/placeholder/Trolley.NetCore.SDK.dll": {} + "bin/placeholder/trolleyhq.dll": {} }, "runtime": { - "bin/placeholder/Trolley.NetCore.SDK.dll": {} + "bin/placeholder/trolleyhq.dll": {} } } } @@ -1287,7 +1287,7 @@ "version.txt" ] }, - "Trolley.NetCore.SDK/1.0.11": { + "trolleyhq/2.0.0": { "type": "project", "path": "../trolley/trolley.csproj", "msbuildProject": "../trolley/trolley.csproj" @@ -1299,15 +1299,15 @@ "MSTest.TestFramework >= 3.1.1", "Microsoft.NET.Test.Sdk >= 17.8.0", "NETStandard.Library >= 2.0.3", - "Trolley.NetCore.SDK >= 1.0.11", - "coverlet.collector >= 6.0.0" + "coverlet.collector >= 6.0.0", + "trolleyhq >= 2.0.0" ], "net6.0": [ "MSTest.TestAdapter >= 3.1.1", "MSTest.TestFramework >= 3.1.1", "Microsoft.NET.Test.Sdk >= 17.8.0", - "Trolley.NetCore.SDK >= 1.0.11", - "coverlet.collector >= 6.0.0" + "coverlet.collector >= 6.0.0", + "trolleyhq >= 2.0.0" ] }, "packageFolders": { @@ -1316,11 +1316,11 @@ "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj", + "projectUniqueName": "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj", "projectName": "tests", - "projectPath": "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj", + "projectPath": "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj", "packagesPath": "/Users/amanalam/.nuget/packages/", - "outputPath": "/Users/amanalam/src/dotnet-sdk/tests/obj/", + "outputPath": "/Users/amanalam/src/sdk-dotnet/tests/obj/", "projectStyle": "PackageReference", "crossTargeting": true, "configFilePaths": [ @@ -1337,16 +1337,16 @@ "net6.0": { "targetAlias": "net6.0", "projectReferences": { - "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj": { - "projectPath": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj" + "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj": { + "projectPath": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj" } } }, "netstandard2.0": { "targetAlias": "netstandard2.0", "projectReferences": { - "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj": { - "projectPath": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj" + "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj": { + "projectPath": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj" } } } diff --git a/tests/obj/project.nuget.cache b/tests/obj/project.nuget.cache index 60e0d91..50ef533 100644 --- a/tests/obj/project.nuget.cache +++ b/tests/obj/project.nuget.cache @@ -1,8 +1,8 @@ { "version": 2, - "dgSpecHash": "Lsm0Yi+njzVgRz7gLbidBV9ZtKpCiPyu0migd7D1+9A0JQgTa+iDxzFxVGJNDFvmgSk1YPSmHHd9C+AMdFmF/Q==", + "dgSpecHash": "X3jTnN7umkp9cUHfI9G5tLSth99nA/GkUIQ17Np85PpN0Gea6Olto2VODPT58iG2EZ2TTHofnw5v9tHE8kZa/w==", "success": true, - "projectFilePath": "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj", + "projectFilePath": "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj", "expectedPackageFiles": [ "/Users/amanalam/.nuget/packages/coverlet.collector/6.0.0/coverlet.collector.6.0.0.nupkg.sha512", "/Users/amanalam/.nuget/packages/microsoft.codecoverage/17.8.0/microsoft.codecoverage.17.8.0.nupkg.sha512", diff --git a/tests/obj/tests.csproj.nuget.cache b/tests/obj/tests.csproj.nuget.cache deleted file mode 100644 index 2319fe8..0000000 --- a/tests/obj/tests.csproj.nuget.cache +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": 1, - "dgSpecHash": "gsftEAHuSF6PIjpGhVu+XFxeI3xO/HOPj/GHstfJVBoxvC9h7VlPOKAHEzOzUYC6aHYsh6P1blWFRKX6ZoI63Q==", - "success": true -} \ No newline at end of file diff --git a/tests/obj/tests.csproj.nuget.dgspec.json b/tests/obj/tests.csproj.nuget.dgspec.json index 66422f1..0aa8ddd 100644 --- a/tests/obj/tests.csproj.nuget.dgspec.json +++ b/tests/obj/tests.csproj.nuget.dgspec.json @@ -1,17 +1,17 @@ { "format": 1, "restore": { - "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj": {} + "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj": {} }, "projects": { - "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj": { + "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj": { "version": "1.0.0", "restore": { - "projectUniqueName": "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj", + "projectUniqueName": "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj", "projectName": "tests", - "projectPath": "/Users/amanalam/src/dotnet-sdk/tests/tests.csproj", + "projectPath": "/Users/amanalam/src/sdk-dotnet/tests/tests.csproj", "packagesPath": "/Users/amanalam/.nuget/packages/", - "outputPath": "/Users/amanalam/src/dotnet-sdk/tests/obj/", + "outputPath": "/Users/amanalam/src/sdk-dotnet/tests/obj/", "projectStyle": "PackageReference", "crossTargeting": true, "configFilePaths": [ @@ -28,16 +28,16 @@ "net6.0": { "targetAlias": "net6.0", "projectReferences": { - "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj": { - "projectPath": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj" + "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj": { + "projectPath": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj" } } }, "netstandard2.0": { "targetAlias": "netstandard2.0", "projectReferences": { - "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj": { - "projectPath": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj" + "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj": { + "projectPath": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj" } } } @@ -132,14 +132,14 @@ } } }, - "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj": { - "version": "1.0.11", + "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj": { + "version": "2.0.0", "restore": { - "projectUniqueName": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj", - "projectName": "Trolley.NetCore.SDK", - "projectPath": "/Users/amanalam/src/dotnet-sdk/trolley/trolley.csproj", + "projectUniqueName": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj", + "projectName": "trolleyhq", + "projectPath": "/Users/amanalam/src/sdk-dotnet/trolley/trolley.csproj", "packagesPath": "/Users/amanalam/.nuget/packages/", - "outputPath": "/Users/amanalam/src/dotnet-sdk/trolley/obj/", + "outputPath": "/Users/amanalam/src/sdk-dotnet/trolley/obj/", "projectStyle": "PackageReference", "crossTargeting": true, "configFilePaths": [ diff --git a/tests/obj/tests.csproj.nuget.g.props b/tests/obj/tests.csproj.nuget.g.props index ceacab8..276f151 100644 --- a/tests/obj/tests.csproj.nuget.g.props +++ b/tests/obj/tests.csproj.nuget.g.props @@ -7,7 +7,7 @@ /Users/amanalam/.nuget/packages/ /Users/amanalam/.nuget/packages/ PackageReference - 6.4.0 + 6.6.0 diff --git a/trolley/InvoicePaymentGateway.cs b/trolley/InvoicePaymentGateway.cs index 24c97c2..89b8097 100644 --- a/trolley/InvoicePaymentGateway.cs +++ b/trolley/InvoicePaymentGateway.cs @@ -5,6 +5,7 @@ using System; using Trolley.Types.Supporting; using System.Text; +using Trolley.JsonHelpers; namespace Trolley { @@ -31,13 +32,6 @@ public InvoicePayment Create(string batchId = null, params InvoicePaymentPart[] { string body = ""; - JsonSerializerSettings settings = new JsonSerializerSettings() - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - if (batchId != null) { var requestBody = new @@ -46,7 +40,7 @@ public InvoicePayment Create(string batchId = null, params InvoicePaymentPart[] ids = invoicePaymentParts }; - body = JsonConvert.SerializeObject(requestBody, settings); + body = JsonConvert.SerializeObject(requestBody, SerializerHelper.GetSerializerSettings()); } else { @@ -55,7 +49,7 @@ public InvoicePayment Create(string batchId = null, params InvoicePaymentPart[] ids = invoicePaymentParts }; - body = JsonConvert.SerializeObject(requestBody, settings); + body = JsonConvert.SerializeObject(requestBody, SerializerHelper.GetSerializerSettings()); } string endPoint = "/v1/invoices/payment/create/"; @@ -117,14 +111,7 @@ public bool Delete(string paymentId = null, params string[] invoiceLineIds) /// /// public InvoicePayments Search(string[] invoiceIds, string[] paymentIds, int page = 1, int pageSize = 10) - { - JsonSerializerSettings settings = new JsonSerializerSettings() - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - + { if (invoiceIds.Length == 0 && paymentIds.Length == 0) { throw new MissingFieldException("Either invoiceIds or paymentIds need to be set."); @@ -135,11 +122,11 @@ public InvoicePayments Search(string[] invoiceIds, string[] paymentIds, int page if (invoiceIds != null && invoiceIds.Length >= 0) { - builder.AppendFormat("\n\"invoiceIds\" : {0},", JsonConvert.SerializeObject(invoiceIds, settings)); + builder.AppendFormat("\n\"invoiceIds\" : {0},", JsonConvert.SerializeObject(invoiceIds, SerializerHelper.GetSerializerSettings())); } if (paymentIds != null && paymentIds.Length >= 0) { - builder.AppendFormat("\n\"paymentIds\" : {0},", JsonConvert.SerializeObject(paymentIds, settings)); + builder.AppendFormat("\n\"paymentIds\" : {0},", JsonConvert.SerializeObject(paymentIds, SerializerHelper.GetSerializerSettings())); } diff --git a/trolley/JsonHelpers/SerializerHelper.cs b/trolley/JsonHelpers/SerializerHelper.cs new file mode 100644 index 0000000..b556315 --- /dev/null +++ b/trolley/JsonHelpers/SerializerHelper.cs @@ -0,0 +1,26 @@ +using System; +using Newtonsoft.Json; +using Trolley.Converters; + +namespace Trolley.JsonHelpers +{ + public class SerializerHelper + { + public SerializerHelper() + { + } + + public static JsonSerializerSettings GetSerializerSettings() + { + return new JsonSerializerSettings + { + StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, + NullValueHandling = NullValueHandling.Ignore, + Formatting = Formatting.Indented, + DefaultValueHandling = DefaultValueHandling.Ignore, + Converters = { new NumberToStringConverter() } + }; + } + } +} + diff --git a/trolley/Properties/AssemblyInfo.cs b/trolley/Properties/AssemblyInfo.cs index 4be0ca5..aaf5837 100644 --- a/trolley/Properties/AssemblyInfo.cs +++ b/trolley/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.2.0")] -[assembly: AssemblyFileVersion("1.0.2.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] diff --git a/trolley/RecipientGateway.cs b/trolley/RecipientGateway.cs index 77fa751..bd30cb5 100644 --- a/trolley/RecipientGateway.cs +++ b/trolley/RecipientGateway.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System; using Trolley.Types.Supporting; +using Trolley.JsonHelpers; namespace Trolley { @@ -132,12 +133,7 @@ public bool Delete(params string[] recipientIds) { "ids", recipientIds } }; - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeHtml - }; - - string body = JsonConvert.SerializeObject(deleteBody, settings); + string body = JsonConvert.SerializeObject(deleteBody, SerializerHelper.GetSerializerSettings()); string endPoint = "/v1/recipients/"; string response = this.gateway.client.Delete(endPoint, body); return true; diff --git a/trolley/Types/Invoice.cs b/trolley/Types/Invoice.cs index d1cfc67..421c9a3 100644 --- a/trolley/Types/Invoice.cs +++ b/trolley/Types/Invoice.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System.Collections.Generic; +using Trolley.JsonHelpers; using Trolley.Types.Supporting; namespace Trolley.Types @@ -112,13 +113,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } /// diff --git a/trolley/Types/InvoiceLine.cs b/trolley/Types/InvoiceLine.cs index 4983a25..1378f76 100644 --- a/trolley/Types/InvoiceLine.cs +++ b/trolley/Types/InvoiceLine.cs @@ -2,6 +2,7 @@ using System; using Trolley.Types.Supporting; using Newtonsoft.Json; +using Trolley.JsonHelpers; namespace Trolley.Types { @@ -74,14 +75,8 @@ public override string ToString() public string ToJson() - { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - return JsonConvert.SerializeObject(this, settings); + { + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } } } diff --git a/trolley/Types/InvoicePayment.cs b/trolley/Types/InvoicePayment.cs index 8cca473..c3a24cd 100644 --- a/trolley/Types/InvoicePayment.cs +++ b/trolley/Types/InvoicePayment.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System.Collections.Generic; +using Trolley.JsonHelpers; using Trolley.Types.Supporting; namespace Trolley.Types @@ -71,13 +72,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } /// diff --git a/trolley/Types/OfflinePayment.cs b/trolley/Types/OfflinePayment.cs index 2e3f486..801b22c 100644 --- a/trolley/Types/OfflinePayment.cs +++ b/trolley/Types/OfflinePayment.cs @@ -1,10 +1,11 @@ using Trolley.Exceptions; using Trolley.Converters; using Newtonsoft.Json; -using System.Collections.Generic; -using System; -using Trolley.Types.Supporting; - +using System.Collections.Generic; +using System; +using Trolley.Types.Supporting; +using Trolley.JsonHelpers; + namespace Trolley.Types { /// @@ -14,70 +15,70 @@ namespace Trolley.Types public class OfflinePayment : ITrolleyMappable { - public string id; - public Recipient recipient; - public double amount; - public string currency; - public string withholdingAmount; - public string withholdingCurrency; - public string equivalentWithholdingAmount; - public string equivalentWithholdingCurrency; - public string externalId; - public string memo; - public List tags; - public string category; - public string processedAt; - public Amount enteredAmount; - public string updatedAt; - public string createdAt; - public string deletedAt; - - public OfflinePayment() { } - - /// - /// Offline Payment constructor - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [JsonConstructor] - public OfflinePayment(string id, Recipient recipient, double amount, string currency, - string withholdingAmount, string withholdingCurrency, string equivalentWithholdingAmount, - string equivalentWithholdingCurrency, string externalId, string memo, List tags, - string category, string processedAt, Amount enteredAmount, string updatedAt, - string createdAt, string deletedAt) - { - this.id = id; - this.recipient = recipient; - this.amount = amount; - this.currency = currency; - this.withholdingAmount = withholdingAmount; - this.withholdingCurrency = withholdingCurrency; - this.equivalentWithholdingAmount = equivalentWithholdingAmount; - this.equivalentWithholdingCurrency = equivalentWithholdingCurrency; - this.externalId = externalId; - this.memo = memo; - this.tags = tags; - this.category = category; - this.processedAt = processedAt; - this.enteredAmount = enteredAmount; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.deletedAt = deletedAt; + public string id; + public Recipient recipient; + public double amount; + public string currency; + public string withholdingAmount; + public string withholdingCurrency; + public string equivalentWithholdingAmount; + public string equivalentWithholdingCurrency; + public string externalId; + public string memo; + public List tags; + public string category; + public string processedAt; + public Amount enteredAmount; + public string updatedAt; + public string createdAt; + public string deletedAt; + + public OfflinePayment() { } + + /// + /// Offline Payment constructor + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [JsonConstructor] + public OfflinePayment(string id, Recipient recipient, double amount, string currency, + string withholdingAmount, string withholdingCurrency, string equivalentWithholdingAmount, + string equivalentWithholdingCurrency, string externalId, string memo, List tags, + string category, string processedAt, Amount enteredAmount, string updatedAt, + string createdAt, string deletedAt) + { + this.id = id; + this.recipient = recipient; + this.amount = amount; + this.currency = currency; + this.withholdingAmount = withholdingAmount; + this.withholdingCurrency = withholdingCurrency; + this.equivalentWithholdingAmount = equivalentWithholdingAmount; + this.equivalentWithholdingCurrency = equivalentWithholdingCurrency; + this.externalId = externalId; + this.memo = memo; + this.tags = tags; + this.category = category; + this.processedAt = processedAt; + this.enteredAmount = enteredAmount; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.deletedAt = deletedAt; } public static bool operator ==(OfflinePayment a, OfflinePayment b) @@ -138,16 +139,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore, - Formatting = Formatting.Indented, - Converters = { new NumberToStringConverter() } - }; - - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } /// diff --git a/trolley/Types/Payment.cs b/trolley/Types/Payment.cs index fd33c34..f045d53 100644 --- a/trolley/Types/Payment.cs +++ b/trolley/Types/Payment.cs @@ -2,6 +2,7 @@ using Trolley.Converters; using Newtonsoft.Json; using System.Collections.Generic; +using Trolley.JsonHelpers; namespace Trolley.Types { @@ -171,16 +172,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore, - Formatting = Formatting.Indented, - Converters = { new NumberToStringConverter() } - }; - - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } /// /// Function that checks if a ITrolleyMappable object has all required fields to be sent diff --git a/trolley/Types/Recipient.cs b/trolley/Types/Recipient.cs index 2a23625..d2f54b7 100644 --- a/trolley/Types/Recipient.cs +++ b/trolley/Types/Recipient.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System; using Trolley.Types.Supporting; +using Trolley.JsonHelpers; namespace Trolley.Types { @@ -158,13 +159,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } /// diff --git a/trolley/Types/RecipientAccount.cs b/trolley/Types/RecipientAccount.cs index 89cc6b5..f632303 100644 --- a/trolley/Types/RecipientAccount.cs +++ b/trolley/Types/RecipientAccount.cs @@ -1,6 +1,7 @@ using Trolley.Exceptions; using Newtonsoft.Json; - +using Trolley.JsonHelpers; + namespace Trolley.Types { /// @@ -154,14 +155,7 @@ public override string ToString() /// JSON string representation of the object public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented - }; - - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } } } diff --git a/trolley/Types/Supporting/Address.cs b/trolley/Types/Supporting/Address.cs index 007dda5..f7590a6 100644 --- a/trolley/Types/Supporting/Address.cs +++ b/trolley/Types/Supporting/Address.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System; +using Trolley.JsonHelpers; namespace Trolley.Types { @@ -219,25 +220,7 @@ public override string ToString() public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - /*StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented,*/ - }; - return JsonConvert.SerializeObject(this, settings); - - /*StringBuilder builder = new StringBuilder(); - builder.Append("{\n"); - builder.AppendFormat("\"street1\": \"{0}\",\n", this.street1); - builder.AppendFormat("\"street2\": \"{0}\",\n", this.street2); - builder.AppendFormat("\"city\": \"{0}\",\n", this.city); - builder.AppendFormat("\"postalCode\": \"{0}\",\n", this.postalCode); - builder.AppendFormat("\"phone\": \"{0}\",\n", this.phone); - builder.AppendFormat("\"country\": \"{0}\",\n", this.country); - builder.AppendFormat("\"region\": \"{0}\"\n", this.region); - builder.Append("}"); - return builder.ToString();*/ + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } public bool IsMappable() diff --git a/trolley/Types/Supporting/InvoicePaymentPart.cs b/trolley/Types/Supporting/InvoicePaymentPart.cs index ed470c5..2400533 100644 --- a/trolley/Types/Supporting/InvoicePaymentPart.cs +++ b/trolley/Types/Supporting/InvoicePaymentPart.cs @@ -1,5 +1,6 @@ using System; using Newtonsoft.Json; +using Trolley.JsonHelpers; namespace Trolley.Types.Supporting { @@ -47,14 +48,7 @@ public override string ToString() public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented, - }; - - return JsonConvert.SerializeObject(this, settings); + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } } } diff --git a/trolley/Types/Supporting/MailingAddress.cs b/trolley/Types/Supporting/MailingAddress.cs index be6ae0d..5b73b25 100644 --- a/trolley/Types/Supporting/MailingAddress.cs +++ b/trolley/Types/Supporting/MailingAddress.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System; +using Trolley.JsonHelpers; namespace Trolley.Types { @@ -221,25 +222,7 @@ public override string ToString() public string ToJson() { - JsonSerializerSettings settings = new JsonSerializerSettings - { - /*StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - Formatting = Formatting.Indented,*/ - }; - return JsonConvert.SerializeObject(this, settings); - - /*StringBuilder builder = new StringBuilder(); - builder.Append("{\n"); - builder.AppendFormat("\"street1\": \"{0}\",\n", this.street1); - builder.AppendFormat("\"street2\": \"{0}\",\n", this.street2); - builder.AppendFormat("\"city\": \"{0}\",\n", this.city); - builder.AppendFormat("\"postal\": \"{0}\",\n", this.postal); - builder.AppendFormat("\"phone\": \"{0}\",\n", this.phone); - builder.AppendFormat("\"country\": \"{0}\",\n", this.country); - builder.AppendFormat("\"region\": \"{0}\"\n", this.region); - builder.Append("}"); - return builder.ToString();*/ + return JsonConvert.SerializeObject(this, SerializerHelper.GetSerializerSettings()); } public bool IsMappable() diff --git a/trolley/trolley.csproj b/trolley/trolley.csproj index f753b27..1d5b2a8 100644 --- a/trolley/trolley.csproj +++ b/trolley/trolley.csproj @@ -15,7 +15,7 @@ false true 0 - 1.0.0.%2a + 2.0.0.0 false true false @@ -24,14 +24,14 @@ Trolley Trolley - Trolley.NetCore.SDK + trolleyhq true - 1.0.11 - The official Trolley NET Core and NET Standard SDK to interface with the Trolley API (https://www.trolley.com/) + 2.0.0 + The official Trolley .NET SDK to interface with the Trolley API (https://www.trolley.com/) Copyright 2020 Jesse Tremblay, Jesse Silber, Joshua Cunningham, Aman Aalam - netcore sdk PaymentRails Trolley - https://github.com/Trolley/dotnet-sdk/tree/netcore2.1 + Trolley net sdk PaymentRails + https://github.com/Trolley/dotnet-sdk/ Git MIT diff --git a/trolley/trolley.nuspec b/trolley/trolley.nuspec index d133e09..838d773 100644 --- a/trolley/trolley.nuspec +++ b/trolley/trolley.nuspec @@ -1,16 +1,16 @@ - Trolley.NetCore.SDK - 1.0.11 + trolleyhq + 2.0.0 $title$ Jesse Tremblay, Jesse Silber, Joshua Cunningham, Aman Aalam - PaymentRailsJesse, joshuapr + aman.trolley, trolley-developers, PaymentRailsJesse, joshuapr https://github.com/Trolley/dotnet-sdk false - The official Trolley NETCore SDK to interface with the Trolley API (https://www.trolley.com/) - Fixed issue with parsing double to String (Issue #6) + The official Trolley .NET SDK to interface with the Trolley API (https://www.trolley.com/) + Covered all APIs. Copyright 2020 - netcore sdk PaymentRails Trolley + Trolley net sdk PaymentRails \ No newline at end of file