ePages 7.27.0 - DE_EPAGES/AmazonPayments/API/Payment.pm

Package DE_EPAGES::AmazonPayments::API::Payment

Payment functions for AmazonPayments.

@EXPORT_OK
ConvertAmazonAddress
StoreAmazonShippingAddress
StoreAmazonBillingAddress
SendDeclinedMail

Functions

ConvertAmazonAddress
SendDeclinedMail
StoreAmazonBillingAddress
StoreAmazonShippingAddress

ConvertAmazonAddress

Converts the given address info from Amazon into a structure suitable to insert into an epages Address object.

Syntax
$hShippingAddressData = ConvertAmazonAddress( $LineItemPayment, $AmazonAddr );
Input
$LineItemPayment (object)
LineItemPayment
$AmazonAddr (DE_EPAGES::AmazonPayments::API::DTO::AddressInfo)
Amazon address info
$BuyerEmail (string)
buyer email address
Return
$hShippingAddressData (ref.hash)
Customer address, see DE_EPAGES::Address

SendDeclinedMail

Send a mail to the merchant if payment was declined by Amazon

Syntax
SendDeclinedMail($Order);
Input
$Order (string)
The order where the payment was declined

StoreAmazonBillingAddress

Generate user and basket addresses from address fields retrieved from Amazon This method should be called after authorization, when amazon reveals the customer's billing address information.

Syntax
$Stored = StoreAmazonBillingAddress( $Basket, $hAddressData );
Input
$Basket (object)
basket object
$hAddressData (ref.hash)
Customer billing address data, see DE_EPAGES::Address
Return
$Stored (boolean)
true if the address data was stored; false if it was not stored
because it doesn't differ from the currently set address

StoreAmazonShippingAddress

Generate user and basket addresses from address fields retrieved from Amazon This method assumes that shipping address is equal to the billing address, as it is the only information provided by amazon during checkout.

Syntax
$Stored = StoreAmazonShippingAddress( $Basket, $hAddressData );
Input
$Basket (object)
basket object
$hAddressData (ref.hash)
Customer address, see DE_EPAGES::Address
Return
$Stored (boolean)
true if the address data was stored; false if it was not stored
because it doesn't differ from the currently set address