added recurring transaction cancellation handling
This commit is contained in:
parent
e67699e019
commit
54146e32a5
5 changed files with 91 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ use WebGUI::Shop::Admin;
|
|||
use WebGUI::Shop::AddressBook;
|
||||
use WebGUI::Shop::Credit;
|
||||
use WebGUI::Shop::TransactionItem;
|
||||
use WebGUI::Shop::Pay;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -68,6 +69,21 @@ sub addItem {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 cancelRecurring ( )
|
||||
|
||||
Cancel a recurring transaction, and calls onCancelRecurring in whatever sku is attached to this transaction.
|
||||
|
||||
=cut
|
||||
|
||||
sub cancelRecurring {
|
||||
my ($self) = @_;
|
||||
$self->getPaymentGateway->cancelRecurringPayment($self);
|
||||
my ($item) = $self->getItems;
|
||||
$item->getSku->onCancelRecurring($item);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 completePurchase ( transactionCode, statusCode, statusMessage )
|
||||
|
||||
See also denyPurchase(). Completes a purchase by updating the transaction as a success, and calling onCompletePurchase on all the skus in the transaction.
|
||||
|
|
@ -321,6 +337,21 @@ sub getItems {
|
|||
return \@itemsObjects;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getPaymentGateway ()
|
||||
|
||||
Returns a reference to the payment gateway attached to this transaction.
|
||||
|
||||
=cut
|
||||
|
||||
sub getPaymentGateway {
|
||||
my ($self) = @_;
|
||||
my $pay = WebGUI::Shop::Pay->new($self->session);
|
||||
return $pay->getPaymentGateway($self->get('paymentDriverId'));
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 new ( session, transactionId )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue