Skip to content

Cannot create a PaymentLink #241

@peterlondon1

Description

@peterlondon1

Cannot create a PaymentLink

using Stripe-kit 22.1.0

have completely rebuilt project and reset package caches in Xcode 15.0

[ WARNING ] Data corrupted at path 'customerCreation'. Cannot initialize PaymentLinkCustomerCreation from invalid String value if_required. [request-id: D5C07195-8F1D-472B-83C0-9DC0C0D5DEA2]

In file: Payment Links / PaymentLink.swift, line 454,
please change
from:
case ifRequired
to:
case ifRequired = "if_required"

(but I don't understand why supplying 'nil' does not work)

let newPaymentLink = try await stripeClient.paymentLinks.create(
                       lineItems: [ ["price" : newPrice.id, "quantity" : 1]],
                       metadata: nil,
                       afterCompletion: nil,
                       allowPromotionCodes: nil,
                       applicationFeeAmount: nil,
                       applicationFeePercent: nil,
                       automaticTax: nil,
                       billingAddressCollection: nil,
                       consentCollection: nil,
                       currency: nil,
                       customFields: nil,
                       customText: nil,
                       customerCreation: nil,
                       invoiceCreation: nil,
                       onBehalfOf: nil,
                       paymentIntentData: nil,
                       paymentMethodCollection: nil,
                       paymentMethodTypes: nil,
                       phoneNumberCollection: nil,
                       shippingAddressCollection: nil,
                       shippingOptions: nil,
                       submitType: nil,
                       subscriptionData: nil,
                       taxIdCollection: nil,
                       expand: nil
                   )

Andrew, thanks so much for creating and maintaining this vital package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions