* Web.config: * ListItem.cs: * styles.json: * globalize.js: * event.js: * Auth.aspx: * Book.aspx: * Login.aspx: * jquery-2.1.4.js: * map-load.gif: * Book.aspx: * Circle.cs: * Auth.aspx: * mapstyle.css: * date.js: * Login.aspx: * mdd_help.htm: * BlogHelper.cs: * fit-bounds.png: * unresolved.js: * jquery-2.1.4.min.js: * mapstyle-ie.css: * FreeDate.cs: * BookEdit.cs: * number.js: * BlogManager.cs: * plural.js: * jquery-2.1.4.min.map: * jquery.googlemaps.js: * supplemental.js: * BlogProvider.cs: * mapstyle.min.css: * pin-pink.png: * message.js: * ChooseADate.aspx: * pin-azure.png: * currency.js: * jquery-2.1.4-vsdoc.js: * pin-green.png: * MarkdownDeepLib.min.js: * flag-azure.png: * flag-green.png: * needle-pink.png: * ChooseADate.aspx: * niddle-green.png: * ChooseCalendar.aspx: * current-location.png: * jquery.googlemaps.min.js: * ErrorMessage.aspx: * ChooseCalendar.aspx: * relative-time.js: * GoogleErrorMessage.aspx: * popup-template-marker.html: * popup-template-circle.html: * popup-template-polygon.html: * popup-template-polyline.html: * popup-template-rectangle.html: * Web.csproj: * YavscModel.csproj: * YavscClient.csproj: * fortune.csproj: * WebControls.csproj: * SalesCatalog.csproj: * ITContentProvider.csproj: * NpgsqlMRPProviders.csproj: * NpgsqlBlogProvider.csproj: * NpgsqlContentProvider.csproj: Moves to Mono framework * NpgsqlCircleProvider.cs: Makes Circles private, or not * OAuth2.cs: * CircleController.cs: * AccountController.cs: * NpgsqlContentProvider.cs: Impacts htmldoc * NpgsqlMembershipProvider.cs: Makes possible to change the UserName * NpgsqlRoleProvider.cs: Drops this SQL code, which is actually maintained in Web/instdbws.sql * PeopleApi.cs: * GoogleController.cs: * PaypalController.cs: Refactoring * Global.asax.cs: Dropped an useless url mapping * MarkdownHelper.cs: Package update * App.master: * NoLogin.master: Site's favicon update * Circles.aspx: TO BE FIXED :-D * UserPost.aspx: Comment only when logged in * instdbws.sql: Circle public * packages.config: package update
77 lines
2.5 KiB
C#
77 lines
2.5 KiB
C#
//
|
|
// PaypalApiController.cs
|
|
//
|
|
// Author:
|
|
// Paul Schneider <paulschneider@free.fr>
|
|
//
|
|
// Copyright (c) 2015 Paul Schneider
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
using System;
|
|
using System.Web.Http;
|
|
|
|
|
|
using PayPal;
|
|
using System.Collections.Generic;
|
|
using PayPal.OpenIdConnect;
|
|
using PayPal.Manager;
|
|
using PayPal.PayPalAPIInterfaceService;
|
|
using PayPal.PayPalAPIInterfaceService.Model;
|
|
|
|
namespace Yavsc.ApiControllers
|
|
{
|
|
/// <summary>
|
|
/// Paypal API controller.
|
|
/// </summary>
|
|
public class PaypalController: ApiController
|
|
{
|
|
PayPalAPIInterfaceServiceService service = null;
|
|
/// <summary>
|
|
/// Initialize the specified controllerContext.
|
|
/// </summary>
|
|
/// <param name="controllerContext">Controller context.</param>
|
|
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
|
|
{
|
|
base.Initialize (controllerContext);
|
|
// Get the config properties from PayPal.Api.ConfigManager
|
|
// Create the Classic SDK service instance to use.
|
|
service = new PayPalAPIInterfaceServiceService(ConfigManager.Instance.GetProperties());
|
|
}
|
|
/// <summary>
|
|
/// Search the specified str.
|
|
/// </summary>
|
|
/// <param name="str">str.</param>
|
|
public BMCreateButtonResponseType Create(string str)
|
|
{
|
|
BMCreateButtonRequestType btcrerqu = new BMCreateButtonRequestType ();
|
|
BMCreateButtonReq btcrerq = new BMCreateButtonReq ();
|
|
btcrerq.BMCreateButtonRequest = btcrerqu;
|
|
BMCreateButtonResponseType btcrere = service.BMCreateButton (btcrerq);
|
|
return btcrere;
|
|
}
|
|
/// <summary>
|
|
/// Search the specified str.
|
|
/// </summary>
|
|
/// <param name="str">String.</param>
|
|
public BMButtonSearchResponseType Search(string str)
|
|
{
|
|
BMButtonSearchReq req = new BMButtonSearchReq ();
|
|
req.BMButtonSearchRequest = new BMButtonSearchRequestType ();
|
|
|
|
return service.BMButtonSearch (req);
|
|
}
|
|
}
|
|
|
|
}
|
|
|