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 6, 2024
1 parent 0bc841a commit e6a36fb
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 2 deletions.
92 changes: 91 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.25.23'
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
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")
}
})
}

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.18.8"
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
3 changes: 3 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
7 changes: 7 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

0 comments on commit e6a36fb

Please sign in to comment.