Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe Integration Support #1485

Open
mehsaandev opened this issue Jul 11, 2024 · 5 comments · May be fixed by #1528
Open

Stripe Integration Support #1485

mehsaandev opened this issue Jul 11, 2024 · 5 comments · May be fixed by #1528
Assignees

Comments

@mehsaandev
Copy link
Contributor

No description provided.

@kmahmood74
Copy link
Collaborator

this should be done as a separate module

@kmahmood74 kmahmood74 moved this from Backlog to Ready for Work in Ensemble Jul 17, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Ensemble Jul 17, 2024
@hemish11
Copy link
Contributor

Heres the EDL:

createPaymentMethod:
  email: ${email}  # Email of the customer
  phone: ${phone}  # Phone number of the customer
  city: ${city}
  country: ${country}
  line1: ${line1}
  line2: ${line2}
  postalCode: ${postalCode}
  onSuccess: |-
    //@code
    statusText.text = 'Payment method created successfully: ' + paymentMethod.id;
  onError: |-
    //@code
    statusText.text = 'Error creating payment method: ' + error.message;

# Action to confirm payment
confirmPayment:
  clientSecret: ${clientSecret}  # The client secret received from the backend
  paymentMethodId: ${paymentMethodId}  # ID of the payment method created
  onSuccess: |-
    //@code
    statusText.text = 'Payment confirmed successfully: ' + paymentIntent.id;
  onError: |-
    //@code
    statusText.text = 'Error confirming payment: ' + error.message;

# Action to handle Stripe setup
initializeStripe:
  publishableKey: ${publishableKey}  # Your Stripe publishable key
  onSuccess: |-
    //@code
    statusText.text = 'Stripe initialized successfully';
  onError: |-
    //@code
    statusText.text = 'Error initializing Stripe: ' + error.message;

@hemish11
Copy link
Contributor

hemish11 commented Aug 3, 2024

Here is a detailed paragraph explaining the methods:

stripeInit

  • Purpose: To initialize the Stripe SDK with the necessary configuration.
  • Actions:
    • Set the publishable key in the Stripe SDK.
    • Optionally set the merchant identifier.
    • Optionally set the merchant country code.
    • Optionally set the Stripe account ID.
    • Call the success callback if initialization is successful.
    • Call the error callback if there is an issue during initialization.

createPaymentIntent

  • Purpose: To create a payment intent on the backend server and obtain the client secret.
  • Actions:
    • Accept the required parameters for the amount and currency.
    • Optionally include payment method, confirm status, description, metadata, and receipt email.
    • Send a POST request to the backend server to create a payment intent.
    • The backend handles creating the payment intent with Stripe and returns the client secret.
    • Call the success callback with the client secret if the request is successful.
    • Call the error callback with an error message if there is an issue during the request.

showPaymentSheet

  • Purpose: Present the Stripe Payment Sheet UI so the user can complete the payment.
  • Actions:
    • Initialize the payment sheet with required parameters such as client secret, merchant display name, and merchant country code.
    • Optionally configure Apple Pay, Google Pay, theme style, appearance, billing details, primary button appearance, and other settings.
    • Present the Stripe Payment Sheet UI to the user.
    • Allow the user to enter their payment details and complete the payment.
    • Call the success callback if the payment is completed successfully.
    • Call the error callback with an error message if there is an issue during the payment process.

@kmahmood74
Copy link
Collaborator

looks good, please go ahead and implement quickly.

@hemish11 hemish11 linked a pull request Aug 5, 2024 that will close this issue
@sharjeelyunus
Copy link
Member

@mehsaandev can you please verify if this fulfils your requirements?

CC: @ridsashabbir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Planning
Development

Successfully merging a pull request may close this issue.

5 participants