ios – (Swift) Stripe Apple Pay Fee not accomplished







Making an attempt to setup Stripe apple pay in my undertaking, however maintain operating into “fee not accomplished” as seen right here:

The place I am calling the fee mannequin

if backendModel.paymentIntentParams != nil {
    PaymentButton() { cartCost, whole: totalCost, clientSecret: backendModel.paymentIntentParams?.clientSecret, pi: backendModel.paymentIntentParams?.stripeId)
    .padding([.horizontal, .bottom])

Apple Pay Mannequin

    func pay(quantity: Double, whole: Double, clientSecret: String?, pi: String?) {
        self.clientSecret = clientSecret
        self.pi = pi
        // Configure our Apple Pay fee request
        let paymentRequest = StripeAPI.paymentRequest(withMerchantIdentifier: "service", nation: "US", foreign money: "usd")
        paymentRequest.requiredBillingContactFields = [.postalAddress]
        paymentRequest.requiredShippingContactFields = []
        paymentRequest.paymentSummaryItems = [
            PKPaymentSummaryItem(label: "Subtotal", amount: NSDecimalNumber(value: amount)),
            PKPaymentSummaryItem(label: "Delivery Fee + Taxes", amount: NSDecimalNumber(value: 5.00)),
            PKPaymentSummaryItem(label: "Total", amount: NSDecimalNumber(value: total))
        // Current apple pay context
        let applePayContext = STPApplePayContext(paymentRequest: paymentRequest, delegate: self)
    func applePayContext(_ context: STPApplePayContext, didCreatePaymentMethod paymentMethod: STPPaymentMethod, paymentInformation: PKPayment, completion: @escaping STPIntentClientSecretCompletionBlock) {
        // fee methodology was created -> verify PaymentIntent
        if (self.clientSecret != nil) {
            // name the completion block with the consumer secret
            completion(clientSecret, nil)
        } else {
            completion(nil, NSError())
    func applePayContext(_ context: STPApplePayContext, didCompleteWith standing: STPPaymentStatus, error: Error?) {
        // get the fee standing or error
        self.paymentStatus = standing
        self.lastPaymentError = error
        if standing == .success {
            print("Fee success!")


Share this


Low-cost assessments with nanoparticle-based sensors can measure residual herbicides in meals

Nov 01, 2022 (Nanowerk Information) Two newly developed, low-cost assessments that use nanoparticles to detect chemical compounds can precisely measure tiny quantities of two...

What if ceramics had been ductile? — ScienceDaily

Within the 1900s it was found that ceramic supplies, no less than in precept, may be completely deformed with out fracture at room...

Recent articles

More like this