Skip to content

Releases: skelpo/PayPal

v0.3.2

23 Jan 22:32
54e8cf3
Compare
Choose a tag to compare

Padded Currency Values

Format money decimal values with trailing 0 characters, so there are as many fraction digits as the currency exponent number:

85.8 USD => 85.80
10 USD => 10.00
10 XXX => 10

This is because some endpoint returned validation errors if this padding wasn't there.

v0.3.1

23 Jan 20:01
0680ad5
Compare
Choose a tag to compare

Decoding Int and String for quantity Properties

The Order.Item.quantity and Payment.Item.quantity properties are documented as strings in the PayPal API documentation, but you actually get ints back when you create a payment or order. Because of this, we attempt to decode an int, and fall back to a string if we get a type mismatch decoding error.

v0.3.0

23 Jan 16:28
7db8317
Compare
Choose a tag to compare

Failing Properties

The biggest change in this release is that properties themselves handle validations, instead of the parent type. You will notice that quite a few initializers don't accept the primitive types like String or Int, but instead something like Failable<Int, ...>. You can wrap the those value in .init(value) and everything should work again:

try Name(
    prefix: .init("Mr."), 
    given: .init("Caleb"), 
    surname: .init("Kleveter"), 
    middle: .init("J"), 
    suffix: .init(nil), 
    full: .init("Caleb J Kleveter")
)

Instead of setting the properties with the .set method like you used to:

try name.set(\.prefix <~ nil)`

You can use plain old property setting:

try name.prefix <~ nil

The Environment.domain property is now public, so you can easily get the API domain for the endpoints you are using.

v0.2.0

03 Dec 14:48
c4b0d39
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

No Environmental Variation

  • Pass client ID and secret into PayPalProvider initializer for flexibility during app configuration, instead of requiring environment variables.
  • Remove all ID assignment from initializers.
  • Made some types into sub-types, i.e. AgreementState => Agreement.State.
  • Replaced Money and Amount structs with generic AmountType struct.
  • Created Country struct which encodes/decodes using a single value container to handle country code validation.
  • Created a Province enum that represents the states or provinces a country can have.
  • Extended HTTPHeaderName with custom PayPal headers.

v0.1.0

03 Oct 19:08
176d506
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

You'll Pay. No, the Buyer Will.

A mostly incomplete and partially broken interface for PayPal's REST API, but hey, that's what pre-releases are for, right?

The only thing that we know works are basic payments. You can read about how to implement that in the README.

Be sure to leave feed back and suggestions for the next releases!