-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd211de
commit 4db8579
Showing
8 changed files
with
274 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
blockchyp "github.com/blockchyp/blockchyp-go/v2" | ||
) | ||
|
||
func addGatewayMerchantExample() { | ||
// sample credentials | ||
creds := blockchyp.APICredentials{ | ||
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q", | ||
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U", | ||
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947", | ||
} | ||
|
||
// instantiate the client | ||
client := blockchyp.NewClient(creds) | ||
|
||
// setup request object | ||
request := blockchyp.AddGatewayMerchantRequest{ | ||
Profile: blockchyp.MerchantProfile{ | ||
DBAName: "DBA Name", | ||
CompanyName: "Corporate Entity Name", | ||
}, | ||
} | ||
|
||
response, err := client.AddGatewayMerchant(request) | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
//process the result | ||
if response.Success { | ||
fmt.Println("Success") | ||
} | ||
|
||
fmt.Printf("Response: %+v\n", response) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//go:build integration | ||
// +build integration | ||
|
||
// Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code | ||
// is governed by a license that can be found in the LICENSE file. | ||
// | ||
// This file was generated automatically by the BlockChyp SDK Generator. | ||
// Changes to this file will be lost every time the code is regenerated. | ||
|
||
package itests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
blockchyp "github.com/blockchyp/blockchyp-go/v2" | ||
) | ||
|
||
func TestAddGatewayMerchant(t *testing.T) { | ||
assert := assert.New(t) | ||
|
||
config := loadTestConfiguration(t) | ||
client := config.newTestClient(t, "partner") | ||
|
||
// setup request object | ||
request := blockchyp.AddGatewayMerchantRequest{ | ||
Profile: blockchyp.MerchantProfile{ | ||
DBAName: "DBA Name", | ||
CompanyName: "Corporate Entity Name", | ||
}, | ||
} | ||
|
||
logObj(t, "Request:", request) | ||
|
||
response, err := client.AddGatewayMerchant(request) | ||
|
||
assert.NoError(err) | ||
|
||
logObj(t, "Response:", response) | ||
|
||
// response assertions | ||
assert.True(response.Success) | ||
} |