File: RefundTransaction.t

package info (click to toggle)
libbusiness-paypal-api-perl 0.69-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 280 kB
  • ctags: 51
  • sloc: perl: 1,856; makefile: 2
file content (55 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use Test::More;
if( ! $ENV{WPP_TEST} || ! -f $ENV{WPP_TEST} ) {
    plan skip_all => 'No WPP_TEST env var set. Please see README to run tests';
}
else {
    plan tests => 2;
}

use_ok( 'Business::PayPal::API::RefundTransaction' );
#########################

require 't/API.pl';

my %args = do_args();

my $pp = new Business::PayPal::API::RefundTransaction( %args );

print STDERR <<"_TRANSID_";

Please login to the PayPal Developer's site, and start a sandbox in
the Business account you want to test.

Review the Business accounts transaction history:

    My Account -> History (tab)

Follow the 'Details' link for a transaction (whose status is
'Completed') that occurred in the past 60 days.

Copy the Transaction ID for that transaction. It may appear like this:

    Express Checkout Payment Received (ID # 2DE2563K55B16978M)

_TRANSID_

print STDERR "\nType or paste that Transaction ID here and hit Enter: \n";

my $transid = <STDIN>; chomp $transid;

die "Need a transaction id.\n" unless $transid;

my %resp = $pp->RefundTransaction( TransactionID => $transid,
                                   RefundType    => 'Full',
                                   Memo          => 'Fancy refund time.' );

like( $resp{Ack}, qr/Success/ , "Successful refund." );

if( $resp{Ack} ) {
    print STDERR <<"_REFUND_";

You may now login to your Business sandbox account and verify the
transaction was refunded.

_REFUND_
}