Marketplace-Rakuten

 view release on metacpan or  search on metacpan

lib/Marketplace/Rakuten/Order.pm  view on Meta::CPAN

=head2 order

The raw structure got from the XML parsing

=head2 shop_type

Always returns C<rakuten>

=cut

has order => (is => 'ro', isa => HashRef, required => 1);

sub shop_type {
    return 'rakuten';
}

=head2 order_number

read-write accessor for the (shop) order number so you can set this
while importing it.

lib/Marketplace/Rakuten/Order/Item.pm  view on Meta::CPAN

=cut

use strict;
use warnings;

use Moo;
use MooX::Types::MooseLike::Base qw(HashRef Str);
use Data::Dumper;
use namespace::clean;

has struct => (is => 'ro', isa => HashRef);
has merchant_order_item => (is => 'rw', isa => Str);
has order_number => (is => 'ro', default => sub { 'unknown' });

sub quantity {
    return shift->struct->{qty} || 0;
}

=head2 remote_shop_order_item

It looks like the API just passes an id with the position:

lib/Marketplace/Rakuten/Response.pm  view on Meta::CPAN


The parsed data from xml, if any.

=cut

has success => (is => 'ro', isa => Bool);
has url     => (is => 'ro', isa => Str);
has status  => (is => 'ro', isa => Str);
has reason  => (is => 'ro', isa => Str);
has content => (is => 'ro', isa => Str);
has headers => (is => 'ro', isa => HashRef);

has data => (is => 'lazy');
sub _build_data {
    my $self = shift;
    my $data;
    if (my $xml = $self->content) {
        eval { $data = XMLin($xml,
                             ForceArray => [ qw/error order/ ],
                             # prevent <name> to be used as key in the structure
                             KeyAttr => [],



( run in 0.813 second using v1.01-cache-2.11-cpan-5f2e87ce722 )