GithubHelp home page GithubHelp logo

ineszetter / bbva-csharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ecommercebbva/bbva-csharp

0.0 1.0 0.0 4.43 MB

EcommerceBBVA: C#SHARP Library

License: Apache License 2.0

C# 100.00%

bbva-csharp's Introduction

Bbva NET Build status

This is a client implementing the payment services for Bbva at bbva.mx

Compatibility

  • .Net Framework 4.5 or later

Dependencies

Quick Start

Installation

It is recommended that you use NuGet for install this library. Or you can fork the code and build it.

Configuration

Before use the library will be necessary to set up your Merchant ID and Private key. Use:

BbvaAPI bbvaAPI = new BbvaAPI(API_KEY, MERCHANT_ID);

Sandbox/Production Mode

By convenience and security, the sandbox mode is activated by default in the client library. This allows you to test your own code when implementing Bbva, before charging any credit card in production environment. Once you have finished your integration, create BbvaAPI object like this:

Boolean production = true;
BbvaAPI bbvaAPI = new BbvaAPI(API_KEY, MERCHANT_ID, production);

or use Production property:

BbvaAPI bbvaAPI = new BbvaAPI(API_KEY, MERCHANT_ID);
bbvaAPI.Production = true;

API Services

Once configured the library, you can use it to interact with Bbva API services. All the API services are properties of the BbvaAPI class.

bbvaAPI.ChargeTokenService
bbvaAPI.TokenService

Each service has methods to create, get, update, delete or list resources according to the documetation described on http://docs.bbva.mx

Examples

Charges

Create a charge

BbvaAPI api = new BbvaAPI("sk_326c6d0443f6457aae29ffbd48f7d1be", "mptdggroasfcmqs8plpy");

ParameterContainer customer = new ParameterContainer("customer");
    customer.AddValue("name", "Juan");
    customer.AddValue("last_name", "Vazquez Juarez");
    customer.AddValue("email", "[email protected]");
    customer.AddValue("phone_number", "554-170-3567");

ParameterContainer request = new ParameterContainer("charge");
    request.AddValue("affiliation_bbva", "781500");
    request.AddValue("amount", "100.00");
    request.AddValue("description", "Cargo inicial a mi merchant");
    request.AddValue("currency", "MXN");
    request.AddValue("order_id", "oid-00051");
    request.AddValue("redirect_url", "https://sand-portal.ecommercebbva.com");
    request.AddMultiValue(customer):

Dictionary<String, Object> chargeDictionary = bbvaAPI.ChargeService.Create(request.ParameterValues);
ParameterContainer charge = new ParameterContainer("charge", chargeDictionary);

bbva-csharp's People

Contributors

ecommercebbva avatar mguevara-openpay avatar juanurbina62 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.