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.
This module is a bunch of helper methods that does most of the heavy liftings required to call WePay API v2.
( access_token => ..., is_production => ..., )
($api_path, %params )
This module is licensed under the same terms as Perl itself.
Fumiaki Yoshimatsu
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.
This module is a bunch of helper methods that does most of the heavy liftings required to call WePay API v2.
( client_id => ..., client_secret => ..., redirect_uri => ..., is_production => ..., )
( \@permissions, %( user_email => ..., user_name => ... ) )
( $code )
This module is licensed under the same terms as Perl itself.
Fumiaki Yoshimatsu