Code Monkey home page Code Monkey logo

pinpayments-dotnet's Introduction

PinPayments-dotnet

A simple .NET client for [Pin Payments][] REST API:

  • All Pin Payments methods (Charges, Customers, Refunds, Card Tokens)
  • Async versions of all methods
  • Uses RestSharp for the heavy lifting (a very well maintained REST API client) [Pin Payments]: https://pin.net.au/

Download

Get the [NuGet package][]. [NuGet package]: https://www.nuget.org/packages/PinPayments/

Documentation

Please see the [Pin Payments API documentation][] for details on each method. You will also find test cards that can be used. [Pin Payments API documentation]: https://pin.net.au/docs/api

Configuration

In your application configuration file, set the URL of the Pin Payments server and set the Secret Key that you have been assigned with your Pin Payments account.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="pinPaymentsApi" type="PinPayments.Config.PinPaymentsApiSection, PinPayments" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <pinPaymentsApi>
    <server baseUrl="https://test-api.pin.net.au" />
    <!-- TODO: put your secret key here -->
    <authentication secretKey="????"/>
  </pinPaymentsApi>
</configuration>

Basic Usage

This code will charge $95 to a specific Credit Card.

var card = new Card
{
    Number = "5520000000000000", // Good
    Cvc = "111",
    ExpiryMonth = 10,
    ExpiryYear = 2016,
    Name = "Gordon Bennet",
    AddressLine1 = "123 Kellogs St",
    AddressCity = "Perth",
    AddressPostcode = "6000",
    AddressState = "WA",
    AddressCountry = "Australia"
};

var charge = new Charge
{
    Amount = 9500, // $95.00
    Card = card,
    Capture = true, // authorise AND charge 
    Currency = "AUD",
    Description = "This is a description of the product, isn't it awesome.",
    Email = "[email protected]",
    IpAddress = "127.0.0.1"
};

var api = new PinPaymentsApi();
var response = api.CreateCharge(charge);

// TODO: process charge result

pinpayments-dotnet's People

Contributors

adesbro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

egoplacebo

pinpayments-dotnet's Issues

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.