saleor / saleor-app-payment-stripe

https://saleor.io/
Other
13 stars 156 forks source link

Store payment methods #216

Open azproduction opened 2 months ago

azproduction commented 2 months ago

Hi! I am trying to figure out how to store payment methods (which are exposed though Checkout.storedPaymentMethods). Though Saleor I discovered that set of mutations related to "paymentGatewayInitializeTokenization" should be used.

Seems like saleor-app-payment-stripe does not support "stored" payments flow or I am doing something completely wrong.

I would appreciate any help or direction I could take 🙏

That's what I receive when call paymentGatewayInitializeTokenization:

mutation {
  paymentGatewayInitializeTokenization(
    channel: "uk", id: "app.saleor.stripe"
  ) {
    result
    data
    errors {
      field
      message
      code
    }
  }
}
{
  "data": {
    "paymentGatewayInitializeTokenization": {
      "result": "FAILED_TO_DELIVER",
      "data": null,
      "errors": [
        {
          "field": null,
          "message": "No active payment app that could initialize payment gateway for tokenization.",
          "code": "NOT_FOUND"
        }
      ]
    }
  }
}
azproduction commented 2 months ago

Seems like Stripe is able to store payment details, which is fine for me as well. However it does not happen because saleor-app-payment-stripe does not send ephemeralKey.

You should use the ephemeralKeys in your Frontend and as well as in your backend so that after successful payment of the user, the payment details such as card details will be saved securely in stripe.

Is possible to contribute that missing part?

azproduction commented 2 months ago

Hi @typeofweb, I am trying to find a way to save payment options via Stripe and seems like you are the closest person to saleor-app-payment-stripe. Could you navigate me with this question?