-
Notifications
You must be signed in to change notification settings - Fork 212
Enable Deposits Support #4273
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
base: develop
Are you sure you want to change the base?
Enable Deposits Support #4273
Conversation
…method_checkbox filter.
/** | ||
* Deposits order sets up payment intent. | ||
*/ | ||
public function test_deposit_product_uses_setup_intents() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing: I think I've done the mock incorrectly.
There was 1 error:
1) WC_Stripe_UPE_Payment_Gateway_Test::test_deposit_product_uses_setup_intents
Cannot modify header information - headers already sent by (output started at /tmp/wordpress-tests-lib/includes/bootstrap.php:261)
/tmp/wordpress/wp-includes/pluggable.php:1450
/tmp/wordpress/wp-includes/pluggable.php:1560
/var/www/html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php:1600
/var/www/html/wp-content/plugins/woocommerce-gateway-stripe/tests/phpunit/payment-methods/test-class-wc-stripe-upe-payment-gateway.php:2313
phpvfscomposer:///var/www/html/wp-content/plugins/woocommerce-gateway-stripe/vendor/phpunit/phpunit/phpunit:106
// If cart or order contains a product that requires a payment token, enable payment method if it's reusable. | ||
if ( $this->cart_contains_deposit() || ( ! empty( $order_id ) && $this->order_contains_deposit( $order_id ) ) ) { | ||
return $this->is_reusable(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to just be a duplicate of the above unless I'm missing something in looking at this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to just be a duplicate of the above unless I'm missing something in looking at this
You're not missing anything, it is. I've removed it in d33b94d
@vikrampm1 This is ready for the next step but because we normally don't work on Stripe, not sure what that step should be, if we should be aiming to QA this or just pass to the appropriate Woo team to review |
@dkotter we can do QA and then pass it over to Woo to take it from there. However, not sure how to track this over Linear as we also don't have the Stripe team setup. This might be a one-off that we need to track here and hand off once QA is complete cc @ankitguptaindia @qasumitbagthariya |
@vikrampm1 -- will this only work with the Stripe plugin? Or can it work with WooPayments too? |
@DustinHartzler WooPayments will need to add the feature, similar to support for Pre-orders and Subscriptions. On the Deposits PT, I was asked to prioritize this extension. The code for the Deposits PR is in https://github.com/woocommerce/woocommerce-deposits/pull/720 (ie, unreleased). If WooPayments will require additional hooks, please let me know. |
Supersedes #3855
Related WOODEP-1
Related https://github.com/woocommerce/woocommerce-deposits/issues/715 (specific task)
Related https://github.com/woocommerce/woocommerce-deposits/issues/375 (project)
Changes proposed in this Pull Request:
Introduces support of the
deposits
feature for processing scheduled and subsequent orders in WooCommerce Deposits. This is to allow merchants using the Deposits extension to be paid automatically on the payment plan schedule and as the merchant completes orders with a fixed or percentage deposit.Introduces
WC_Stripe_Deposits_Trait
for supporting the feature.Initilization of the feature requires:
wc_deposits_init()
function (available as the Deposits extension is included)tokenization
Similar to Pre-Orders, the token/intent is stored against the order rather than as a user payment method. The intent is detached once the order is fully paid to prevent live intents from being stored in the database longer than they are required. The intent details are retained after the final payment to allow for refunds.
This does not include any UI changes so testing on mobile is not required.
Note
PHPUnit tests have been started but a currently broken.
I'm going to need some assistance about how to test with Deposits. I was going to base them on the pre-orders tests but I can't see what I need to mock differently for Desposits.
Testing instructions
Deposits 2 day payment plan
-- I'll use this name below$2 Deposits product ($1 deposit)
-- I'll use this name below$2 Deposits product (50% deposit)
-- I'll use this name belowDeposits 2 day payment plan
wp_wc_orders
table, the charge date to modify is thedate_created_gmt
columnwp eval "do_action( 'woocommerce_invoice_scheduled_orders' );"
to emulate the cron job firing.detach
endpoint has been hit$2 Deposits product ($1 deposit)
productdetach
endpoint has been hit$2 Deposits product (50% deposit)
productdetach
endpoint has been hitChangelog entry
Add - Introduce support for automatic payment processing in WooCommerce Deposits
Comment
Post merge