Git Product home page Git Product logo

moodle-paygw_stripe's Introduction

Stripe

Provides a payment gateway with Stripe in Moodle

Setup

  1. Install the plugin
  2. Register for Stripe
  3. Grab your Stripe API and Secret keys
  4. Configure the Stripe payment account in Moodle with those keys and your payment method
  5. Add 'Enrolment on payment' to the Moodle courses that you want
  6. Configure the enrolment method with the currency you want to use

Details

Stripe offers 106+ currencies however certain payment gateways only support a subset of those.
E.g. Alipay only supports CNY and NZD currencies.

The plugin supports using promotion/coupon codes and automatic tax calculation.

This plugin can be used with these payment gateways:

  • Card
  • Alipay
  • Bancontact
  • EPS
  • giropay
  • iDEAL
  • P24
  • SEPA Direct Debit
  • Sofort
  • UPI
  • NetBanking
  • Klarna

Some of those payment gateways will only work in Stripe if you have provided additional verification details.

Warm Thanks

Thanks to E-learning Co., Ltd for sponsoring the work to add subscription support to this plugin.

moodle-paygw_stripe's People

Contributors

alexmorrisnz avatar 222dipa avatar

Stargazers

Davor Budimir avatar Orleando Dassi avatar Luke S Thompson avatar Oliver Solutions avatar Rafa Gaioso avatar Markus Liljergren avatar  avatar Pipe Vildoso Castillo avatar Ryan Nutt avatar Vitor Almeida avatar

Watchers

Markus Liljergren avatar  avatar  avatar  avatar

moodle-paygw_stripe's Issues

Trigger paid invoice creation in stripe

Hi,
Currently when paying for courses in moodle, the user receives only a receipt from Stripe. Proof of payment or Paid Invoice is not being generated no matter how much trying to enable it in Stripe. Currently logs show that
"invoice": null,
"invoice_creation": {
"enabled": false,

Would it be possible to make a checkbox (similar to tax inclusion or exclusion, coupon activation) to tell Stripe to create an invoice?
As a company selling courses online it is reasonable to receive an Invoice with all company details in Stripe.

Supported currencies should be updated

get_supported_currencies is outdated https://docs.stripe.com/currencies includes a lot more currency.

public static function get_supported_currencies(): array {
    return [
        'USD', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BIF', 
        'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BWP', 'BYN', 'BZD', 'CAD', 'CDF', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CVE', 
        'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GIP', 'GMD', 'GNF', 'GTQ', 
        'GYD', 'HKD', 'HNL', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'ISK', 'JMD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KRW', 
        'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MUR', 'MVR', 
        'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 
        'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SEK', 'SGD', 'SHP', 'SLE', 'SOS', 'SRD', 'STD', 
        'SZL', 'THB', 'TJS', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'UYU', 'UZS', 'VND', 'VUV', 'WST', 'XAF', 
        'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW'
    ];
}

Error in payment

Exception - Argument 1 passed to paygw_stripe\stripe_helper::save_payment_details() must be of the type string, null given, called in [dirroot]\payment\gateway\stripe\classes\stripe_helper.php on line 287

Special characters are not displayed right at checkout

Hello,

Course name is not displayed correctly when checking out a course. Instead of special characters it shows codes.
For example "Grundläggande" shows as "Grundl\u00e4ggande"

Need support for special characters.

thanks

(stripe-php library) Update from v9.4.0 to v10.21.0 (then later up to new v12)

G'day again,

It would be nice to get the stripe-php library updated to latest.

https://github.com/stripe/stripe-php/releases/tag/v9.4.0 (August 27, 2022) is in-repo.

https://github.com/stripe/stripe-php/releases/tag/v9.9.0 (November 9, 2022) is v9 final.

Then it was v10 from November 2022 to August 2023, and now they skipped v11 up to v12.

https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v10
https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v12

https://github.com/stripe/stripe-php/tags for more insights.

Cheers,
Luke

Store payment intent ID in Moodle DB

Is it possible to store the payment intent ID in the Moodle database? Perhaps in a paygw_stripe table, along side other useful data such as amount, status etc. This way payments could be queried Stripe-side at a later date, but also used for reporting.

I can only find Stripe customer ID's and Stripe product ID's being stored, and can only return all payment intents or intents limited by Stripe customer ID.

Alipay and Wechat Pay are not working

When Alipay and Wechat pay are activated, I see the following errors:

Missing required param: payment_method_options[alipay][currency].

The payment method wechat_pay cannot be used in setup mode.

Amount in yen is multiplied by 100 at checkout.

Tried using this plugin to accept payments in Japanese Yen (JPY). However, the plugin takes the set price and multiplies the total by 100 at the checkout. So a set price of ¥10,000 becomes ¥1,000,000.

Side-by-side with the PayPal gateway, PayPal processes the amount correctly.

Moodle error

Hi !
I just installed the plugin on our Moodle 3.11 and when I tried to do a payment on stripe I got this error:

{"exception":"moodle_exception","errorcode":"invalidtoken","message":

any ideas?

If I check on my Stripe account I can see the payment but on moodle I looks like I did not pay bc I have no access to the course I paid.

Thanks so much!

Make a purchase without saving your card information

Hi!

Once you save your card information, you can make purchases without having to enter it a second time.
This is convenient, but inconvenient in the following cases
-When you want to make a purchase with a different card.
-When a minor wants to make a purchase with a guardian's card information.

Below I share the response I got from Stripe when I talked to them about this.
If you pass "setup" as the "mode" parameter, a setup mode session will be created to set up future payments.
https://docs.stripe.com/payments/save-and-reuse
To accept subscription payments in Checkout, pass "subscription" as the "mode" parameter during Create a session.
https://stripe.com/docs/api/checkout/sessions /create#create_checkout_session-mode

Please consider this.

Stripe `application_fee_amount` per-course support (Platform Fee): w/ Course Fee set per-educator

G'day from over the ditch!

Is there any chance that you'd consider (and could use our help) building in support for application fees? Which also means support for storing multiple Stripe acct_ identifiers, for each relevant transfer destination.

This is for the case of an online platform (Moodle) which charges a fee for service, which would be set at product-level. We should consider application_fee_amount, as this has the inner mechanics already worked out for this use-case.

// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
$stripe = new \Stripe\StripeClient('sk_test_NLSWiAT3rEo0Er1FeoqB0X1E');

$stripe->paymentIntents->create([
  'amount' => 300,
  'currency' => 'aud',
  'application_fee_amount' => 30,
  'transfer_data' => ['destination' => '{{CONNECTED_ACCOUNT_ID}}'],
]);

This would be configurable per-course and allows for the LMS operator to control the application/platform fee per-course, and from there the remaining funds (majority of them typically) goes to the designated Stripe account.

Cheers,
Luke

Inconsistent database structure

Hi Alex,

a recent run of admin/cli/check_database_schema.php gave me this result for a recent installation of paygw_stripe which has been updates over some plugin versions already.

-------------------------------------------------------------------------------
paygw_stripe_subscriptions
 * column 'subscriptionid' has incorrect type 'C', expected 'I'
 * column 'status' should allow NULL (C)
-------------------------------------------------------------------------------

Looking at db/install.xml and db/upgrade.php, I can confirm the inconsistencies.

Would you mind to fix the inconsistencies in a future version of the plugin and add upgrade steps to fix existing (and inconsistent) installations?

Many thanks in advance,
Alex

Klarna payment method

Hi,

I would like to ask if it is possible to use Klarna as a payment method in Stripe Gateway.

I tried adding

'klarna' => get_string('payment method:klarna', 'paygw_stripe')

in classes/gateway.php -> function add_configuration_to_gateway_form()

and it seems to work, but I don't know if it's the best way or I missed something.

I would really appreciate it, thanks.

Best regards

Process payments in BRL

The plugin integrates perfectly with the Stripe platform, however, I missed the Brazilian currency (R$ or BRL). It would be nice to implement this currency in the plugin.

Use Stripe Payment links tp pay for courses and enrol

Hi,

In Stripe possible to set up payment links to sell products and issue payment proof (paid invoices) without having a webshop.
Could it be possible to add payment link as payment type for each course? Each course would be linked with it's own payment link to pay for the course and be enrolled later after successful payment.

Thank you!

Switching Stripe API keys breaks course enrolment

Hi Alex, I was pleased to see this plugin and although it works perfectly with Stripe's test keys, I get an error after switching to live keys. The payment does go through, but the customer does not get enrolled. Instead, they see this error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Something else happened, completely unrelated to Stripe{"exception":"invalid_response_exception","errorcode":"invalidresponse","message":"Invalid response value detected"}

Suggestions greatly appreciated,
– Robert

Alex, I forgot to add that I am using version 3.11.4, and planning to upgrade to 3.11.5 this week.

Taken from the Moodle plugins directory comments

Support for New Stripe Web hook

Pls support for Moodle 4.x and New Stripe 13.10.0 Webhook.
Plugin not working

Error on Moodle:
Exception - No such webhook endpoint: 'we_1NDxxxxxxxxxxxxxxxxxxxxxxxxxx'

Error on Stripe Dashbaord:
DELETE /v1/webhook_endpoints/we_1NDxxxxxxxxxxxxxxxxxxxxxxxxxx
Status
404 ERR
ID
req_JJGnPoVhID3Sjk
Time
08/02/2024, 04:01:50
IP address
120.72.91.157
API Version
2023-08-16
Latest
Source
Stripe/v1 PhpBindings/13.10.0 Moodle Stripe Payment Gateway/2023091800 (https://github.com/alexmorrisnz/moodle-paygw_stripe)
resource_missing - webhook_endpoint
No such webhook endpoint: 'we_1NDxxxxxxxxxxxxxxxxxxxxxxxxxx'

Unable to enter promotion code when selecting subscription

Hello,
We found a missing setting regarding the ability to enter promotion codes.
When I select "Subscription" in payment type even though "Allow Promotion Codes" is checked, the actual purchase screen does not show a screen to enter the promotion code.

I also noticed that the course name and price are not displayed when subscription.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.