NYYU Logo
APIPresale Payment

Pay For Presale With Stripe Saved Card

Process presale payments using previously saved credit card information

Stripe Saved Card Payment

Fast checkout with previously saved credit card information

Mutation

💾
payStripeForPreSaleWithSavedCard
Process payment using a saved card ID

Schema

payStripeForPreSaleWithSavedCard(
  id: Int
  presaleId: Int!
  orderId: Int!
  amount: Float!
  fiatAmount: Float!
  fiatType: String!
  cardId: Int!
  paymentIntentId: String!
): PayResponse

Parameters

idOptional
Type: Int
Payment ID. Set to null for the first call
presaleIdRequired
Type: Int!
The unique identifier of the presale round
orderIdRequired
Type: Int!
The ID of the presale order to pay for
amountRequired
Type: Float!
The payment amount in USD
fiatAmountRequired
Type: Float!
The amount in the payment currency (for currency conversion)
fiatTypeRequired
Type: String!
The currency type (e.g., "USD", "EUR", "GBP")
cardIdRequired
Type: Int!
The ID of the saved card to use for payment
paymentIntentIdRequired
Type: String!
The payment intent ID from Stripe

Return Value

📦
Returns PayResponse Object

Contains client secret and payment status for completing the payment

Example

💻
Usage Example
Pay with saved card ID 456
mutation {
  payStripeForPreSaleWithSavedCard(
    id: null
    presaleId: 1
    orderId: 123
    amount: 500.0
    fiatAmount: 500.0
    fiatType: "USD"
    cardId: 456
    paymentIntentId: "pi_1Fxxxxx"
  ) {
    clientSecret
    paymentIntentId
    requiresAction
    error
  }
}

Response Example

📤
Sample Response
Successful payment with saved card
{
  "data": {
    "payStripeForPreSaleWithSavedCard": {
      "clientSecret": "pi_1Fxxxxx_secret_xxxxx",
      "paymentIntentId": "pi_1Fxxxxx",
      "requiresAction": false,
      "error": null
    }
  }
}

Key Differences

🔄
Saved Card vs New Card
Understanding the differences
Saved Card Payment
Uses cardId parameter
No paymentMethodId needed
No isSaveCard flag
Faster checkout experience
New Card Payment
Uses paymentMethodId
Requires isSaveCard flag
Card details collected via Stripe Elements
Can save card for future use

Benefits

Faster Checkout

Skip card details entry by using previously saved payment methods

🔒
Secure Storage

Card details are securely stored by Stripe, never on your servers

Better UX

Improve conversion rates with one-click payment experience

🔄
Recurring Purchases

Perfect for users who make multiple presale purchases

💡
Best Practice

List saved cards to users before checkout and let them choose their preferred payment method. Always provide an option to add a new card. Validate that the cardId belongs to the authenticated user to prevent unauthorized charges.