//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>This Init function prepares the Mobile Originated SMS functional block, to work /// as an untrusted client. /// It calls the base Init function, wich creates the Bluevia Connector and /// sets the operational mode. /// Then creates itself the api url, the parsers and serializers that the /// service petition's process needs</summary> /// <param name="mode"> The Bluevia Mode enumerator, that describes the /// operational behavior of the client: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest"> LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The application Identifier.</param> /// <param name="consumerSecret">The application Secret.</param> /// <param name="token">Optional (Mandatory for 3legged behavior): The final customer Identifier.</param> /// <param name="tokenSecret">Optional (Mandatory for 3legged behavior): The final customer Secret.</param> //////////////////////////////////////////////////////////////////////////////////////////////////// protected new void InitUntrusted(BVMode mode , string consumer, string consumerSecret , string token = "", string tokenSecret = "") { base.InitUntrusted(mode, consumer, consumerSecret, token, tokenSecret); InitApiUrlAndObjects(); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>This Init function prepares the Mobile Originated SMS functional block, to work /// as a trusted client. /// It calls the base Init function, wich creates the SSL client's certificate, the Bluevia Connector and /// sets the operational mode. /// Then creates itself the api url, the parsers and serializers that the /// service petition's process needs</summary> /// <param name="mode"> The Bluevia Mode enumerator, that describes the /// operational behavior of the client: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest"> LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The application Identifier.</param> /// <param name="consumerSecret">The application Secret.</param> /// <param name="certPath">The path to the ssl client's pem certificate.</param> /// <param name="certPasswd">Optional (only if needed): The password of the ssl client's pem certificate.</param> //////////////////////////////////////////////////////////////////////////////////////////////////// protected new void InitTrusted(BVMode mode , string consumer, string consumerSecret , string certPath, string certPasswd = "") { base.InitTrusted(mode, consumer, consumerSecret, certPath, certPasswd); InitApiUrlAndObjects(); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>This Init function prepares the Client, to work as a trusted client. /// It calls the base Init function, wich creates the Bluevia Connector and /// sets the operational mode. /// Then concatenates itself the MO string in the service url.</summary> /// <param name="mode"> The Bluevia Mode enumerator, that describes the /// operational behavior of the client: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest"> LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The application Identifier.</param> /// <param name="consumerSecret">The application Secret.</param> /// <param name="token">Optional (Mandatory for 3legged behavior): The final customer Identifier.</param> /// <param name="tokenSecret">Optional (Mandatory for 3legged behavior): The final customer Secret.</param> //////////////////////////////////////////////////////////////////////////////////////////////////// protected new void InitUntrusted(BVMode mode , string consumer, string consumerSecret, string token = "", string tokenSecret = "") { base.InitUntrusted(mode, consumer, consumerSecret); url = string.Format(url, Messagery.Constants.serviceMO); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>This Init function prepares the Client, to work as a trusted client. /// It calls the base Init function, wich creates the SSL client's certificate, the Bluevia Connector and /// sets the operational mode. /// Then concatenates itself the MO string in the service url.</summary> /// <param name="mode"> The Bluevia Mode enumerator, that describes the /// operational behavior of the client: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest"> LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The application Identifier.</param> /// <param name="consumerSecret">The application Secret.</param> /// <param name="certPath">The path to the ssl client's pem certificate.</param> /// <param name="certPasswd">Optional (only if needed): The password of the ssl client's pem certificate.</param> //////////////////////////////////////////////////////////////////////////////////////////////////// protected new void InitTrusted(BVMode mode , string consumer, string consumerSecret , string certPath, string certPasswd = "") { base.InitTrusted(mode, consumer, consumerSecret, certPath, certPasswd); url = string.Format(url, Messagery.Constants.serviceMO); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>Initializes a new instance of the <see cref="BV_MTMMS"/>.3 Legged Constructor</summary> /// <param name="mode">The Bluevia operation mode: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest">LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The appplication Identifier</param> /// <param name="consumerSecret">The application Secret</param> /// <param name="token">The final customer Identifier</param> /// <param name="tokenSecret">The final customer Secret</param> //////////////////////////////////////////////////////////////////////////////////////////////////// public BV_MTMMS(BVMode mode, string consumer, string consumerSecret, string token, string tokenSecret) { if (string.IsNullOrWhiteSpace(token) || string.IsNullOrWhiteSpace(tokenSecret)) { throw new Bluevia.Core.Schemas.BlueviaException( "Null or Empty tokens when creating MTMMS Client. Two legged mode is not available in MTMMS." , Bluevia.Core.Schemas.ExceptionCode.InvalidArgumentException); } InitUntrusted(mode, consumer, consumerSecret, token, tokenSecret); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>Initializes a new instance of the <see cref="BV_OAuth"/>. 2 and 3 Legged Constructor</summary> /// <param name="mode">The Bluevia operation mode: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest">LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The appplication Identifier</param> /// <param name="consumerSecret">The application Secret</param> /// <param name="token">Optional: The final customer Identifier</param> /// <param name="tokenSecret">Optional: The final customer Secret</param> //////////////////////////////////////////////////////////////////////////////////////////////////// public BV_Payment(BVMode mode, string consumer, string consumerSecret, string token = "", string tokenSecret = "") { if (mode == BVMode.TEST) { throw new BlueviaException("Payment is not available on TEST MODE." , ExceptionCode.InvalidModeException); } InitUntrusted(mode, consumer, consumerSecret, token, tokenSecret); InitApiUrlAndObjects(); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>Initializes a new instance of the <see cref="BV_MOMMS"/>.2 Legged Constructor</summary> /// <param name="mode">The Bluevia operation mode: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest">LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The appplication Identifier</param> /// <param name="consumerSecret">The application Secret</param> //////////////////////////////////////////////////////////////////////////////////////////////////// public BV_MOMMS(BVMode mode, string consumer, string consumerSecret) { InitUntrusted(mode, consumer, consumerSecret, "", ""); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary>Initializes a new instance of the <see cref="BV_OAuth"/>.2 and 3 Legged Constructor</summary> /// <param name="mode">The Bluevia operation mode: <a href="https://www.bluevia.com/en/page/tech.howto.tut_APPtest">LIVE, TEST, SANDBOX.</a></param> /// <param name="consumer">The appplication Identifier</param> /// <param name="consumerSecret">The application Secret</param> /// <param name="token">Optional: The final customer Identifier</param> /// <param name="tokenSecret">Optional: The final customer Secret</param> //////////////////////////////////////////////////////////////////////////////////////////////////// public BV_OAuth(BVMode mode, string consumer, string consumerSecret, string token = "", string tokenSecret ="") { InitUntrusted(mode, consumer, consumerSecret, token, tokenSecret); }