Skip to content

SelectSystemsInternational/Zip.co-NZ-MerchantApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zip.co/NZ MerchantApi - C# Library for the Merchant API

Zip.co New Zealand Merchant API Initial build

This C# SDK was based on the Zip.co Australia C# Library and modified for the different stack used for https://zip.co/nz

  • API version: 2020-10-24
  • SDK version: 1.0.0
  • Original Build package: io.swagger.codegen.languages.CSharpClientCodegen
  • Developed by Select Systems International

Frameworks supported

  • .netCore 3.1 or later

Dependencies

Installation

Download Zip and Include Directories from MerchantApi in your Project

using MerchantApi.Api; using MerchantApi.Model;

Getting Started

using System;
using System.Diagnostics;
using MerchantApi.Api;
using MerchantApi.Model;

namespace MerchantApi.Example
{
    /// <summary>
    ///  Class for testing OrdersApi

    public class ApiExample
    {
        AuthorizationApi authorizationApi;
        OrdersApi ordersApi;

        public void main()
        { 
            // Configure API key authorization, get an Access Token, Create an Order, Get an Order

            try
            {
                // Setup Authorization
                authorizationApi = new AuthorizationApi("https://merchant-auth-nz.sandbox.zip.co");
                authorizationApi.Configuration.ClientId = "Your Client Id";
                authorizationApi.Configuration.ClientSecret = "Your Client Secret";

                // Create Acces Token
                var authorization = authorizationApi.AuthorizationCreateToken();
                Debug.WriteLine(authorization);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthorizationApi: " + e.Message );
            }
	        
            try
            {
                // Create Order
		ordersApi = new OrdersApi("https://sandbox.zip.co/nz/api");
                var createOrderRequest = CreateRequest(CreateOrderRequest.PaymentFlowEnum.Payment);
                var authorization = authorizationApi.AuthorizationCreateToken();

                // Create Order
                var createOrderResponse = ordersApi.OrderCreate(authorization, "Idempotency-Key", createOrderRequest);
                Debug.WriteLine(createOrderResponse);
		
		// Get Order
		var id = createOrderResponse.OrderId;
                var order = ordersApi.OrderGet(id);
                Debug.WriteLine(order);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling OrdersApi: " + e.Message);
            }
        }
    }
}

Documentation for API Endpoints

https://docs-nz.zip.co/merchant-api/api-reference

Status of Library

This is the inital build and is not yet complete:

  • Still to add Customer endpoints

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages