1

iOS アプリで Apple Pay とストライプを統合しようとしています。ストライプによって提供される ApplePayStub を使用して、DEBUG モードで Apple Pay を確認する

git の最新のストライプApplePayStubコードを使用しています

iPhone 6シミュレーターで実行しようとしており、使用しているコードは次のとおりです。

paymentController = [[STPTestPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
((STPTestPaymentAuthorizationViewController*) paymentController).delegate = self;

取得エラー:

Error Domain=com.stripe.lib Code=50 "Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios ." UserInfo=0xxxxxxxxxxx {com.stripe.lib:ErrorMessageKey=Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios ., NSLocalizedDescription=Your payment information is formatted improperly. Please make sure you're correctly using the latest version of our iOS library. For more information see https://stripe.com/docs/mobile/ios .},

どんな助けでも大歓迎です。

4

2 に答える 2

0

PaymentKitを使ってリクエストしてみる

@IBAction func payTapped(AnyObject) {
    // Valiate that this device can take payments
    if (PKPaymentAuthorizationViewController.canMakePayments()) {
        // Construct the basic payment request
        var paymentRequest = PKPaymentRequest()
        paymentRequest.merchantIdentifier = "merchant.com.example";
        paymentRequest.supportedNetworks = [PKPaymentNetworkVisa, PKPaymentNetworkMasterCard, PKPaymentNetworkAmex]
        paymentRequest.merchantCapabilities = PKMerchantCapability.Capability3DS | PKMerchantCapability.CapabilityEMV
        paymentRequest.countryCode = "US"
        paymentRequest.currencyCode = "USD"
        paymentRequest.requiredShippingAddressFields = PKAddressField.All;

        // Add a line item
        var totalItem = PKPaymentSummaryItem(label:"Foo", amount:NSDecimalNumber(string:"0.05"))
        paymentRequest.paymentSummaryItems = [totalItem];

        // Show the Apple Pay controller
        var payAuth = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest)
        payAuth.delegate = self
        self.presentViewController(payAuth, animated:true, completion: nil)
    }
}
于 2015-03-17T07:42:27.133 に答える