-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from moderntribe/feature/tribe-commerce-support
add PayPal ticket generation support
- Loading branch information
Showing
10 changed files
with
683 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
|
||
/** | ||
* Class Tribe__Cli__Commerce__Command | ||
* | ||
* @since 0.1.0 | ||
*/ | ||
class Tribe__Cli__Commerce__Command extends WP_CLI_Command { | ||
|
||
/** | ||
* @var \Tribe__Cli__Commerce__Generator__PayPal__CLI | ||
*/ | ||
protected $paypal; | ||
|
||
/** | ||
* Tribe__CLI__Commerce__Command constructor. | ||
* | ||
* @since 0.1.0 | ||
* | ||
* @param \Tribe__Cli__Tickets__Generator__RSVP__CLI $paypal | ||
*/ | ||
public function __construct( Tribe__Cli__Commerce__Generator__PayPal__CLI $paypal ) { | ||
parent::__construct(); | ||
$this->paypal = $paypal; | ||
} | ||
|
||
/** | ||
* Generates PayPal orders for a ticketed post. | ||
* | ||
* ## OPTIONS | ||
* | ||
* <post_id> | ||
* : PayPal orders will be attached to this post | ||
* | ||
* [--count=<count>] | ||
* : the number of PayPal orders to generate | ||
* --- | ||
* default: 10 | ||
* --- | ||
* | ||
* [--attendees_min=<attendees_min>] | ||
* : the minimum number of attendees per PayPal order | ||
* --- | ||
* default: 1 | ||
* --- | ||
* | ||
* [--attendees_max=<attendees_max>] | ||
* : the maximum number of attendees per PayPal order | ||
* --- | ||
* default: 3 | ||
* --- | ||
* | ||
* [--order_status=<order_status>] | ||
* : the status of the PayPal orders | ||
* --- | ||
* default: completed | ||
* options: | ||
* - completed | ||
* - pending | ||
* - denied | ||
* - refunded | ||
* --- | ||
* | ||
* [--ticket_id=<ticket_id>] | ||
* : the ID of the ticket PayPal orders should be generated for | ||
* | ||
* ## EXAMPLES | ||
* | ||
* wp commerce generate-paypal-orders 23 | ||
* wp commerce generate-paypal-orders 23 --count=89 | ||
* wp commerce generate-paypal-orders 23 --attendees_min=3 | ||
* wp commerce generate-paypal-orders 23 --attendees_min=3 --attendees_max=10 | ||
* wp commerce generate-paypal-orders 23 --attendees_min=3 --attendees_max=10 --order_status=denied | ||
* wp commerce generate-paypal-orders 23 --ticket_id=89 | ||
* | ||
* @subcommand generate-paypal-orders | ||
* | ||
* @since TBD | ||
* | ||
*/ | ||
public function generate_paypal_orders( array $args = null, array $assoc_args = null ) { | ||
$this->paypal->generate_orders( $args, $assoc_args ); | ||
} | ||
|
||
/** | ||
* Removes generated PayPal orders from a ticketed post. | ||
* | ||
* ## OPTIONS | ||
* | ||
* <post_id> | ||
* : PayPal orders will be removed from this post | ||
* | ||
* ## EXAMPLES | ||
* | ||
* wp commerce reset-paypal-orders 23 | ||
* | ||
* @subcommand reset-paypal-orders | ||
* | ||
* @since TBD | ||
* | ||
*/ | ||
public function reset_paypal_orders( array $args = null, array $assoc_args = null ) { | ||
$this->paypal->reset_orders( $args, $assoc_args ); | ||
} | ||
} |
Oops, something went wrong.