| 1 | package PagSeguro::API::Resource; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | sub new { | ||
| 6 | my $class = shift; | ||
| 7 | return bless { | ||
| 8 | _config => { | ||
| 9 | BASE_URI => 'https://ws.pagseguro.uol.com.br', | ||
| 10 | SANDBOX_URI => 'https://ws.sandbox.pagseguro.uol.com.br', | ||
| 11 | CHECKOUT => '/v2/checkout/', | ||
| 12 | CHECKOUT_PAYMENT => | ||
| 13 | 'https://pagseguro.uol.com.br/v2/checkout/payment.html', | ||
| 14 | SANDBOX_CHECKOUT_PAYMENT => | ||
| 15 | 'https://sandbox.pagseguro.uol.com.br/v2/checkout/payment.html', | ||
| 16 | TRANSACTION => '/v2/transactions/', | ||
| 17 | ABANDONED => 'abandoned', | ||
| 18 | NOTIFICATIONS => 'notifications/', | ||
| 19 | |||
| 20 | } | ||
| 21 | }, $class || ref $class; | ||
| 22 | } | ||
| 23 | |||
| 24 | # methods | ||
| 25 | sub get { | ||
| 26 | my ($self, $code) = @_; | ||
| 27 | return $self->{_config}->{$code}; | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; | ||
| 31 | __END__ |