NYYU Logo
APIPresale Payment

Pay For Presale With Stripe

Process presale payments using Stripe payment gateway with full 3D Secure support

Stripe Payment for Presale

Process secure credit card payments with PCI-compliant Stripe integration

Mutation

💳
payStripeForPreSale
Process presale payment using Stripe payment gateway

Schema

payStripeForPreSale(
  id: Int
  presaleId: Int!
  orderId: Int!
  amount: Float!
  fiatAmount: Float!
  fiatType: String!
  paymentIntentId: String!
  paymentMethodId: String!
  isSaveCard: Boolean
): 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")
paymentIntentIdRequired
Type: String!

The payment intent ID from Stripe. See Stripe API docs

paymentMethodIdRequired
Type: String!

The payment method ID from Stripe. See Stripe API docs

isSaveCardOptional
Type: Boolean
Set to true to save card for future payments, false for new card

Return Value

📦
Returns PayResponse Object

Contains client secret and payment status for completing the Stripe payment flow

Example

💻
Usage Example
Process $500 payment for presale order
mutation {
  payStripeForPreSale(
    id: null
    presaleId: 1
    orderId: 123
    amount: 500.0
    fiatAmount: 500.0
    fiatType: "USD"
    paymentIntentId: "pi_1Fxxxxx"
    paymentMethodId: "pm_1Fxxxxx"
    isSaveCard: false
  ) {
    clientSecret
    paymentIntentId
    requiresAction
    error
  }
}

Response Example

📤
Sample Response
Successful payment initiation
{
  "data": {
    "payStripeForPreSale": {
      "clientSecret": "pi_1Fxxxxx_secret_xxxxx",
      "paymentIntentId": "pi_1Fxxxxx",
      "requiresAction": false,
      "error": null
    }
  }
}

Integration Flow

🔄
Stripe Payment Processing
Complete integration workflow
1
Initialize Stripe

Load Stripe.js in your frontend and create a payment intent

2
Collect Card Details

Use Stripe Elements to securely collect card information from the user

3
Get Stripe IDs

Obtain paymentIntentId and paymentMethodId from Stripe API

4
Call payStripeForPreSale

Submit payment with Stripe IDs to process the presale payment

5
Handle Response

If requiresAction is true, use clientSecret with Stripe's confirmCardPayment for 3D Secure

Use Cases

💳
New Card Payments

Accept one-time payments from new credit or debit cards with full PCI compliance

💾
Save Card Option

Allow users to save their card details for faster future presale payments

🔒
3D Secure Support

Built-in support for 3D Secure authentication when required by the card issuer

🌍
Multi-Currency

Support for multiple fiat currencies with automatic conversion to USD

💡
Best Practice

Always check the requiresAction flag in the response. When true, you must use Stripe's confirmCardPayment method with the clientSecret to complete 3D Secure authentication. This ensures compliance with Strong Customer Authentication (SCA) requirements.