Skip to content

Peatix/Net-WePay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

my $wepay = Net::WePay->new(
    access_token  => 'Access Token of your merchant'
);

my $response_body_hash = $wepay->call(
    '/checkout/create'
    , account_id        => 'Account ID of your merchant'
    , short_description => 'Gorgeous LED TV 50 inch'
    , type              => 'GOODS'
    , amount            => '5999.99'
);

my $checkout_id = $response_body_hash->{ checkout_id };

See Net::WePay::OAuth2 for how the module helps getting an access_token on behalf of your merchant.

DESCRIPTION

This module is a bunch of helper methods that does most of the heavy liftings required to call WePay API v2.

METHODS

new

( access_token => ..., is_production => ..., )

call

($api_path, %params )

LICENSE

This module is licensed under the same terms as Perl itself.

AUTHOR

Fumiaki Yoshimatsu

SEE ALSO

SYNOPSIS

my $wepay_oauth2 = Net::WePay::OAuth2->new(
    client_id       => 'Your App\'s client id'
    , client_secret => 'Your App\'s client secret'
    , redirect_uri  => URI->new( 'http://your-oauth-call-back-endpoint' )
    , is_production => 0 # decides which WePay endpoint to go
);

my $uri = $wepay_oauth2->get_authorize_uri(
    permissions  => [ 'manage_accounts', 'collect_payments' ]
    , user_name  => 'Merchant\'s name'
    , user_email => 'Merchant\'s email'
    , state      => 'surfin csrf'
);

$res->redirect( $uri );

...

my $code = $req->params->{ code }; # in OAuth2 response
my $access_token_info = $wepay_oauth2->get_token_from_code(
    $code
);

See Net::WePay for how the module helps calling WePay API.

DESCRIPTION

This module is a bunch of helper methods that does most of the heavy liftings required to call WePay API v2.

METHODS

new

( client_id => ..., client_secret => ..., redirect_uri => ..., is_production => ..., )

get_authorize_uri

( \@permissions, %( user_email => ..., user_name => ... ) )

get_token_from_code

( $code )

LICENSE

This module is licensed under the same terms as Perl itself.

AUTHOR

Fumiaki Yoshimatsu

SEE ALSO

About

WePay client SDK for Perl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages