Skip to content

Commit

Permalink
Merge pull request #1035 from Shopify/develop
Browse files Browse the repository at this point in the history
SDK 3.6.1
  • Loading branch information
tristan-potter committed Oct 11, 2019
2 parents f0ee1ed + 0455a9c commit 6f3cff9
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
language: swift
osx_image: xcode10.2
osx_image: xcode11

before_install:
- gem install xcpretty
Expand Down
32 changes: 16 additions & 16 deletions Buy.xcodeproj/project.pbxproj
Expand Up @@ -2408,11 +2408,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Pay/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2433,11 +2433,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Pay/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -2486,11 +2486,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2514,11 +2514,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -2656,11 +2656,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2678,11 +2678,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2701,11 +2701,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2730,11 +2730,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.6.0;
CURRENT_PROJECT_VERSION = 3.6.1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.5.3;
DYLIB_CURRENT_VERSION = 3.6.1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion Buy/Client/Graph.Client.swift
Expand Up @@ -83,7 +83,7 @@ extension Graph {
public init(shopDomain: String, apiKey: String, session: URLSession = URLSession(configuration: URLSessionConfiguration.default)) {

let shopURL = Client.urlFor(shopDomain)
self.apiURL = Client.urlFor(shopDomain, path: "/api/2019-07/graphql")
self.apiURL = Client.urlFor(shopDomain, path: "/api/2019-10/graphql")
self.cache = Cache(shopName: shopDomain)
self.session = session
self.headers = [
Expand Down
4 changes: 2 additions & 2 deletions Buy/Generated/Storefront/CountryCode.swift
Expand Up @@ -446,7 +446,7 @@ extension Storefront {
/// Madagascar.
case mg = "MG"

/// Macedonia, Republic Of.
/// North Macedonia.
case mk = "MK"

/// Mali.
Expand Down Expand Up @@ -644,7 +644,7 @@ extension Storefront {
/// Syria.
case sy = "SY"

/// Swaziland.
/// Eswatini.
case sz = "SZ"

/// Turks and Caicos Islands.
Expand Down
21 changes: 21 additions & 0 deletions Buy/Generated/Storefront/CurrencyCode.swift
Expand Up @@ -132,6 +132,9 @@ extension Storefront {
/// Czech Koruny (CZK).
case czk = "CZK"

/// Djiboutian Franc (DJF).
case djf = "DJF"

/// Danish Kroner (DKK).
case dkk = "DKK"

Expand Down Expand Up @@ -165,6 +168,9 @@ extension Storefront {
/// Gambian Dalasi (GMD).
case gmd = "GMD"

/// Guinean Franc (GNF).
case gnf = "GNF"

/// Guatemalan Quetzal (GTQ).
case gtq = "GTQ"

Expand Down Expand Up @@ -198,6 +204,9 @@ extension Storefront {
/// Iraqi Dinar (IQD).
case iqd = "IQD"

/// Iranian Rial (IRR).
case irr = "IRR"

/// Icelandic Kronur (ISK).
case isk = "ISK"

Expand Down Expand Up @@ -258,6 +267,9 @@ extension Storefront {
/// Latvian Lati (LVL).
case lvl = "LVL"

/// Libyan Dinar (LYD).
case lyd = "LYD"

/// Moroccan Dirham.
case mad = "MAD"

Expand Down Expand Up @@ -372,6 +384,9 @@ extension Storefront {
/// Singapore Dollars (SGD).
case sgd = "SGD"

/// Sierra Leonean Leone (SLL).
case sll = "SLL"

/// Surinamese Dollar (SRD).
case srd = "SRD"

Expand All @@ -390,12 +405,18 @@ extension Storefront {
/// Thai baht (THB).
case thb = "THB"

/// Tajikistani Somoni (TJS).
case tjs = "TJS"

/// Turkmenistani Manat (TMT).
case tmt = "TMT"

/// Tunisian Dinar (TND).
case tnd = "TND"

/// Tongan Pa'anga (TOP).
case top = "TOP"

/// Turkish Lira (TRY).
case `try` = "TRY"

Expand Down
16 changes: 14 additions & 2 deletions Buy/Generated/Storefront/Mutation.swift
Expand Up @@ -83,6 +83,9 @@ extension Storefront {
return self
}

/// Completes a checkout without providing payment information. You can use
/// this mutation for free items or items whose purchase price is covered by a
/// gift card.
///
/// - parameters:
/// - checkoutId: The ID of the checkout.
Expand Down Expand Up @@ -126,7 +129,10 @@ extension Storefront {
return self
}

/// Completes a checkout using a credit card token from Shopify's Vault.
/// Completes a checkout using a credit card token from Shopify's card vault.
/// Before you can complete checkouts using CheckoutCompleteWithCreditCardV2,
/// you need to [_request payment
/// processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing).
///
/// - parameters:
/// - checkoutId: The ID of the checkout.
Expand Down Expand Up @@ -1300,6 +1306,9 @@ extension Storefront {
return field(field: "checkoutAttributesUpdateV2", aliasSuffix: alias) as! Storefront.CheckoutAttributesUpdateV2Payload?
}

/// Completes a checkout without providing payment information. You can use
/// this mutation for free items or items whose purchase price is covered by a
/// gift card.
open var checkoutCompleteFree: Storefront.CheckoutCompleteFreePayload? {
return internalGetCheckoutCompleteFree()
}
Expand Down Expand Up @@ -1328,7 +1337,10 @@ extension Storefront {
return field(field: "checkoutCompleteWithCreditCard", aliasSuffix: alias) as! Storefront.CheckoutCompleteWithCreditCardPayload?
}

/// Completes a checkout using a credit card token from Shopify's Vault.
/// Completes a checkout using a credit card token from Shopify's card vault.
/// Before you can complete checkouts using CheckoutCompleteWithCreditCardV2,
/// you need to [_request payment
/// processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing).
open var checkoutCompleteWithCreditCardV2: Storefront.CheckoutCompleteWithCreditCardV2Payload? {
return internalGetCheckoutCompleteWithCreditCardV2()
}
Expand Down
29 changes: 27 additions & 2 deletions Buy/Generated/Storefront/Payment.swift
Expand Up @@ -79,7 +79,7 @@ extension Storefront {
return self
}

/// An message describing a processing error during asynchronous processing.
/// A message describing a processing error during asynchronous processing.
@discardableResult
open func errorMessage(alias: String? = nil) -> PaymentQuery {
addField(field: "errorMessage", aliasSuffix: alias)
Expand All @@ -101,6 +101,14 @@ extension Storefront {
return self
}

/// The URL where the customer needs to be redirected so they can complete the
/// 3D Secure payment flow.
@discardableResult
open func nextActionUrl(alias: String? = nil) -> PaymentQuery {
addField(field: "nextActionUrl", aliasSuffix: alias)
return self
}

/// Whether or not the payment is still processing asynchronously.
@discardableResult
open func ready(alias: String? = nil) -> PaymentQuery {
Expand Down Expand Up @@ -187,6 +195,13 @@ extension Storefront {
}
return value

case "nextActionUrl":
if value is NSNull { return nil }
guard let value = value as? String else {
throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue)
}
return URL(string: value)!

case "ready":
guard let value = value as? Bool else {
throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue)
Expand Down Expand Up @@ -257,7 +272,7 @@ extension Storefront {
return field(field: "creditCard", aliasSuffix: alias) as! Storefront.CreditCard?
}

/// An message describing a processing error during asynchronous processing.
/// A message describing a processing error during asynchronous processing.
open var errorMessage: String? {
return internalGetErrorMessage()
}
Expand Down Expand Up @@ -285,6 +300,16 @@ extension Storefront {
return field(field: "idempotencyKey", aliasSuffix: alias) as! String?
}

/// The URL where the customer needs to be redirected so they can complete the
/// 3D Secure payment flow.
open var nextActionUrl: URL? {
return internalGetNextActionUrl()
}

func internalGetNextActionUrl(alias: String? = nil) -> URL? {
return field(field: "nextActionUrl", aliasSuffix: alias) as! URL?
}

/// Whether or not the payment is still processing asynchronously.
open var ready: Bool {
return internalGetReady()
Expand Down
4 changes: 2 additions & 2 deletions Buy/Generated/Storefront/Product.swift
Expand Up @@ -35,7 +35,7 @@ extension Storefront {
open class ProductQuery: GraphQL.AbstractQuery, GraphQLQuery {
public typealias Response = Product

/// Whether the product is available on the Online Store channel and in stock.
/// Indicates if at least one product variant is available for sale.
@discardableResult
open func availableForSale(alias: String? = nil) -> ProductQuery {
addField(field: "availableForSale", aliasSuffix: alias)
Expand Down Expand Up @@ -624,7 +624,7 @@ extension Storefront {
}
}

/// Whether the product is available on the Online Store channel and in stock.
/// Indicates if at least one product variant is available for sale.
open var availableForSale: Bool {
return internalGetAvailableForSale()
}
Expand Down
2 changes: 1 addition & 1 deletion BuyTests/Client/Graph.ClientTests.swift
Expand Up @@ -38,7 +38,7 @@ class Graph_ClientTests: XCTestCase {
func testInit() {
let client = self.defaultClient()

XCTAssertEqual(client.apiURL.absoluteString, "https://\(self.shopDomain)/api/2019-07/graphql")
XCTAssertEqual(client.apiURL.absoluteString, "https://\(self.shopDomain)/api/2019-10/graphql")
XCTAssertEqual(client.cachePolicy, .networkOnly)
}

Expand Down
2 changes: 1 addition & 1 deletion Mobile-Buy-SDK.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'Mobile-Buy-SDK'
s.version = '3.6.0'
s.version = '3.6.1'
s.summary = 'Create custom Shopify storefront on iOS.'
s.description = 'Shopify’s Mobile Buy SDK makes it simple to create custom storefronts in your mobile app. Utitlizing the power and flexibility of GraphQL you can build native storefront experiences using the Shopify platform.'
s.homepage = 'https://github.com/Shopify/mobile-buy-sdk-ios'
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -1228,6 +1228,10 @@ let task = client.mutateGraphWith(mutation) { result, error in
task.resume()
```

**3D Secure Checkout**

To implement 3D secure on your checkout flow, see [the API Help Docs](https://help.shopify.com/en/api/guides/3d-secure#graphql-storefront-api-changes).

###### Apple Pay checkout [](#table-of-contents)

**IMPORTANT**: Before completing the checkout with an Apple Pay token you should ensure that your checkout is updated with the latests shipping address provided by `paySession(_:didAuthorizePayment:checkout:completeTransaction:)` delegate callback. If you've previously set a partial shipping address on the checkout for obtaining shipping rates, **the current checkout, as is, will not complete successfully**. You must update the checkout with the full address that includes address lines and a complete zip or postal code.
Expand Down
2 changes: 1 addition & 1 deletion Scripts/setup_simulator
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice com.apple.CoreSimulator.SimDeviceType.iPhone-7 com.apple.CoreSimulator.SimRuntime.iOS-11-3)
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-13-0)
export CURRENT_SIMULATOR_UUID
2 changes: 1 addition & 1 deletion Scripts/update_schema
Expand Up @@ -8,7 +8,7 @@ require 'graphql_schema'
require 'graphql_swift_gen'

shared_storefront_api_key = "4a6c829ec3cb12ef9004bf8ed27adf12"
storefront_api_version = "2019-07"
storefront_api_version = "2019-10"
endpoint = URI("https://app.shopify.com/services/graphql/introspection/storefront?api_client_api_key=#{shared_storefront_api_key}&api_version=#{storefront_api_version}")
body = Net::HTTP.get(endpoint)
schema = GraphQLSchema.new(JSON.parse(body))
Expand Down

0 comments on commit 6f3cff9

Please sign in to comment.