Skip to content

Commit

Permalink
Bump version to 2.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Nov 20, 2024
1 parent 39325db commit e9c7d4a
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 2 deletions.
174 changes: 173 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The preferred method of installing BlockChyp is via cocoapods. Add the following
dependency to your Podfile and type `pod install`.

```
pod 'BlockChyp', '~> 2.19.0'
pod 'BlockChyp', '~> 2.20.1'
```

Note: If you're using Swift, you'll need to make sure dynamic frameworks are turned
Expand Down Expand Up @@ -630,6 +630,96 @@ class ExampleClass {



#### Card Metadata



* **API Credential Types:** Merchant
* **Required Role:** Payment API Access

This API allows you to retrieve card metadata.

Card metadata requests can use a payment terminal to retrieve metadata or
use a previously enrolled payment token.

**Terminal Transactions**

For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

**Token Transactions**

If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
property instead.

**Card Numbers and Mag Stripes**

You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
put you in PCI scope and the most common vector for POS breaches is keylogging.
If you use terminals for manual card entry, you'll bypass any keyloggers that
might be maliciously running on the point-of-sale system.



##### From Objective-C:

```objective-c
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>

int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
[client cardMetadataWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"success");
}
}];
[pool drain];
return 0;
}

```

##### From Swift:

```swift
import BlockChyp

class ExampleClass {

func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)

var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
client.cardMetadata(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("success")
}
})
}


```



#### Time Out Reversal


Expand Down Expand Up @@ -7239,6 +7329,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["merchantId"] = "<MERCHANT ID>"
[client merchantCredentialGenerationWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
Expand Down Expand Up @@ -7266,6 +7357,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
request["merchantId"] = "<MERCHANT ID>"
client.merchantCredentialGeneration(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
Expand All @@ -7279,6 +7371,86 @@ class ExampleClass {



#### Submit Application



* **API Credential Types:** Partner
* **Required Role:** INVITE MERCHANT

This is a partner level API that can be used to submit applications to add new merchant accounts. The application requires a significant amount of detailed information about the merchant and their business. Rather than providing an exhaustive list of required fields, we recommend submitting as much information as possible in your initial request.

If any required fields are missing or if there are any validation errors, the API will return specific error messages indicating which fields need to be addressed. Simply review these validation errors, fill in the missing information or correct any errors, and resubmit the application.

Key areas of information include:
- Business details (name, type, tax information)
- Contact information
- Address information (physical and mailing)
- Owner details
- Bank account information
- Transaction volume estimates
- Operational settings (timezone, batch close time, etc.)

**Note:** Some fields may be conditionally required based on the values of other fields. The validation process will guide you through ensuring all necessary information is provided.



##### From Objective-C:

```objective-c
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>

int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client submitApplicationWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}

```

##### From Swift:

```swift
import BlockChyp

class ExampleClass {

func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)

var request: [String:Any] = [:]
client.submitApplication(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}


```






Expand Down
24 changes: 24 additions & 0 deletions blockchyp-ios-examples/CardMetadataExample.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>

int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
[client cardMetadataWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"success");
}
}];
[pool drain];
return 0;
}
22 changes: 22 additions & 0 deletions blockchyp-ios-examples/CardMetadataExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import BlockChyp

class ExampleClass {

func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)

var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
client.cardMetadata(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("success")
}
})
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["merchantId"] = "<MERCHANT ID>"
[client merchantCredentialGenerationWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
request["merchantId"] = "<MERCHANT ID>"
client.merchantCredentialGeneration(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
Expand Down
22 changes: 22 additions & 0 deletions blockchyp-ios-examples/SubmitApplicationExample.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>

int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client submitApplicationWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
20 changes: 20 additions & 0 deletions blockchyp-ios-examples/SubmitApplicationExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import BlockChyp

class ExampleClass {

func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)

var request: [String:Any] = [:]
client.submitApplication(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}

2 changes: 1 addition & 1 deletion blockchyp-ios/BlockChyp.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "BlockChyp"
spec.version = "2.19.0"
spec.version = "2.20.1"
spec.summary = "BlockChyp SDK for iOS Developers."
spec.description = <<-DESC
This is the SDK for iOS. Like all BlockChyp SDKs, it provides a full
Expand Down
6 changes: 6 additions & 0 deletions blockchyp-ios/BlockChyp/BlockChyp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ NS_ASSUME_NONNULL_BEGIN
// Adds a new payment method to the token vault.
-(void)enrollWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Retrieves card metadata.
-(void)cardMetadataWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Activates or recharges a gift card.
-(void)giftActivateWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

Expand Down Expand Up @@ -177,6 +180,9 @@ NS_ASSUME_NONNULL_BEGIN
// Generates and returns api credentials for a given merchant.
-(void)merchantCredentialGenerationWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Submits and application to add a new merchant account.
-(void)submitApplicationWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Adds a test merchant account.
-(void)getMerchantsWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

Expand Down
15 changes: 15 additions & 0 deletions blockchyp-ios/BlockChyp/BlockChyp.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ -(void)enrollWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHan

}

// Retrieves card metadata.
-(void)cardMetadataWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler; {

[self routeTerminalRequestWith:request terminalPath:@"/api/card-metadata" gatewayPath:@"/api/card-metadata" method:@"POST" handler:handler];

}

// Activates or recharges a gift card.
-(void)giftActivateWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler; {

Expand Down Expand Up @@ -375,6 +382,14 @@ -(void)merchantCredentialGenerationWithRequest:(NSDictionary *)request handler:(
}


// Submits and application to add a new merchant account.
-(void)submitApplicationWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {

[self routeDashboardRequestWith:request path:@"/api/submit-application" method:@"POST" handler:handler];

}


// Adds a test merchant account.
-(void)getMerchantsWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {

Expand Down
Loading

0 comments on commit e9c7d4a

Please sign in to comment.