Clone the twdehands SDK into mrktplaats and retarget naming and defaults for app.marktplaats.nl while keeping the same request/response bodies and endpoint behavior.
24 lines
677 B
Go
24 lines
677 B
Go
package mrktplaats
|
|
|
|
import "context"
|
|
|
|
// PaymentService handles payment cart operations.
|
|
type PaymentService struct {
|
|
t *transport
|
|
}
|
|
|
|
// PaymentCartCountResponse contains the number of items in the payment cart.
|
|
type PaymentCartCountResponse struct {
|
|
UserID string `json:"userId"`
|
|
NumberOfItems int `json:"numberOfItems"`
|
|
}
|
|
|
|
// CartItemCount returns the number of items in the payment cart.
|
|
func (s *PaymentService) CartItemCount(ctx context.Context) (*PaymentCartCountResponse, error) {
|
|
var resp PaymentCartCountResponse
|
|
if err := s.t.get(ctx, "/app/payments/v3/payment-cart/number-of-items", nil, &resp); err != nil {
|
|
return nil, err
|
|
}
|
|
return &resp, nil
|
|
}
|