/// <summary> /// Stores a transfer token without setting Transfer Destinations and instead providing /// a callback URL. /// </summary> /// <param name="payee">Payee Token member (the member requesting the transfer token be created)</param> /// <param name="setTransferDestinationsCallback">callback url.</param> /// <returns>token request id</returns> public static string StoreTransferTokenRequestWithDestinationsCallback( TppMember payee, string setTransferDestinationsCallback) { TokenRequest tokenRequest = TokenRequest.TransferTokenRequestBuilder(250, "EUR") .SetToMemberId(payee.MemberId()) .SetDescription("Book purchase") // This TPP provided url gets called by Token after the user selects bank and // country on the Token web app. .SetSetTransferDestinationsUrl(setTransferDestinationsCallback) // This TPP provided Redirect URL gets called after Token is ready // for redemption. .SetRedirectUrl("https://tpp-sample.com/callback") .SetFromAlias(new Alias { Value = "*****@*****.**", Type = Alias.Types.Type.Email }) .SetBankId("iron") // bank ID .SetCsrfToken(Util.Nonce()) // nonce for CSRF check .Build(); string requestId = payee.StoreTokenRequestBlocking(tokenRequest); return(requestId); }
/// <summary> /// Stores a transfer token request. /// </summary> /// <param name="payee">Payee Token member (the member requesting the transfer token be created)</param> /// <returns>a token request id</returns> public static string StoreTransferTokenRequest(TppMember payee) { // Create token request to be stored TokenRequest request = TokenRequest.TransferTokenRequestBuilder(100, "EUR") .SetToMemberId(payee.MemberId()) .SetDescription("Book purchase") // optional description .SetRedirectUrl("https://token.io/callback") // callback URL .SetFromAlias(new Alias { Value = "*****@*****.**", Type = Alias.Types.Type.Email }) .SetBankId("iron") // bank ID .SetCsrfToken(Util.Nonce()) // nonce for CSRF check .Build(); // Store token request return(payee.StoreTokenRequestBlocking(request)); }